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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2405093003: [WIP] Mojo native bindings interface.
Patch Set: cleanup 2 Created 4 years, 2 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 a97f03a27bbd36c0d69fea2464bbd99f656c3d84..68899f1bb7d43839b247819b2ae64fb2f92e0525 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -150,8 +150,6 @@
#include "media/blink/webencryptedmediaclient_impl.h"
#include "media/blink/webmediaplayer_impl.h"
#include "media/renderers/gpu_video_accelerator_factories.h"
-#include "mojo/edk/js/core.h"
-#include "mojo/edk/js/support.h"
#include "net/base/data_url.h"
#include "net/base/net_errors.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -186,6 +184,7 @@
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
+#include "third_party/WebKit/public/web/WebMojoBindings.h"
#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
#include "third_party/WebKit/public/web/WebPlugin.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
@@ -328,6 +327,8 @@ namespace {
const int kExtraCharsBeforeAndAfterSelection = 100;
+const char kMojoModuleNameCore[] = "mojo/public/js/core";
+
typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap;
static base::LazyInstance<RoutingIDFrameMap> g_routing_id_frame_map =
LAZY_INSTANCE_INITIALIZER;
@@ -2575,14 +2576,12 @@ void RenderFrameImpl::EnsureMojoBuiltinsAreAvailable(
v8::Isolate* isolate,
v8::Local<v8::Context> context) {
gin::ModuleRegistry* registry = gin::ModuleRegistry::From(context);
- if (registry->available_modules().count(mojo::edk::js::Core::kModuleName))
+ if (registry->available_modules().count(kMojoModuleNameCore))
return;
v8::HandleScope handle_scope(isolate);
- registry->AddBuiltinModule(isolate, mojo::edk::js::Core::kModuleName,
- mojo::edk::js::Core::GetModule(isolate));
- registry->AddBuiltinModule(isolate, mojo::edk::js::Support::kModuleName,
- mojo::edk::js::Support::GetModule(isolate));
+ registry->AddBuiltinModule(isolate, kMojoModuleNameCore,
+ blink::WebMojoBindings::create(context));
registry->AddBuiltinModule(
isolate, InterfaceProviderJsWrapper::kPerFrameModuleName,
InterfaceProviderJsWrapper::Create(

Powered by Google App Engine
This is Rietveld 408576698