OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" |
| 6 |
| 7 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
| 8 |
| 9 #if NACL_WINDOWS |
| 10 # include <windows.h> |
| 11 #endif |
| 12 |
| 13 LaunchNaClProcessFunc launch_nacl_process = NULL; |
| 14 |
| 15 namespace plugin { |
| 16 |
| 17 bool SelLdrLauncherChrome::Start(const char* url) { |
| 18 // send a synchronous message to the browser process |
| 19 // TODO(mseaborn): Remove the nacl_proc_handle and nacl_proc_id |
| 20 // arguments. Chromium is being changed not to give the renderer |
| 21 // the Windows handle of the NaCl process. |
| 22 nacl::Handle nacl_proc_handle; |
| 23 int nacl_proc_id; |
| 24 // TODO(sehr): This is asserted to be one. Remove this parameter. |
| 25 static const int kNumberOfChannelsToBeCreated = 1; |
| 26 if (!launch_nacl_process || |
| 27 !launch_nacl_process(url, |
| 28 kNumberOfChannelsToBeCreated, |
| 29 &channel_, |
| 30 &nacl_proc_handle, |
| 31 &nacl_proc_id)) { |
| 32 return false; |
| 33 } |
| 34 |
| 35 #if NACL_WINDOWS |
| 36 if (nacl_proc_handle != nacl::kInvalidHandle && |
| 37 nacl_proc_handle != NULL) { |
| 38 CloseHandle(nacl_proc_handle); |
| 39 } |
| 40 #endif |
| 41 return true; |
| 42 } |
| 43 |
| 44 } // namespace plugin |
OLD | NEW |