| 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 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "native_client/src/include/nacl_scoped_ptr.h" | 9 #include "native_client/src/include/nacl_scoped_ptr.h" |
| 10 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
| 11 #include "native_client/src/include/portability_process.h" | 11 #include "native_client/src/include/portability_process.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 "could not construct callback services.\n"); | 90 "could not construct callback services.\n"); |
| 91 free(service); | 91 free(service); |
| 92 return PP_ERROR_FAILED; | 92 return PP_ERROR_FAILED; |
| 93 } | 93 } |
| 94 // Export the service on the channel. | 94 // Export the service on the channel. |
| 95 main_channel_->server = service; | 95 main_channel_->server = service; |
| 96 char* service_string = const_cast<char*>(service->service_string); | 96 char* service_string = const_cast<char*>(service->service_string); |
| 97 SetModuleIdForSrpcChannel(main_channel_, module_id); | 97 SetModuleIdForSrpcChannel(main_channel_, module_id); |
| 98 SetInstanceIdForSrpcChannel(main_channel_, plugin_->pp_instance()); | 98 SetInstanceIdForSrpcChannel(main_channel_, plugin_->pp_instance()); |
| 99 // Do the RPC. | 99 // Do the RPC. |
| 100 int32_t browser_pid = static_cast<int32_t>(GETPID()); | |
| 101 int32_t pp_error; | 100 int32_t pp_error; |
| 102 NaClSrpcError srpc_result = | 101 NaClSrpcError srpc_result = |
| 103 PppRpcClient::PPP_InitializeModule(main_channel_, | 102 PppRpcClient::PPP_InitializeModule(main_channel_, |
| 104 browser_pid, | |
| 105 module_id, | 103 module_id, |
| 106 wrapper->desc(), | 104 wrapper->desc(), |
| 107 service_string, | 105 service_string, |
| 108 &plugin_pid_, | |
| 109 &pp_error); | 106 &pp_error); |
| 110 DebugPrintf("PPP_InitializeModule: %s\n", NaClSrpcErrorString(srpc_result)); | 107 DebugPrintf("PPP_InitializeModule: %s\n", NaClSrpcErrorString(srpc_result)); |
| 111 is_nexe_alive_ = (srpc_result != NACL_SRPC_RESULT_INTERNAL); | 108 is_nexe_alive_ = (srpc_result != NACL_SRPC_RESULT_INTERNAL); |
| 112 if (srpc_result != NACL_SRPC_RESULT_OK) | 109 if (srpc_result != NACL_SRPC_RESULT_OK) |
| 113 return PP_ERROR_FAILED; | 110 return PP_ERROR_FAILED; |
| 114 DebugPrintf("PPP_InitializeModule: pp_error=%"NACL_PRId32"\n", pp_error); | 111 DebugPrintf("PPP_InitializeModule: pp_error=%"NACL_PRId32"\n", pp_error); |
| 115 if (pp_error != PP_OK) | 112 if (pp_error != PP_OK) |
| 116 return pp_error; | 113 return pp_error; |
| 117 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE); | 114 const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE); |
| 118 DebugPrintf("PPP_InitializeModule: ppp_instance=%p\n", ppp_instance); | 115 DebugPrintf("PPP_InitializeModule: ppp_instance=%p\n", ppp_instance); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 214 |
| 218 const void* BrowserPpp::GetPluginInterfaceSafe(const char* interface_name) { | 215 const void* BrowserPpp::GetPluginInterfaceSafe(const char* interface_name) { |
| 219 const void* ppp_interface = GetPluginInterface(interface_name); | 216 const void* ppp_interface = GetPluginInterface(interface_name); |
| 220 if (ppp_interface == NULL) | 217 if (ppp_interface == NULL) |
| 221 DebugPrintf("PPB_GetInterface: %s not found\n", interface_name); | 218 DebugPrintf("PPB_GetInterface: %s not found\n", interface_name); |
| 222 CHECK(ppp_interface != NULL); | 219 CHECK(ppp_interface != NULL); |
| 223 return ppp_interface; | 220 return ppp_interface; |
| 224 } | 221 } |
| 225 | 222 |
| 226 } // namespace ppapi_proxy | 223 } // namespace ppapi_proxy |
| OLD | NEW |