DescriptionAdd KURL::protocolIsJavascript member function
Javascript URLs have weird rules in Blink. Even if the URL is invalid, many
systems would like to know if the URL has a javascript protocol. Using
KURL::protocol does not work, because for invalid URLs it results in the empty
string.
Previously, systems used blink::protocolIsJavascript, which calls into
url::FindAndCompareScheme. However, a StringView approach with the
already-canonicalized URL is good enough and more efficient, as it doesn't
scan for whitespace and can quickly fail with a length mismatch.
Also, callers were passing Strings around instead of KURLs, so this tightens
the KURL interface.
BUG=348655
Review-Url: https://codereview.chromium.org/2644633006
Cr-Commit-Position: refs/heads/master@{#445481}
Committed: https://chromium.googlesource.com/chromium/src/+/43d920ee6dea456674a0baa54506ec4da3cc6a85
Patch Set 1 #Messages
Total messages: 14 (10 generated)
|