| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/runner/context.h" | 5 #include "mojo/runner/context.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 EnsureEmbedderIsInitialized(); | 182 EnsureEmbedderIsInitialized(); |
| 183 task_runners_.reset( | 183 task_runners_.reset( |
| 184 new TaskRunners(base::MessageLoop::current()->task_runner())); | 184 new TaskRunners(base::MessageLoop::current()->task_runner())); |
| 185 | 185 |
| 186 // TODO(vtl): This should be MASTER, not NONE. | 186 // TODO(vtl): This should be MASTER, not NONE. |
| 187 embedder::InitIPCSupport( | 187 embedder::InitIPCSupport( |
| 188 embedder::ProcessType::NONE, task_runners_->shell_runner(), this, | 188 embedder::ProcessType::NONE, task_runners_->shell_runner(), this, |
| 189 task_runners_->io_runner(), embedder::ScopedPlatformHandle()); | 189 task_runners_->io_runner(), embedder::ScopedPlatformHandle()); |
| 190 | 190 |
| 191 package_manager_ = new package_manager::PackageManagerImpl(shell_file_root_); | 191 package_manager_ = new package_manager::PackageManagerImpl( |
| 192 shell_file_root_, task_runners_->blocking_pool()); |
| 192 InitContentHandlers(package_manager_, command_line); | 193 InitContentHandlers(package_manager_, command_line); |
| 193 | 194 |
| 194 application_manager_.reset( | |
| 195 new shell::ApplicationManager(make_scoped_ptr(package_manager_))); | |
| 196 | |
| 197 scoped_ptr<shell::NativeRunnerFactory> runner_factory; | 195 scoped_ptr<shell::NativeRunnerFactory> runner_factory; |
| 198 if (command_line.HasSwitch(switches::kEnableMultiprocess)) | 196 if (command_line.HasSwitch(switches::kEnableMultiprocess)) |
| 199 runner_factory.reset(new OutOfProcessNativeRunnerFactory(this)); | 197 runner_factory.reset(new OutOfProcessNativeRunnerFactory(this)); |
| 200 else | 198 else |
| 201 runner_factory.reset(new InProcessNativeRunnerFactory(this)); | 199 runner_factory.reset(new InProcessNativeRunnerFactory(this)); |
| 202 application_manager_->set_blocking_pool(task_runners_->blocking_pool()); | 200 application_manager_.reset(new shell::ApplicationManager( |
| 203 application_manager_->set_native_runner_factory(runner_factory.Pass()); | 201 make_scoped_ptr(package_manager_), runner_factory.Pass(), |
| 202 task_runners_->blocking_pool())); |
| 204 | 203 |
| 205 ServiceProviderPtr service_provider_ptr; | 204 ServiceProviderPtr service_provider_ptr; |
| 206 ServiceProviderPtr tracing_service_provider_ptr; | 205 ServiceProviderPtr tracing_service_provider_ptr; |
| 207 new TracingServiceProvider(GetProxy(&tracing_service_provider_ptr)); | 206 new TracingServiceProvider(GetProxy(&tracing_service_provider_ptr)); |
| 208 | 207 |
| 209 scoped_ptr<shell::ConnectToApplicationParams> params( | 208 scoped_ptr<shell::ConnectToApplicationParams> params( |
| 210 new shell::ConnectToApplicationParams); | 209 new shell::ConnectToApplicationParams); |
| 211 params->SetTargetURL(GURL("mojo:tracing")); | 210 params->SetTargetURL(GURL("mojo:tracing")); |
| 212 params->set_services(GetProxy(&service_provider_ptr)); | 211 params->set_services(GetProxy(&service_provider_ptr)); |
| 213 params->set_exposed_services(tracing_service_provider_ptr.Pass()); | 212 params->set_exposed_services(tracing_service_provider_ptr.Pass()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 base::MessageLoop::current()->Quit(); | 295 base::MessageLoop::current()->Quit(); |
| 297 } else { | 296 } else { |
| 298 app_complete_callback_.Run(); | 297 app_complete_callback_.Run(); |
| 299 } | 298 } |
| 300 } | 299 } |
| 301 } | 300 } |
| 302 } | 301 } |
| 303 | 302 |
| 304 } // namespace runner | 303 } // namespace runner |
| 305 } // namespace mojo | 304 } // namespace mojo |
| OLD | NEW |