Lines Matching full:scheme
30 // don't have to worry about invalid scheme characters since we are comparing
31 // against the canonical scheme of the base.
69 bool IsValidScheme(const CHAR* url, const Component& scheme) { in IsValidScheme() argument
70 // Caller should ensure that the |scheme| is not empty. in IsValidScheme()
71 DCHECK_NE(0, scheme.len); in IsValidScheme()
73 // From https://url.spec.whatwg.org/#scheme-start-state: in IsValidScheme()
74 // scheme start state: in IsValidScheme()
76 // state to scheme state. in IsValidScheme()
77 // 2. Otherwise, if state override is not given, set state to no scheme in IsValidScheme()
80 // Note that both step 2 and step 3 mean that the scheme was not valid. in IsValidScheme()
81 if (!base::IsAsciiAlpha(url[scheme.begin])) in IsValidScheme()
84 // From https://url.spec.whatwg.org/#scheme-state: in IsValidScheme()
85 // scheme state: in IsValidScheme()
90 // We begin at |scheme.begin + 1|, because the character at |scheme.begin| has in IsValidScheme()
92 int scheme_end = scheme.end(); in IsValidScheme()
93 for (int i = scheme.begin + 1; i < scheme_end; i++) { in IsValidScheme()
118 // Don't allow relative URLs if the base scheme doesn't support it. in DoIsRelativeURL()
133 // as relative, as this will just replace the path when the base scheme in DoIsRelativeURL()
143 // See if we've got a scheme, if not, we know this is a relative URL. in DoIsRelativeURL()
144 // BUT, just because we have a scheme, doesn't make it absolute. in DoIsRelativeURL()
145 // "http:foo.html" is a relative URL with path "foo.html". If the scheme is in DoIsRelativeURL()
147 Component scheme; in DoIsRelativeURL() local
149 !ExtractScheme(url, url_len, &scheme) || scheme.len == 0; in DoIsRelativeURL()
155 // Don't allow relative URLs if the base scheme doesn't support it. in DoIsRelativeURL()
164 // If the scheme isn't valid, then it's relative. in DoIsRelativeURL()
165 if (!IsValidScheme(url, scheme)) { in DoIsRelativeURL()
170 // Don't allow relative URLs if the base scheme doesn't support it. in DoIsRelativeURL()
178 // If base scheme is not standard, or the schemes are different, we can't in DoIsRelativeURL()
181 // URL Standard: https://url.spec.whatwg.org/#scheme-state in DoIsRelativeURL()
183 // scheme state: in DoIsRelativeURL()
184 // > 2.6. Otherwise, if url is special, base is non-null, and base’s scheme is in DoIsRelativeURL()
185 // > url’s scheme: in DoIsRelativeURL()
187 !IsStandard(base, base_parsed.scheme)) || in DoIsRelativeURL()
188 !AreSchemesEqual(base, base_parsed.scheme, url, scheme)) { in DoIsRelativeURL()
192 // When the scheme that they both share is not hierarchical, treat the in DoIsRelativeURL()
193 // incoming scheme as absolute (this way with the base of "data:foo", in DoIsRelativeURL()
198 int colon_offset = scheme.end(); in DoIsRelativeURL()
201 // supply a scheme. There's no equivalent to e.g. http:index.html. in DoIsRelativeURL()
202 if (CompareSchemeComponent(url, scheme, kFileSystemScheme)) in DoIsRelativeURL()
206 // considers to be the scheme. CountConsecutiveSlashes will handle the in DoIsRelativeURL()
218 // Two or more slashes after the scheme we treat as absolute. in DoIsRelativeURL()
361 // Fortunately, we can use `base_parsed.scheme.end()` here because we don't in DoResolveRelativePath()
364 output->Append(base_url, base_parsed.scheme.end()); in DoResolveRelativePath()
482 // should be kept from the original URL is the scheme.
493 GetStandardSchemeType(base_url, base_parsed.scheme, &scheme_type); in DoResolveRelativeHost()
496 // scheme. in DoResolveRelativeHost()
497 Parsed relative_parsed; // Everything but the scheme is valid. in DoResolveRelativeHost()
519 // Length() does not include the old scheme, so make sure to add it from the in DoResolveRelativeHost()
547 // not bother to look for a scheme. in DoResolveAbsoluteFile()
588 ? base_parsed.scheme.is_empty() in DoResolveRelativeURL()
613 // they are) means that it's UNC. Two backslashes on any base scheme mean in DoResolveRelativeURL()
617 // We also allow Windows absolute drive specs on any scheme (for example in DoResolveRelativeURL()
636 // slashes because the generic scheme parsing always extracts a host, but a in DoResolveRelativeURL()
647 // Any other double-slashes mean that this is relative to the scheme. in DoResolveRelativeURL()