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

Unified Diff: content/child/process_control_impl.cc

Issue 1889253002: Remove uses of shell::Loader from content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « content/child/process_control_impl.h ('k') | content/common/mojo/embedded_application_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/process_control_impl.cc
diff --git a/content/child/process_control_impl.cc b/content/child/process_control_impl.cc
index 36ec78f5093e0034a02a584a982393b414abdf95..b465db6e94bc53d01cae229a8060b42b93825135 100644
--- a/content/child/process_control_impl.cc
+++ b/content/child/process_control_impl.cc
@@ -6,8 +6,8 @@
#include <utility>
-#include "base/stl_util.h"
-#include "content/common/mojo/static_loader.h"
+#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "content/public/common/content_client.h"
namespace content {
@@ -16,29 +16,36 @@ ProcessControlImpl::ProcessControlImpl() {
}
ProcessControlImpl::~ProcessControlImpl() {
- STLDeleteValues(&name_to_loader_map_);
}
void ProcessControlImpl::LoadApplication(
const mojo::String& name,
- mojo::InterfaceRequest<shell::mojom::ShellClient> request,
+ shell::mojom::ShellClientRequest request,
const LoadApplicationCallback& callback) {
- // Only register loaders when we need it.
- if (!has_registered_loaders_) {
- DCHECK(name_to_loader_map_.empty());
- RegisterLoaders(&name_to_loader_map_);
- has_registered_loaders_ = true;
+ // Only register apps on first run.
+ if (!has_registered_apps_) {
+ DCHECK(apps_.empty());
+ ApplicationFactoryMap app_factories;
+ RegisterApplicationFactories(&app_factories);
+ for (const auto& factory : app_factories) {
+ std::unique_ptr<EmbeddedApplicationRunner> runner(
+ new EmbeddedApplicationRunner(factory.second, nullptr));
+ runner->SetQuitClosure(base::Bind(&ProcessControlImpl::OnApplicationQuit,
+ base::Unretained(this)));
+ apps_.insert(std::make_pair(factory.first, std::move(runner)));
+ }
+ has_registered_apps_ = true;
}
- auto it = name_to_loader_map_.find(name);
- if (it == name_to_loader_map_.end()) {
+ auto it = apps_.find(name);
+ if (it == apps_.end()) {
callback.Run(false);
OnLoadFailed();
return;
}
callback.Run(true);
- it->second->Load(name, std::move(request));
+ it->second->BindShellClientRequest(std::move(request));
}
} // namespace content
« no previous file with comments | « content/child/process_control_impl.h ('k') | content/common/mojo/embedded_application_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698