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

Unified Diff: mojo/runner/context.cc

Issue 1352663002: Extract some stuff into PackageManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 | « mojo/runner/context.h ('k') | mojo/runner/native_runner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/runner/context.cc
diff --git a/mojo/runner/context.cc b/mojo/runner/context.cc
index fc312bfff7a30a0f5e119f73f94b6c85fd5df987..a1e59899e80d048d3e60bf35fe1d99fba794857f 100644
--- a/mojo/runner/context.cc
+++ b/mojo/runner/context.cc
@@ -29,7 +29,7 @@
#include "mojo/common/tracing_impl.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"
-#include "mojo/fetcher/base_application_fetcher.h"
+#include "mojo/package_manager/package_manager_impl.h"
#include "mojo/runner/in_process_native_runner.h"
#include "mojo/runner/out_of_process_native_runner.h"
#include "mojo/runner/switches.h"
@@ -59,7 +59,7 @@ class Setup {
DISALLOW_COPY_AND_ASSIGN(Setup);
};
-void InitContentHandlers(shell::ApplicationManager* manager,
+void InitContentHandlers(package_manager::PackageManagerImpl* manager,
const base::CommandLine& command_line) {
// Default content handlers.
manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer"));
@@ -162,9 +162,7 @@ class TracingServiceProvider : public ServiceProvider {
} // namespace
Context::Context(const base::FilePath& shell_file_root)
- : application_manager_(new shell::ApplicationManager(make_scoped_ptr(
- new fetcher::BaseApplicationFetcher(shell_file_root)))),
- main_entry_time_(base::Time::Now()) {}
+ : shell_file_root_(shell_file_root), main_entry_time_(base::Time::Now()) {}
Context::~Context() {
DCHECK(!base::MessageLoop::current());
@@ -190,6 +188,12 @@ bool Context::Init() {
embedder::ProcessType::NONE, task_runners_->shell_runner(), this,
task_runners_->io_runner(), embedder::ScopedPlatformHandle());
+ package_manager_ = new package_manager::PackageManagerImpl(shell_file_root_);
+ InitContentHandlers(package_manager_, command_line);
+
+ application_manager_.reset(
+ new shell::ApplicationManager(make_scoped_ptr(package_manager_)));
+
scoped_ptr<shell::NativeRunnerFactory> runner_factory;
if (command_line.HasSwitch(switches::kEnableMultiprocess))
runner_factory.reset(new OutOfProcessNativeRunnerFactory(this));
@@ -198,8 +202,6 @@ bool Context::Init() {
application_manager_->set_blocking_pool(task_runners_->blocking_pool());
application_manager_->set_native_runner_factory(runner_factory.Pass());
- InitContentHandlers(application_manager_.get(), command_line);
-
ServiceProviderPtr service_provider_ptr;
ServiceProviderPtr tracing_service_provider_ptr;
new TracingServiceProvider(GetProxy(&tracing_service_provider_ptr));
« no previous file with comments | « mojo/runner/context.h ('k') | mojo/runner/native_runner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698