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

Unified Diff: extensions/renderer/module_system.cc

Issue 2412783002: Only inject mojo builtins to contexts with the mojoPrivate API feature. (Closed)
Patch Set: 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
« no previous file with comments | « extensions/common/api/_api_features.json ('k') | 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 f3fdf5d3c1704eb7bf6ba387d9f2b23945755920..8104a02f990825956faf3c7837053b1e241e1f9b 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -169,12 +169,9 @@ ModuleSystem::ModuleSystem(ScriptContext* context, const SourceMap* source_map)
SetPrivate(global, kModuleSystem, v8::External::New(isolate, this));
gin::ModuleRegistry::From(context->v8_context())->AddObserver(this);
- // 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) {
+ context_->context_type() == Feature::BLESSED_EXTENSION_CONTEXT &&
+ context_->GetAvailability("mojoPrivate").is_available()) {
Devlin 2016/10/12 14:58:09 This doesn't seem to be quite the right relationsh
Sam McNally 2016/10/13 07:13:08 Done. mojoPrivate does need to make the builtins
context_->GetRenderFrame()->EnsureMojoBuiltinsAreAvailable(
context->isolate(), context->v8_context());
}
« no previous file with comments | « extensions/common/api/_api_features.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698