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

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

Issue 1272113002: Allow url::SchemeHostPort to hold non-file scheme without port (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 | « ios/chrome/test/ios_chrome_unit_test_suite.cc ('k') | url/scheme_host_port.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/url_resolver.h" 5 #include "mojo/runner/url_resolver.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "mojo/runner/switches.h" 10 #include "mojo/runner/switches.h"
11 #include "mojo/shell/query_util.h" 11 #include "mojo/shell/query_util.h"
12 #include "mojo/util/filename_util.h" 12 #include "mojo/util/filename_util.h"
13 #include "url/url_util.h" 13 #include "url/url_util.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace runner { 16 namespace runner {
17 17
18 URLResolver::URLResolver() { 18 URLResolver::URLResolver() {
19 // Needed to treat first component of mojo URLs as host, not path. 19 // Needed to treat first component of mojo URLs as host, not path.
20 url::AddStandardScheme("mojo"); 20 url::AddStandardScheme("mojo", url::SCHEME_WITHOUT_AUTHORITY);
21 } 21 }
22 22
23 URLResolver::~URLResolver() { 23 URLResolver::~URLResolver() {
24 } 24 }
25 25
26 // static 26 // static
27 std::vector<URLResolver::OriginMapping> URLResolver::GetOriginMappings( 27 std::vector<URLResolver::OriginMapping> URLResolver::GetOriginMappings(
28 const base::CommandLine::StringVector& args) { 28 const base::CommandLine::StringVector& args) {
29 std::vector<OriginMapping> origin_mappings; 29 std::vector<OriginMapping> origin_mappings;
30 const std::string kArgsForSwitches[] = { 30 const std::string kArgsForSwitches[] = {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 // It's still a mojo: URL, use the default mapping scheme. 109 // It's still a mojo: URL, use the default mapping scheme.
110 std::string query; 110 std::string query;
111 GURL base_url = shell::GetBaseURLAndQuery(mojo_url, &query); 111 GURL base_url = shell::GetBaseURLAndQuery(mojo_url, &query);
112 const std::string host = base_url.host(); 112 const std::string host = base_url.host();
113 return mojo_base_url_.Resolve(host + "/" + host + ".mojo" + query); 113 return mojo_base_url_.Resolve(host + "/" + host + ".mojo" + query);
114 } 114 }
115 115
116 } // namespace runner 116 } // namespace runner
117 } // namespace mojo 117 } // namespace mojo
OLDNEW
« no previous file with comments | « ios/chrome/test/ios_chrome_unit_test_suite.cc ('k') | url/scheme_host_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698