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

Side by Side Diff: mojo/runner/context.cc

Issue 1180653002: Build Mojo apps in subdirectories, like application packages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase; update tests. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « mojo/runner/BUILD.gn ('k') | mojo/runner/url_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/runner/BUILD.gn ('k') | mojo/runner/url_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698