OLD | NEW |
1 // Copyright (c) 2012 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 // SRPC-abstraction wrappers around PPP functions. | 5 // SRPC-abstraction wrappers around PPP functions. |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "native_client/src/include/portability.h" | 9 #include "native_client/src/include/portability.h" |
10 #include "native_client/src/include/portability_process.h" | 10 #include "native_client/src/include/portability_process.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 void PppRpcServer::PPP_InitializeModule( | 92 void PppRpcServer::PPP_InitializeModule( |
93 NaClSrpcRpc* rpc, | 93 NaClSrpcRpc* rpc, |
94 NaClSrpcClosure* done, | 94 NaClSrpcClosure* done, |
95 PP_Module module, | 95 PP_Module module, |
96 NaClSrpcImcDescType upcall_channel_desc, | 96 NaClSrpcImcDescType upcall_channel_desc, |
97 const char* service_description, | 97 const char* service_description, |
98 int32_t* success) { | 98 int32_t* success) { |
99 NaClSrpcClosureRunner runner(done); | 99 NaClSrpcClosureRunner runner(done); |
100 rpc->result = NACL_SRPC_RESULT_APP_ERROR; | 100 rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
101 DebugPrintf("PPP_InitializeModule: module=%"NACL_PRIu32": %s\n", | 101 DebugPrintf("PPP_InitializeModule: module=%"NACL_PRId32": %s\n", |
102 module, service_description); | 102 module, service_description); |
103 // Set up the service for calling back into the browser. | 103 // Set up the service for calling back into the browser. |
104 if (!StartMainSrpcChannel(const_cast<const char*>(service_description), | 104 if (!StartMainSrpcChannel(const_cast<const char*>(service_description), |
105 rpc->channel)) { | 105 rpc->channel)) { |
106 DebugPrintf("PPP_InitializeModule: " | 106 DebugPrintf("PPP_InitializeModule: " |
107 "failed to export service on main channel\n"); | 107 "failed to export service on main channel\n"); |
108 return; | 108 return; |
109 } | 109 } |
110 // Set up the upcall channel for calling back into the browser. | 110 // Set up the upcall channel for calling back into the browser. |
111 if (!StartUpcallSrpcChannel(upcall_channel_desc)) { | 111 if (!StartUpcallSrpcChannel(upcall_channel_desc)) { |
(...skipping 30 matching lines...) Expand all Loading... |
142 int32_t* exports_interface_name) { | 142 int32_t* exports_interface_name) { |
143 NaClSrpcClosureRunner runner(done); | 143 NaClSrpcClosureRunner runner(done); |
144 rpc->result = NACL_SRPC_RESULT_APP_ERROR; | 144 rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
145 DebugPrintf("PPP_GetInterface('%s')\n", interface_name); | 145 DebugPrintf("PPP_GetInterface('%s')\n", interface_name); |
146 // Since the proxy will make calls to proxied interfaces, we need simply | 146 // Since the proxy will make calls to proxied interfaces, we need simply |
147 // to know whether the plugin exports a given interface. | 147 // to know whether the plugin exports a given interface. |
148 const void* plugin_interface = ::PPP_GetInterface(interface_name); | 148 const void* plugin_interface = ::PPP_GetInterface(interface_name); |
149 *exports_interface_name = (plugin_interface != NULL); | 149 *exports_interface_name = (plugin_interface != NULL); |
150 rpc->result = NACL_SRPC_RESULT_OK; | 150 rpc->result = NACL_SRPC_RESULT_OK; |
151 } | 151 } |
OLD | NEW |