| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 base_url = context->ResolveShellFileURL(""); | 69 base_url = context->ResolveShellFileURL(""); |
| 70 | 70 |
| 71 if (!base_url.is_valid()) | 71 if (!base_url.is_valid()) |
| 72 return false; | 72 return false; |
| 73 | 73 |
| 74 resolver->SetMojoBaseURL(base_url); | 74 resolver->SetMojoBaseURL(base_url); |
| 75 | 75 |
| 76 // The network service must be loaded from the filesystem. | 76 // The network service must be loaded from the filesystem. |
| 77 // This mapping is done before the command line URL mapping are processed, so | 77 // This mapping is done before the command line URL mapping are processed, so |
| 78 // that it can be overridden. | 78 // that it can be overridden. |
| 79 resolver->AddURLMapping( | 79 resolver->AddURLMapping(GURL("mojo:network_service"), |
| 80 GURL("mojo:network_service"), | 80 context->ResolveShellFileURL( |
| 81 context->ResolveShellFileURL("file:network_service.mojo")); | 81 "file:network_service/network_service.mojo")); |
| 82 | 82 |
| 83 // Command line URL mapping. | 83 // Command line URL mapping. |
| 84 std::vector<URLResolver::OriginMapping> origin_mappings = | 84 std::vector<URLResolver::OriginMapping> origin_mappings = |
| 85 URLResolver::GetOriginMappings(command_line.argv()); | 85 URLResolver::GetOriginMappings(command_line.argv()); |
| 86 for (const auto& origin_mapping : origin_mappings) | 86 for (const auto& origin_mapping : origin_mappings) |
| 87 resolver->AddOriginMapping(GURL(origin_mapping.origin), | 87 resolver->AddOriginMapping(GURL(origin_mapping.origin), |
| 88 GURL(origin_mapping.base_url)); | 88 GURL(origin_mapping.base_url)); |
| 89 | 89 |
| 90 if (command_line.HasSwitch(switches::kURLMappings)) { | 90 if (command_line.HasSwitch(switches::kURLMappings)) { |
| 91 const std::string mappings = | 91 const std::string mappings = |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 374 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
| 375 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 375 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
| 376 task_runners_->shell_runner()); | 376 task_runners_->shell_runner()); |
| 377 base::MessageLoop::current()->Quit(); | 377 base::MessageLoop::current()->Quit(); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace runner | 382 } // namespace runner |
| 383 } // namespace mojo | 383 } // namespace mojo |
| OLD | NEW |