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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index eda764382968862dc1c968cbffb2679c979520a4..b44c560fcec1a992ae0f4d1c2368f8bf0b6a6c1e 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -148,8 +148,6 @@
#include "third_party/WebKit/public/web/WebSurroundingText.h"
#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
#include "third_party/WebKit/public/web/WebView.h"
-#include "third_party/mojo/src/mojo/edk/js/core.h"
-#include "third_party/mojo/src/mojo/edk/js/support.h"
#include "url/url_util.h"
#if defined(ENABLE_PLUGINS)
@@ -199,6 +197,14 @@
#include "content/renderer/vr/vr_dispatcher.h"
#endif
+#if defined(USE_CHROME_EDK)
+#include "mojo/edk/js/core.h"
+#include "mojo/edk/js/support.h"
+#else
+#include "third_party/mojo/src/mojo/edk/js/core.h"
+#include "third_party/mojo/src/mojo/edk/js/support.h"
+#endif
+
using blink::WebContentDecryptionModule;
using blink::WebContextMenuData;
using blink::WebData;
@@ -1964,6 +1970,18 @@ void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable(
v8::Isolate* isolate,
v8::Local<v8::Context> context) {
gin::ModuleRegistry* registry = gin::ModuleRegistry::From(context);
+#if defined(USE_CHROME_EDK)
+ if (registry->available_modules().count(mojo::edk::Core::kModuleName))
+ return;
+
+ v8::HandleScope handle_scope(isolate);
+ registry->AddBuiltinModule(
+ isolate, mojo::edk::Core::kModuleName,
+ mojo::edk::Core::GetModule(isolate));
+ registry->AddBuiltinModule(isolate,
+ mojo::edk::Support::kModuleName,
+ mojo::edk::Support::GetModule(isolate));
+#else
if (registry->available_modules().count(mojo::js::Core::kModuleName))
return;
@@ -1973,6 +1991,7 @@ void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable(
registry->AddBuiltinModule(isolate,
mojo::js::Support::kModuleName,
mojo::js::Support::GetModule(isolate));
+#endif
registry->AddBuiltinModule(
isolate,
ServiceRegistryJsWrapper::kModuleName,

Powered by Google App Engine
This is Rietveld 408576698