| /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| */ |
| |
| /* This file defines the completion callback type. */ |
| |
| /* The callback function. */ |
| typedef void PP_CompletionCallback_Func([inout] mem_t user_data, |
| [in] int32_t result); |
| |
| /* Any method that takes a PP_CompletionCallback has the option of completing |
| * asynchronously if the operation would block. Such a method should return |
| * PP_Error_WouldBlock to indicate when the method will complete |
| * asynchronously. If the completion callback is NULL, then the operation |
| * will block if necessary to complete its work. PP_BlockUntilComplete() |
| * provides a convenient way to specify blocking behavior. |
| * |
| * The result parameter passes an int32_t that if negative indicates an error |
| * code. Otherwise the result value indicates success. If it is a positive |
| * value then it may carry additional information. |
| */ |
| [passByValue] struct PP_CompletionCallback { |
| /* Function to call during callback. */ |
| PP_CompletionCallback_Func func; |
| |
| /* Data to pass into callback. */ |
| mem_t user_data; |
| }; |