| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 return command_line_cwd_.Resolve(path); | 269 return command_line_cwd_.Resolve(path); |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool Context::Init() { | 272 bool Context::Init() { |
| 273 TRACE_EVENT0("mojo_shell", "Context::Init"); | 273 TRACE_EVENT0("mojo_shell", "Context::Init"); |
| 274 const base::CommandLine& command_line = | 274 const base::CommandLine& command_line = |
| 275 *base::CommandLine::ForCurrentProcess(); | 275 *base::CommandLine::ForCurrentProcess(); |
| 276 | 276 |
| 277 EnsureEmbedderIsInitialized(); | 277 EnsureEmbedderIsInitialized(); |
| 278 task_runners_.reset( | 278 task_runners_.reset( |
| 279 new TaskRunners(base::MessageLoop::current()->message_loop_proxy())); | 279 new TaskRunners(base::MessageLoop::current()->task_runner())); |
| 280 | 280 |
| 281 // TODO(vtl): Probably these failures should be checked before |Init()|, and | 281 // TODO(vtl): Probably these failures should be checked before |Init()|, and |
| 282 // this function simply shouldn't fail. | 282 // this function simply shouldn't fail. |
| 283 if (!shell_file_root_.is_valid()) | 283 if (!shell_file_root_.is_valid()) |
| 284 return false; | 284 return false; |
| 285 if (!ConfigureURLMappings(command_line, this)) | 285 if (!ConfigureURLMappings(command_line, this)) |
| 286 return false; | 286 return false; |
| 287 | 287 |
| 288 // TODO(vtl): This should be MASTER, not NONE. | 288 // TODO(vtl): This should be MASTER, not NONE. |
| 289 embedder::InitIPCSupport( | 289 embedder::InitIPCSupport( |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 376 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
| 377 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 377 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
| 378 task_runners_->shell_runner()); | 378 task_runners_->shell_runner()); |
| 379 base::MessageLoop::current()->Quit(); | 379 base::MessageLoop::current()->Quit(); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace runner | 384 } // namespace runner |
| 385 } // namespace mojo | 385 } // namespace mojo |
| OLD | NEW |