Commit cd71071e authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Don't count or report WCv0 usage for chrome:// URLs

Prior to this CL, the chrome://settings and other WebUI pages
would report deprecation messages in the Console, such as:

[Deprecation] HTML Imports is deprecated and will be removed in M80, around
February 2020. Please use ES modules instead. See
https://www.chromestatus.com/features/5144752345317376 and
https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade
for more details.

These will no longer be shown. Additionally, this usage of the
deprecated APIs will also no longer be counted.

Fixed: 1057337
Bug: 965770
Change-Id: Ibef14072bda8b4ad1147593d587d4fd941669ddb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081236
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746108}
parent e07e849e
...@@ -5798,7 +5798,7 @@ String Document::cookie(ExceptionState& exception_state) const { ...@@ -5798,7 +5798,7 @@ String Document::cookie(ExceptionState& exception_state) const {
if (IsSandboxed(mojom::blink::WebSandboxFlags::kOrigin)) if (IsSandboxed(mojom::blink::WebSandboxFlags::kOrigin))
exception_state.ThrowSecurityError( exception_state.ThrowSecurityError(
"The document is sandboxed and lacks the 'allow-same-origin' flag."); "The document is sandboxed and lacks the 'allow-same-origin' flag.");
else if (Url().ProtocolIs("data")) else if (Url().ProtocolIsData())
exception_state.ThrowSecurityError( exception_state.ThrowSecurityError(
"Cookies are disabled inside 'data:' URLs."); "Cookies are disabled inside 'data:' URLs.");
else else
...@@ -5824,7 +5824,7 @@ void Document::setCookie(const String& value, ExceptionState& exception_state) { ...@@ -5824,7 +5824,7 @@ void Document::setCookie(const String& value, ExceptionState& exception_state) {
if (IsSandboxed(mojom::blink::WebSandboxFlags::kOrigin)) if (IsSandboxed(mojom::blink::WebSandboxFlags::kOrigin))
exception_state.ThrowSecurityError( exception_state.ThrowSecurityError(
"The document is sandboxed and lacks the 'allow-same-origin' flag."); "The document is sandboxed and lacks the 'allow-same-origin' flag.");
else if (Url().ProtocolIs("data")) else if (Url().ProtocolIsData())
exception_state.ThrowSecurityError( exception_state.ThrowSecurityError(
"Cookies are disabled inside 'data:' URLs."); "Cookies are disabled inside 'data:' URLs.");
else else
...@@ -8665,6 +8665,15 @@ void Document::CountDeprecation(mojom::WebFeature feature) { ...@@ -8665,6 +8665,15 @@ void Document::CountDeprecation(mojom::WebFeature feature) {
CountUse(WebFeature::kDocumentRegisterElementOnReverseOriginTrials); CountUse(WebFeature::kDocumentRegisterElementOnReverseOriginTrials);
} }
} }
// Don't count or report usage of WebComponentsV0 for chrome:// URLs.
if (Url().ProtocolIs("chrome") &&
(feature == WebFeature::kHTMLImports ||
feature == WebFeature::kElementCreateShadowRoot ||
feature == WebFeature::kDocumentRegisterElement)) {
return;
}
Deprecation::CountDeprecation(Loader(), feature); Deprecation::CountDeprecation(Loader(), feature);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment