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

Unified Diff: extensions/renderer/module_system.cc

Issue 649003003: Add a mojoPrivate API that exposes mojo to component apps/extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@serial-service
Patch Set: Created 5 years, 11 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: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index 5a180b458583040c3ee433656abb7b1df74f3f89..eebc451a89ed21230063ddd87646cfbb29adcb39 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -657,17 +657,20 @@ v8::Handle<v8::Value> ModuleSystem::LoadModule(const std::string& module_name) {
void ModuleSystem::OnDidAddPendingModule(
const std::string& id,
const std::vector<std::string>& dependencies) {
- if (!source_map_->Contains(id))
- return;
+ bool module_system_managed = source_map_->Contains(id);
gin::ModuleRegistry* registry =
gin::ModuleRegistry::From(context_->v8_context());
DCHECK(registry);
- for (std::vector<std::string>::const_iterator it = dependencies.begin();
- it != dependencies.end();
- ++it) {
- if (registry->available_modules().count(*it) == 0)
- LoadModule(*it);
+ for (const auto& dependency : dependencies) {
+ // If a dependency is not available and either the module being loaded or
+ // the particular dependency is one loaded by ModuleSystem, attempt to load
not at google - send to devlin 2015/01/13 21:46:46 first part is a little hard to parse - I eventuall
Sam McNally 2015/01/13 23:48:43 Done.
+ // it. Ignore other dependencies; the module requesting them should be
not at google - send to devlin 2015/01/13 21:46:46 could you mention what these other dependencies mi
Sam McNally 2015/01/13 23:48:43 Done.
+ // ensuring that its module's dependencies are available.
+ if (registry->available_modules().count(dependency) == 0 &&
+ (module_system_managed || source_map_->Contains(dependency))) {
+ LoadModule(dependency);
+ }
}
registry->AttemptToLoadMoreModules(GetIsolate());
}

Powered by Google App Engine
This is Rietveld 408576698