| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so | 336 // Conditionally block 'Dev' interfaces. We do this for the NaCl process, so |
| 337 // it's clearer to developers when they are using 'Dev' inappropriately. We | 337 // it's clearer to developers when they are using 'Dev' inappropriately. We |
| 338 // must also check on the trusted side of the proxy. | 338 // must also check on the trusted side of the proxy. |
| 339 if (enable_ppapi_dev) | 339 if (enable_ppapi_dev) |
| 340 perm_bits |= ppapi::PERMISSION_DEV; | 340 perm_bits |= ppapi::PERMISSION_DEV; |
| 341 instance_info.permissions = | 341 instance_info.permissions = |
| 342 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); | 342 ppapi::PpapiPermissions::GetForCommandLine(perm_bits); |
| 343 std::string error_message_string; | 343 std::string error_message_string; |
| 344 NaClLaunchResult launch_result; | 344 NaClLaunchResult launch_result; |
| 345 | 345 |
| 346 content::RendererPpapiHost* host = | 346 IPC::PlatformFileForTransit nexe_for_transit = |
| 347 content::RendererPpapiHost::GetForPPInstance(instance); | 347 IPC::InvalidPlatformFileForTransit(); |
| 348 #if defined(OS_POSIX) |
| 349 if (nexe_file_info->handle != PP_kInvalidFileHandle) |
| 350 nexe_for_transit = base::FileDescriptor(nexe_file_info->handle, true); |
| 351 #elif defined(OS_WIN) |
| 352 // Duplicate the handle on the browser side instead of the renderer. |
| 353 // This is because BrokerGetFileForProcess isn't part of content/public, and |
| 354 // it's simpler to do the duplication in the browser anyway. |
| 355 nexe_for_transit = nexe_file_info->handle; |
| 356 #else |
| 357 #error Unsupported target platform. |
| 358 #endif |
| 348 if (!sender->Send(new NaClHostMsg_LaunchNaCl( | 359 if (!sender->Send(new NaClHostMsg_LaunchNaCl( |
| 349 NaClLaunchParams( | 360 NaClLaunchParams( |
| 350 instance_info.url.spec(), | 361 instance_info.url.spec(), |
| 351 host->ShareHandleWithRemote(nexe_file_info->handle, true), | 362 nexe_for_transit, |
| 363 nexe_file_info->token_lo, |
| 364 nexe_file_info->token_hi, |
| 352 routing_id, | 365 routing_id, |
| 353 perm_bits, | 366 perm_bits, |
| 354 PP_ToBool(uses_irt), | 367 PP_ToBool(uses_irt), |
| 355 PP_ToBool(uses_nonsfi_mode), | 368 PP_ToBool(uses_nonsfi_mode), |
| 356 PP_ToBool(enable_dyncode_syscalls), | 369 PP_ToBool(enable_dyncode_syscalls), |
| 357 PP_ToBool(enable_exception_handling), | 370 PP_ToBool(enable_exception_handling), |
| 358 PP_ToBool(enable_crash_throttling)), | 371 PP_ToBool(enable_crash_throttling)), |
| 359 &launch_result, | 372 &launch_result, |
| 360 &error_message_string))) { | 373 &error_message_string))) { |
| 361 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( | 374 ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( |
| (...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 &SetPNaClStartTime | 1665 &SetPNaClStartTime |
| 1653 }; | 1666 }; |
| 1654 | 1667 |
| 1655 } // namespace | 1668 } // namespace |
| 1656 | 1669 |
| 1657 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1670 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
| 1658 return &nacl_interface; | 1671 return &nacl_interface; |
| 1659 } | 1672 } |
| 1660 | 1673 |
| 1661 } // namespace nacl | 1674 } // namespace nacl |
| OLD | NEW |