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

Unified Diff: chrome/renderer/renderer_glue.cc

Issue 5933004: Add a webkit_glue API for lanching NaCl's sel_ldr. NaCl will call this API v... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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: chrome/renderer/renderer_glue.cc
===================================================================
--- chrome/renderer/renderer_glue.cc (revision 69335)
+++ chrome/renderer/renderer_glue.cc (working copy)
@@ -28,6 +28,8 @@
#include "chrome/renderer/render_process.h"
#include "chrome/renderer/render_thread.h"
#include "googleurl/src/url_util.h"
+#include "native_client/src/shared/imc/nacl_imc.h"
noelallen_use_chromium 2010/12/17 19:52:22 #ifdef this as well? So that someone could compil
+#include "native_client/src/trusted/plugin/nacl_entry_points.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
#include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
@@ -274,6 +276,30 @@
new ViewHostMsg_UserMetricsRecordAction(action));
}
+#if !defined(DISABLE_NACL)
+bool LaunchSelLdr(const char* alleged_url, int socket_count, void* imc_handles,
+ void* nacl_process_handle, int* nacl_process_id) {
+ std::vector<nacl::FileDescriptor> sockets;
+ base::ProcessHandle nacl_process;
+ if (!RenderThread::current()->Send(
+ new ViewHostMsg_LaunchNaCl(
+ ASCIIToWide(alleged_url),
+ socket_count,
+ &sockets,
+ &nacl_process,
+ reinterpret_cast<base::ProcessId*>(nacl_process_id)))) {
+ return false;
+ }
+ CHECK(static_cast<int>(sockets.size()) == socket_count);
+ for (int i = 0; i < socket_count; i++) {
+ static_cast<nacl::Handle*>(imc_handles)[i] =
+ nacl::ToNativeHandle(sockets[i]);
+ }
+ *static_cast<nacl::Handle*>(nacl_process_handle) = nacl_process;
+ return true;
+}
+#endif
+
#if defined(OS_LINUX)
int MatchFontWithFallback(const std::string& face, bool bold,
bool italic, int charset) {

Powered by Google App Engine
This is Rietveld 408576698