| Index: extensions/renderer/module_system.cc
|
| diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
|
| index f3fdf5d3c1704eb7bf6ba387d9f2b23945755920..f577c53e4f568220229c47a16a837cbc60903753 100644
|
| --- a/extensions/renderer/module_system.cc
|
| +++ b/extensions/renderer/module_system.cc
|
| @@ -169,12 +169,11 @@ 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()) {
|
| + gin::ModuleRegistry::InstallGlobals(context->isolate(),
|
| + context->v8_context()->Global());
|
| context_->GetRenderFrame()->EnsureMojoBuiltinsAreAvailable(
|
| context->isolate(), context->v8_context());
|
| }
|
|
|