| OLD | NEW |
| 1 // Copyright (c) 2010 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2010 The Native Client Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ | 5 #ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ |
| 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ | 6 #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ |
| 7 | 7 |
| 8 #include "native_client/src/include/portability.h" | 8 #include "native_client/src/include/portability.h" |
| 9 | 9 |
| 10 struct NaClSrpcChannel; | 10 struct NaClSrpcChannel; |
| 11 struct PP_CompletionCallback; | 11 struct PP_CompletionCallback; |
| 12 | 12 |
| 13 namespace ppapi_proxy { | 13 namespace ppapi_proxy { |
| 14 | 14 |
| 15 // Returns a PP_CompletionCallback that will call the remote implementation of | 15 // Returns a PP_CompletionCallback that will call the remote implementation of |
| 16 // a callback by |callback_id| on the plugin side on |srpc_channel|. | 16 // a callback by |callback_id| on the plugin side on |srpc_channel|. |
| 17 // Allocates data that will be deleted by the underlying callback function. | 17 // Allocates data that will be deleted by the underlying callback function. |
| 18 // Returns NULL callback on failure. | 18 // Returns NULL callback on failure. |
| 19 struct PP_CompletionCallback MakeRemoteCompletionCallback( | 19 struct PP_CompletionCallback MakeRemoteCompletionCallback( |
| 20 NaClSrpcChannel* srpc_channel, | 20 NaClSrpcChannel* srpc_channel, |
| 21 int32_t callback_id); | 21 int32_t callback_id); |
| 22 struct PP_CompletionCallback MakeRemoteCompletionCallback( |
| 23 NaClSrpcChannel* srpc_channel, |
| 24 int32_t callback_id, |
| 25 // For callbacks invoked on a byte read. |
| 26 int32_t bytes_to_read, |
| 27 char** buffer); |
| 22 | 28 |
| 23 // If the callback won't be called, use this to clean up the data from | 29 // If the callback won't be called, use this to clean up the data from |
| 24 // the function above. | 30 // the function above. |
| 25 void DeleteRemoteCallbackInfo(struct PP_CompletionCallback callback); | 31 void DeleteRemoteCallbackInfo(struct PP_CompletionCallback callback); |
| 26 | 32 |
| 27 } // namespace ppapi_proxy | 33 } // namespace ppapi_proxy |
| 28 | 34 |
| 29 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ | 35 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ |
| OLD | NEW |