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

Side by Side Diff: url/url_canon_stdurl.cc

Issue 2403713002: Add suborigin logic to url::Origin (Closed)
Patch Set: Minor simplification Created 4 years, 2 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
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 // Functions to canonicalize "standard" URLs, which are ones that have an 5 // Functions to canonicalize "standard" URLs, which are ones that have an
6 // authority section including a host name. 6 // authority section including a host name.
7 7
8 #include "url/url_canon.h" 8 #include "url/url_canon.h"
9 #include "url/url_canon_internal.h" 9 #include "url/url_canon_internal.h"
10 #include "url/url_constants.h" 10 #include "url/url_constants.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 default_port = 443; 113 default_port = 443;
114 break; 114 break;
115 case 6: 115 case 6:
116 if (!strncmp(scheme, kGopherScheme, scheme_len)) 116 if (!strncmp(scheme, kGopherScheme, scheme_len))
117 default_port = 70; 117 default_port = 70;
118 break; 118 break;
119 case 2: 119 case 2:
120 if (!strncmp(scheme, kWsScheme, scheme_len)) 120 if (!strncmp(scheme, kWsScheme, scheme_len))
121 default_port = 80; 121 default_port = 80;
122 break; 122 break;
123 case 7:
124 if (!strncmp(scheme, kHttpSuboriginScheme, scheme_len))
125 default_port = 80;
126 break;
127 case 8:
128 if (!strncmp(scheme, kHttpsSuboriginScheme, scheme_len))
129 default_port = 80;
Mike West 2016/10/11 07:40:41 443? Both of these should have tests as well.
jww 2016/10/11 18:16:27 Done.
130 break;
123 } 131 }
124 return default_port; 132 return default_port;
125 } 133 }
126 134
127 bool CanonicalizeStandardURL(const char* spec, 135 bool CanonicalizeStandardURL(const char* spec,
128 int spec_len, 136 int spec_len,
129 const Parsed& parsed, 137 const Parsed& parsed,
130 CharsetConverter* query_converter, 138 CharsetConverter* query_converter,
131 CanonOutput* output, 139 CanonOutput* output,
132 Parsed* new_parsed) { 140 Parsed* new_parsed) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 Parsed* new_parsed) { 186 Parsed* new_parsed) {
179 RawCanonOutput<1024> utf8; 187 RawCanonOutput<1024> utf8;
180 URLComponentSource<char> source(base); 188 URLComponentSource<char> source(base);
181 Parsed parsed(base_parsed); 189 Parsed parsed(base_parsed);
182 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); 190 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed);
183 return DoCanonicalizeStandardURL<char, unsigned char>( 191 return DoCanonicalizeStandardURL<char, unsigned char>(
184 source, parsed, query_converter, output, new_parsed); 192 source, parsed, query_converter, output, new_parsed);
185 } 193 }
186 194
187 } // namespace url 195 } // namespace url
OLDNEW
« url/origin_unittest.cc ('K') | « url/origin_unittest.cc ('k') | url/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698