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

Unified Diff: extensions/renderer/module_system.cc

Issue 2243323002: [Extensions] Don't inject mojo bindings for every context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 4665d753f37c579d09e2afa60f64d4df60bb2d1c..8f0fbaf7d90defa1c66ec07a28fdc3d57d2b961f 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -169,7 +169,12 @@ ModuleSystem::ModuleSystem(ScriptContext* context, const SourceMap* source_map)
SetPrivate(global, kModuleSystem, v8::External::New(isolate, this));
gin::ModuleRegistry::From(context->v8_context())->AddObserver(this);
- if (context_->GetRenderFrame()) {
+ // TODO(devlin): We really shouldn't be injecting mojo into every blessed
+ // extension context - it's wasteful. But it's better than injecting into
+ // every frame (previous behavior) so start with this while we investigate
+ // further. See crbug.com/636655.
+ if (context_->GetRenderFrame() &&
+ context_->context_type() == Feature::BLESSED_EXTENSION_CONTEXT) {
haraken 2016/08/18 01:42:59 Does this mean that we don't inject mojo bindings
Devlin 2016/08/18 02:01:36 This means we only inject bindings for extension f
context_->GetRenderFrame()->EnsureMojoBuiltinsAreAvailable(
context->isolate(), context->v8_context());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698