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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 EnsureEmbedderIsInitialized(); | 185 EnsureEmbedderIsInitialized(); |
186 task_runners_.reset( | 186 task_runners_.reset( |
187 new TaskRunners(base::MessageLoop::current()->task_runner())); | 187 new TaskRunners(base::MessageLoop::current()->task_runner())); |
188 | 188 |
189 // TODO(vtl): This should be MASTER, not NONE. | 189 // TODO(vtl): This should be MASTER, not NONE. |
190 embedder::InitIPCSupport( | 190 embedder::InitIPCSupport( |
191 embedder::ProcessType::NONE, task_runners_->shell_runner(), this, | 191 embedder::ProcessType::NONE, task_runners_->shell_runner(), this, |
192 task_runners_->io_runner(), embedder::ScopedPlatformHandle()); | 192 task_runners_->io_runner(), embedder::ScopedPlatformHandle()); |
193 | 193 |
194 package_manager_ = new package_manager::PackageManagerImpl(shell_file_root_); | 194 package_manager_ = new package_manager::PackageManagerImpl( |
| 195 shell_file_root_, task_runners_->blocking_pool()); |
195 InitContentHandlers(package_manager_, command_line); | 196 InitContentHandlers(package_manager_, command_line); |
196 | 197 |
197 application_manager_.reset( | |
198 new shell::ApplicationManager(make_scoped_ptr(package_manager_))); | |
199 | |
200 scoped_ptr<shell::NativeRunnerFactory> runner_factory; | 198 scoped_ptr<shell::NativeRunnerFactory> runner_factory; |
201 if (command_line.HasSwitch(switches::kEnableMultiprocess)) | 199 if (command_line.HasSwitch(switches::kEnableMultiprocess)) |
202 runner_factory.reset(new OutOfProcessNativeRunnerFactory(this)); | 200 runner_factory.reset(new OutOfProcessNativeRunnerFactory(this)); |
203 else | 201 else |
204 runner_factory.reset(new InProcessNativeRunnerFactory(this)); | 202 runner_factory.reset(new InProcessNativeRunnerFactory(this)); |
205 application_manager_->set_blocking_pool(task_runners_->blocking_pool()); | 203 application_manager_.reset(new shell::ApplicationManager( |
206 application_manager_->set_native_runner_factory(runner_factory.Pass()); | 204 make_scoped_ptr(package_manager_), runner_factory.Pass(), |
| 205 task_runners_->blocking_pool())); |
207 | 206 |
208 ServiceProviderPtr service_provider_ptr; | 207 ServiceProviderPtr service_provider_ptr; |
209 ServiceProviderPtr tracing_service_provider_ptr; | 208 ServiceProviderPtr tracing_service_provider_ptr; |
210 new TracingServiceProvider(GetProxy(&tracing_service_provider_ptr)); | 209 new TracingServiceProvider(GetProxy(&tracing_service_provider_ptr)); |
211 | 210 |
212 scoped_ptr<shell::ConnectToApplicationParams> params( | 211 scoped_ptr<shell::ConnectToApplicationParams> params( |
213 new shell::ConnectToApplicationParams); | 212 new shell::ConnectToApplicationParams); |
214 params->set_source(shell::Identity(GURL("mojo:shell"), std::string(), | 213 params->set_source(shell::Identity(GURL("mojo:shell"), std::string(), |
215 shell::GetPermissiveCapabilityFilter())); | 214 shell::GetPermissiveCapabilityFilter())); |
216 params->SetTarget(shell::Identity(GURL("mojo:tracing"), std::string(), | 215 params->SetTarget(shell::Identity(GURL("mojo:tracing"), std::string(), |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 base::MessageLoop::current()->Quit(); | 301 base::MessageLoop::current()->Quit(); |
303 } else { | 302 } else { |
304 app_complete_callback_.Run(); | 303 app_complete_callback_.Run(); |
305 } | 304 } |
306 } | 305 } |
307 } | 306 } |
308 } | 307 } |
309 | 308 |
310 } // namespace runner | 309 } // namespace runner |
311 } // namespace mojo | 310 } // namespace mojo |
OLD | NEW |