| 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/plugin_ppb_testing.h" | 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_testing.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <new> | 8 #include <new> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "native_client/src/include/nacl_scoped_ptr.h" | 11 #include "native_client/src/include/nacl_scoped_ptr.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 struct PP_Var GetDocumentURL(PP_Instance instance, | 120 struct PP_Var GetDocumentURL(PP_Instance instance, |
| 121 struct PP_URLComponents_Dev* components) { | 121 struct PP_URLComponents_Dev* components) { |
| 122 DebugPrintf("PPB_Testing::GetDocumentURL: " | 122 DebugPrintf("PPB_Testing::GetDocumentURL: " |
| 123 "instance=%"NACL_PRIu32"\n", instance); | 123 "instance=%"NACL_PRIu32"\n", instance); |
| 124 | 124 |
| 125 NaClSrpcChannel* channel = GetMainSrpcChannel(); | 125 NaClSrpcChannel* channel = GetMainSrpcChannel(); |
| 126 nacl_abi_size_t components_size = | 126 nacl_abi_size_t components_size = |
| 127 (components != NULL) ? kPPURLComponentsDevBytes : 0; | 127 (components != NULL) ? kPPURLComponentsDevBytes : 0; |
| 128 nacl_abi_size_t url_size = kMaxVarSize; | 128 nacl_abi_size_t url_size = kMaxReturnVarSize; |
| 129 nacl::scoped_array<char> url_bytes(new (std::nothrow) char[url_size]); | 129 nacl::scoped_array<char> url_bytes(new char[url_size]); |
| 130 if (url_bytes.get() == NULL) | 130 if (url_bytes.get() == NULL) |
| 131 return PP_MakeUndefined(); | 131 return PP_MakeUndefined(); |
| 132 | 132 |
| 133 NaClSrpcError srpc_result = | 133 NaClSrpcError srpc_result = |
| 134 PpbTestingRpcClient::PPB_Testing_GetDocumentURL( | 134 PpbTestingRpcClient::PPB_Testing_GetDocumentURL( |
| 135 channel, | 135 channel, |
| 136 instance, | 136 instance, |
| 137 &components_size, reinterpret_cast<char*>(components), | 137 &components_size, reinterpret_cast<char*>(components), |
| 138 &url_size, url_bytes.get()); | 138 &url_size, url_bytes.get()); |
| 139 | 139 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 169 GetLiveObjectsForInstance, | 169 GetLiveObjectsForInstance, |
| 170 IsOutOfProcess, | 170 IsOutOfProcess, |
| 171 SimulateInputEvent, | 171 SimulateInputEvent, |
| 172 GetDocumentURL, | 172 GetDocumentURL, |
| 173 GetLiveVars | 173 GetLiveVars |
| 174 }; | 174 }; |
| 175 return &testing_interface; | 175 return &testing_interface; |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace ppapi_proxy | 178 } // namespace ppapi_proxy |
| OLD | NEW |