| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/nacl/renderer/ppb_nacl_private_impl.h" | 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 return PP_ERROR_FAILED; | 245 return PP_ERROR_FAILED; |
| 246 // No default case, to catch unhandled Status values. | 246 // No default case, to catch unhandled Status values. |
| 247 } | 247 } |
| 248 return PP_ERROR_FAILED; | 248 return PP_ERROR_FAILED; |
| 249 } | 249 } |
| 250 | 250 |
| 251 // Launch NaCl's sel_ldr process. | 251 // Launch NaCl's sel_ldr process. |
| 252 void LaunchSelLdr(PP_Instance instance, | 252 void LaunchSelLdr(PP_Instance instance, |
| 253 PP_Bool main_service_runtime, | 253 PP_Bool main_service_runtime, |
| 254 const char* alleged_url, | 254 const char* alleged_url, |
| 255 const PP_NaClFileInfo* nexe_file_info, |
| 255 PP_Bool uses_irt, | 256 PP_Bool uses_irt, |
| 256 PP_Bool uses_ppapi, | 257 PP_Bool uses_ppapi, |
| 257 PP_Bool uses_nonsfi_mode, | 258 PP_Bool uses_nonsfi_mode, |
| 258 PP_Bool enable_ppapi_dev, | 259 PP_Bool enable_ppapi_dev, |
| 259 PP_Bool enable_dyncode_syscalls, | 260 PP_Bool enable_dyncode_syscalls, |
| 260 PP_Bool enable_exception_handling, | 261 PP_Bool enable_exception_handling, |
| 261 PP_Bool enable_crash_throttling, | 262 PP_Bool enable_crash_throttling, |
| 262 const PPP_ManifestService* manifest_service_interface, | 263 const PPP_ManifestService* manifest_service_interface, |
| 263 void* manifest_service_user_data, | 264 void* manifest_service_user_data, |
| 264 void* imc_handle, | 265 void* imc_handle, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so | 301 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so |
| 301 // it's clearer to developers when they are using 'Dev' inappropriately. We | 302 // it's clearer to developers when they are using 'Dev' inappropriately. We |
| 302 // must also check on the trusted side of the proxy. | 303 // must also check on the trusted side of the proxy. |
| 303 if (enable_ppapi_dev) | 304 if (enable_ppapi_dev) |
| 304 perm_bits |= ppapi::PERMISSION_DEV; | 305 perm_bits |= ppapi::PERMISSION_DEV; |
| 305 instance_info.permissions = | 306 instance_info.permissions = |
| 306 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); | 307 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); |
| 307 std::string error_message_string; | 308 std::string error_message_string; |
| 308 NaClLaunchResult launch_result; | 309 NaClLaunchResult launch_result; |
| 309 | 310 |
| 311 content::RendererPpapiHost* host = |
| 312 content::RendererPpapiHost::GetForPPInstance(instance); |
| 310 if (!sender->Send(new NaClHostMsg_LaunchNaCl( | 313 if (!sender->Send(new NaClHostMsg_LaunchNaCl( |
| 311 NaClLaunchParams(instance_info.url.spec(), | 314 NaClLaunchParams( |
| 312 routing_id, | 315 instance_info.url.spec(), |
| 313 perm_bits, | 316 host->ShareHandleWithRemote(nexe_file_info->handle, true), |
| 314 PP_ToBool(uses_irt), | 317 nexe_file_info->token_lo, |
| 315 PP_ToBool(uses_nonsfi_mode), | 318 nexe_file_info->token_hi, |
| 316 PP_ToBool(enable_dyncode_syscalls), | 319 routing_id, |
| 317 PP_ToBool(enable_exception_handling), | 320 perm_bits, |
| 318 PP_ToBool(enable_crash_throttling)), | 321 PP_ToBool(uses_irt), |
| 322 PP_ToBool(uses_nonsfi_mode), |
| 323 PP_ToBool(enable_dyncode_syscalls), |
| 324 PP_ToBool(enable_exception_handling), |
| 325 PP_ToBool(enable_crash_throttling)), |
| 319 &launch_result, | 326 &launch_result, |
| 320 &error_message_string))) { | 327 &error_message_string))) { |
| 321 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( | 328 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( |
| 322 FROM_HERE, | 329 FROM_HERE, |
| 323 base::Bind(callback.func, callback.user_data, | 330 base::Bind(callback.func, callback.user_data, |
| 324 static_cast<int32_t>(PP_ERROR_FAILED))); | 331 static_cast<int32_t>(PP_ERROR_FAILED))); |
| 325 return; | 332 return; |
| 326 } | 333 } |
| 327 | 334 |
| 328 if (!error_message_string.empty()) { | 335 if (!error_message_string.empty()) { |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 &ReportSelLdrStatus | 1515 &ReportSelLdrStatus |
| 1509 }; | 1516 }; |
| 1510 | 1517 |
| 1511 } // namespace | 1518 } // namespace |
| 1512 | 1519 |
| 1513 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1520 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
| 1514 return &nacl_interface; | 1521 return &nacl_interface; |
| 1515 } | 1522 } |
| 1516 | 1523 |
| 1517 } // namespace nacl | 1524 } // namespace nacl |
| OLD | NEW |