| 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 // SRPC-abstraction wrappers around PPB_Instance functions. | 5 // SRPC-abstraction wrappers around PPB_Instance functions. |
| 6 | 6 |
| 7 #include "native_client/src/include/nacl_macros.h" | 7 #include "native_client/src/include/nacl_macros.h" |
| 8 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" | 8 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| 9 #include "native_client/src/shared/ppapi_proxy/object_serialize.h" | 9 #include "native_client/src/shared/ppapi_proxy/object_serialize.h" |
| 10 #include "srpcgen/ppb_rpc.h" | 10 #include "srpcgen/ppb_rpc.h" |
| 11 | 11 |
| 12 void PpbInstanceRpcServer::PPB_Instance_GetWindowObject( | 12 void PpbInstanceRpcServer::PPB_Instance_GetWindowObject( |
| 13 NaClSrpcRpc* rpc, | 13 NaClSrpcRpc* rpc, |
| 14 NaClSrpcClosure* done, | 14 NaClSrpcClosure* done, |
| 15 // inputs | 15 // inputs |
| 16 PP_Instance instance, | 16 PP_Instance instance, |
| 17 // outputs | 17 // outputs |
| 18 nacl_abi_size_t* window_size, char* window_bytes) { | 18 nacl_abi_size_t* window_size, char* window_bytes) { |
| 19 NACL_UNTESTED(); | |
| 20 NaClSrpcClosureRunner runner(done); | 19 NaClSrpcClosureRunner runner(done); |
| 21 rpc->result = NACL_SRPC_RESULT_APP_ERROR; | 20 rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
| 22 | 21 |
| 23 PP_Var window = | 22 PP_Var window = |
| 24 ppapi_proxy::PPBInstanceInterface()->GetWindowObject(instance); | 23 ppapi_proxy::PPBInstanceInterface()->GetWindowObject(instance); |
| 25 if (!ppapi_proxy::SerializeTo(&window, window_bytes, window_size)) | 24 if (!ppapi_proxy::SerializeTo(&window, window_bytes, window_size)) |
| 26 return; | 25 return; |
| 27 | 26 |
| 28 rpc->result = NACL_SRPC_RESULT_OK; | 27 rpc->result = NACL_SRPC_RESULT_OK; |
| 29 } | 28 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 PP_Var result = | 109 PP_Var result = |
| 111 ppapi_proxy::PPBInstanceInterface()->ExecuteScript( | 110 ppapi_proxy::PPBInstanceInterface()->ExecuteScript( |
| 112 instance, script, &exception); | 111 instance, script, &exception); |
| 113 if (!ppapi_proxy::SerializeTo(&result, result_bytes, result_size)) | 112 if (!ppapi_proxy::SerializeTo(&result, result_bytes, result_size)) |
| 114 return; | 113 return; |
| 115 if (!ppapi_proxy::SerializeTo(&exception, exception_bytes, exception_size)) | 114 if (!ppapi_proxy::SerializeTo(&exception, exception_bytes, exception_size)) |
| 116 return; | 115 return; |
| 117 | 116 |
| 118 rpc->result = NACL_SRPC_RESULT_OK; | 117 rpc->result = NACL_SRPC_RESULT_OK; |
| 119 } | 118 } |
| OLD | NEW |