OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include "native_client/src/trusted/service_runtime/include/machine/_types.h" | 9 #include "native_client/src/trusted/service_runtime/include/machine/_types.h" |
10 | 10 |
11 struct NaClSrpcChannel; | 11 struct NaClSrpcChannel; |
12 struct PP_CompletionCallback; | 12 struct PP_CompletionCallback; |
| 13 struct PP_Var; |
13 | 14 |
14 namespace ppapi_proxy { | 15 namespace ppapi_proxy { |
15 | 16 |
16 // Pointer to function to evaluate the result of a read operation. | 17 // Pointer to function to evaluate the result of a read operation. |
17 typedef bool (*CheckResultFunc)(int32_t result); | 18 typedef bool (*CheckResultFunc)(int32_t result); |
18 // Pointer to function to retrieve/calculate the size read. | 19 // Pointer to function to retrieve/calculate the size read. |
19 typedef nacl_abi_size_t (*GetReadSizeFunc)(int32_t result); | 20 typedef nacl_abi_size_t (*GetReadSizeFunc)(int32_t result); |
20 | 21 |
21 // Returns a PP_CompletionCallback that will call the remote implementation of | 22 // Returns a PP_CompletionCallback that will call the remote implementation of |
22 // a callback by |callback_id| on the plugin side on |srpc_channel|. | 23 // a callback by |callback_id| on the plugin side on |srpc_channel|. |
(...skipping 10 matching lines...) Expand all Loading... |
33 int32_t bytes_to_read, | 34 int32_t bytes_to_read, |
34 char** buffer); | 35 char** buffer); |
35 struct PP_CompletionCallback MakeRemoteCompletionCallback( | 36 struct PP_CompletionCallback MakeRemoteCompletionCallback( |
36 NaClSrpcChannel* srpc_channel, | 37 NaClSrpcChannel* srpc_channel, |
37 int32_t callback_id, | 38 int32_t callback_id, |
38 // For callbacks invoked on a byte read. | 39 // For callbacks invoked on a byte read. |
39 int32_t bytes_to_read, | 40 int32_t bytes_to_read, |
40 char** buffer, | 41 char** buffer, |
41 CheckResultFunc check_result, | 42 CheckResultFunc check_result, |
42 GetReadSizeFunc get_size_read_func); | 43 GetReadSizeFunc get_size_read_func); |
| 44 struct PP_CompletionCallback MakeRemoteCompletionCallback( |
| 45 NaClSrpcChannel* srpc_channel, |
| 46 int32_t callback_id, |
| 47 // For callbacks invoked on PP_Var read. |
| 48 PP_Var** var); |
| 49 struct PP_CompletionCallback MakeRemoteCompletionCallback( |
| 50 NaClSrpcChannel* srpc_channel, |
| 51 int32_t callback_id, |
| 52 // For callbacks invoked on a byte read. |
| 53 int32_t bytes_to_read, |
| 54 char** buffer, |
| 55 PP_Var** var, |
| 56 CheckResultFunc check_result, |
| 57 GetReadSizeFunc get_size_read_func); |
43 | 58 |
44 // If the callback won't be called, use this to clean up the data from | 59 // If the callback won't be called, use this to clean up the data from |
45 // the function above. | 60 // the function above. |
46 void DeleteRemoteCallbackInfo(struct PP_CompletionCallback callback); | 61 void DeleteRemoteCallbackInfo(struct PP_CompletionCallback callback); |
47 | 62 |
48 } // namespace ppapi_proxy | 63 } // namespace ppapi_proxy |
49 | 64 |
50 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ | 65 #endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_BROWSER_CALLBACK_H_ |
OLD | NEW |