| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/renderer/chrome_ppapi_interfaces.h" | 5 #include "chrome/renderer/chrome_ppapi_interfaces.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/rand_util_c.h" | 8 #include "base/rand_util_c.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace chrome { | 22 namespace chrome { |
| 23 | 23 |
| 24 // Launch NaCl's sel_ldr process. | 24 // Launch NaCl's sel_ldr process. |
| 25 bool LaunchSelLdr(const char* alleged_url, int socket_count, | 25 bool LaunchSelLdr(const char* alleged_url, int socket_count, |
| 26 void* imc_handles, void* nacl_process_handle, | 26 void* imc_handles, void* nacl_process_handle, |
| 27 int* nacl_process_id) { | 27 int* nacl_process_id) { |
| 28 #if !defined(DISABLE_NACL) | 28 #if !defined(DISABLE_NACL) |
| 29 std::vector<nacl::FileDescriptor> sockets; | 29 std::vector<nacl::FileDescriptor> sockets; |
| 30 base::ProcessHandle nacl_process; | 30 base::ProcessHandle nacl_process; |
| 31 if (!RenderThread::current()->Send( | 31 if (!RenderThread::current()->Send( |
| 32 new ViewHostMsg_LaunchNaCl( | 32 new ChromeViewHostMsg_LaunchNaCl( |
| 33 ASCIIToWide(alleged_url), | 33 ASCIIToWide(alleged_url), |
| 34 socket_count, | 34 socket_count, |
| 35 &sockets, | 35 &sockets, |
| 36 &nacl_process, | 36 &nacl_process, |
| 37 reinterpret_cast<base::ProcessId*>(nacl_process_id)))) { | 37 reinterpret_cast<base::ProcessId*>(nacl_process_id)))) { |
| 38 return false; | 38 return false; |
| 39 } | 39 } |
| 40 CHECK(static_cast<int>(sockets.size()) == socket_count); | 40 CHECK(static_cast<int>(sockets.size()) == socket_count); |
| 41 for (int i = 0; i < socket_count; i++) { | 41 for (int i = 0; i < socket_count; i++) { |
| 42 static_cast<nacl::Handle*>(imc_handles)[i] = | 42 static_cast<nacl::Handle*>(imc_handles)[i] = |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 void UninitializePPAPI() { | 88 void UninitializePPAPI() { |
| 89 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager = | 89 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager = |
| 90 webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance(); | 90 webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance(); |
| 91 factory_manager->UnregisterFactory(ChromePPAPIInterfaceFactory); | 91 factory_manager->UnregisterFactory(ChromePPAPIInterfaceFactory); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace chrome | 94 } // namespace chrome |
| 95 | 95 |
| OLD | NEW |