Lines Matching full:scheme
28 // A pair for representing a standard scheme name and the SchemeType for it.
30 std::string scheme; member
34 // A pair for representing a scheme and a custom protocol handler for it.
40 std::string scheme; member
65 // WARNING: Adding (1) a non-"standard" scheme or (2) a scheme whose URLs have
90 // loaded with any other URL scheme.
130 // Gets the scheme registry without locking the schemes. This should *only* be
158 return compare_to[0] == 0; // When component is empty, match empty scheme. in DoCompareSchemeComponent()
164 // Returns true and sets |type| to the SchemeType of the given scheme
165 // identified by |scheme| within |spec| if in |schemes|.
168 const Component& scheme, in DoIsInSchemes() argument
171 if (scheme.is_empty()) in DoIsInSchemes()
176 std::basic_string_view(&spec[scheme.begin], scheme.len), in DoIsInSchemes()
177 scheme_with_type.scheme)) { in DoIsInSchemes()
186 bool DoIsStandard(const CHAR* spec, const Component& scheme, SchemeType* type) { in DoIsStandard() argument
187 return DoIsInSchemes(spec, scheme, type, in DoIsStandard()
197 // Before extracting scheme, canonicalize the URL to remove any whitespace. in DoFindAndCompareScheme()
206 // No scheme. in DoFindAndCompareScheme()
261 Component scheme; in DoCanonicalize() local
262 if (!ExtractScheme(spec, spec_len, &scheme)) in DoCanonicalize()
269 if (DoCompareSchemeComponent(spec, scheme, url::kFileScheme)) { in DoCanonicalize()
274 } else if (DoCompareSchemeComponent(spec, scheme, url::kFileSystemScheme)) { in DoCanonicalize()
280 } else if (DoIsStandard(spec, scheme, &scheme_type)) { in DoCanonicalize()
287 DoCompareSchemeComponent(spec, scheme, url::kMailToScheme)) { in DoCanonicalize()
288 // Mailto URLs are treated like standard URLs, with only a scheme, path, in DoCanonicalize()
291 // TODO(crbug.com/1416006): Remove the special handling of 'mailto:" scheme in DoCanonicalize()
298 // Non-special scheme URLs like data: and javascript:. in DoCanonicalize()
333 base_parsed.scheme.is_nonempty()) { in DoResolveRelative()
334 int after_scheme = base_parsed.scheme.end() + 1; // Skip past the colon. in DoResolveRelative()
345 base_parsed.scheme.is_nonempty() && !base_parsed.has_opaque_path; in DoResolveRelative()
349 base_parsed.scheme.is_nonempty() && in DoResolveRelative()
350 DoIsStandard(base_spec, base_parsed.scheme, &unused_scheme_type); in DoResolveRelative()
387 bool file_base_scheme = base_parsed.scheme.is_nonempty() && in DoResolveRelative()
388 DoCompareSchemeComponent(base_spec, base_parsed.scheme, kFileScheme); in DoResolveRelative()
408 // If the scheme is overridden, just do a simple string substitution and in DoReplaceComponents()
417 // case for replacing the scheme. The most common case for hitting this is in DoReplaceComponents()
422 // Canonicalize the new scheme so it is 8-bit and can be concatenated with in DoReplaceComponents()
426 CanonicalizeScheme(replacements.sources().scheme, in DoReplaceComponents()
427 replacements.components().scheme, in DoReplaceComponents()
431 // a colon after the scheme (or where the scheme would be). in DoReplaceComponents()
432 int spec_after_colon = parsed.scheme.is_valid() ? parsed.scheme.end() + 1 in DoReplaceComponents()
440 // may have changed with the different scheme. in DoReplaceComponents()
447 // Recurse using the version with the scheme already replaced. This will now in DoReplaceComponents()
448 // use the replacement rules for the new scheme. in DoReplaceComponents()
455 // If the scheme-specific replacers are made more intelligent so they don't in DoReplaceComponents()
457 // after this call to check validity (this assumes replacing the scheme is in DoReplaceComponents()
480 // If we get here, then we know the scheme doesn't need to be replaced, so can in DoReplaceComponents()
481 // just key off the scheme in the spec to know how to do the replacements. in DoReplaceComponents()
482 if (DoCompareSchemeComponent(spec, parsed.scheme, url::kFileScheme)) { in DoReplaceComponents()
486 if (DoCompareSchemeComponent(spec, parsed.scheme, url::kFileSystemScheme)) { in DoReplaceComponents()
491 if (DoIsStandard(spec, parsed.scheme, &scheme_type)) { in DoReplaceComponents()
496 DoCompareSchemeComponent(spec, parsed.scheme, url::kMailToScheme)) { in DoReplaceComponents()
508 // If this assert triggers, it means you've called Add*Scheme after in DoSchemeModificationPreamble()
511 // This normally means you're trying to set up a new scheme too late or using in DoSchemeModificationPreamble()
514 << "Trying to add a scheme after the lists have been used. " in DoSchemeModificationPreamble()
517 // If this assert triggers, it means you've called Add*Scheme after in DoSchemeModificationPreamble()
521 // This normally means you're trying to set up a new scheme too late in your in DoSchemeModificationPreamble()
523 // and calls LockSchemeRegistries, and add your new scheme there. in DoSchemeModificationPreamble()
525 << "Trying to add a scheme after the lists have been locked."; in DoSchemeModificationPreamble()
536 DCHECK(!base::Contains(*schemes, new_scheme, &SchemeWithHandler::scheme)); in DoAddSchemeWithHandler()
556 DCHECK(!base::Contains(*schemes, new_scheme, &SchemeWithType::scheme)); in DoAddSchemeWithType()
613 result.push_back(entry.scheme); in GetStandardSchemes()
695 result.emplace_back(entry.scheme, entry.handler); in GetPredefinedHandlerSchemes()
704 bool IsStandard(const char* spec, const Component& scheme) { in IsStandard() argument
706 return DoIsStandard(spec, scheme, &unused_scheme_type); in IsStandard()
709 bool IsStandardScheme(std::string_view scheme) { in IsStandardScheme() argument
710 return IsStandard(scheme.data(), in IsStandardScheme()
711 Component(0, base::checked_cast<int>(scheme.size()))); in IsStandardScheme()
715 const Component& scheme, in GetStandardSchemeType() argument
717 return DoIsStandard(spec, scheme, type); in GetStandardSchemeType()
721 const Component& scheme, in GetStandardSchemeType() argument
723 return DoIsStandard(spec, scheme, type); in GetStandardSchemeType()
726 bool IsStandard(const char16_t* spec, const Component& scheme) { in IsStandard() argument
728 return DoIsStandard(spec, scheme, &unused_scheme_type); in IsStandard()
731 bool IsReferrerScheme(const char* spec, const Component& scheme) { in IsReferrerScheme() argument
733 return DoIsInSchemes(spec, scheme, &unused_scheme_type, in IsReferrerScheme()
961 bool IsAndroidWebViewHackEnabledScheme(std::string_view scheme) { in IsAndroidWebViewHackEnabledScheme() argument
963 !IsStandardScheme(scheme); in IsAndroidWebViewHackEnabledScheme()