Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1968)

Unified Diff: ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc

Issue 10266003: NaCl: Move sel_ldr_launcher_chrome.cc into the Chromium repo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix namespace Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
diff --git a/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5b6c9f223619d6114cfb0aa86d657c5db87e3b7
--- /dev/null
+++ b/ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
+
+#include "native_client/src/trusted/plugin/nacl_entry_points.h"
+
+#if NACL_WINDOWS
+# include <windows.h>
+#endif
+
+LaunchNaClProcessFunc launch_nacl_process = NULL;
+
+namespace plugin {
+
+bool SelLdrLauncherChrome::Start(const char* url) {
+ // send a synchronous message to the browser process
+ // TODO(mseaborn): Remove the nacl_proc_handle and nacl_proc_id
+ // arguments. Chromium is being changed not to give the renderer
+ // the Windows handle of the NaCl process.
+ nacl::Handle nacl_proc_handle;
+ int nacl_proc_id;
+ // TODO(sehr): This is asserted to be one. Remove this parameter.
+ static const int kNumberOfChannelsToBeCreated = 1;
+ if (!launch_nacl_process ||
+ !launch_nacl_process(url,
+ kNumberOfChannelsToBeCreated,
+ &channel_,
+ &nacl_proc_handle,
+ &nacl_proc_id)) {
+ return false;
+ }
+
+#if NACL_WINDOWS
+ if (nacl_proc_handle != nacl::kInvalidHandle &&
+ nacl_proc_handle != NULL) {
+ CloseHandle(nacl_proc_handle);
+ }
+#endif
+ return true;
+}
+
+} // namespace plugin

Powered by Google App Engine
This is Rietveld 408576698