Commit a0bd88d5 authored by Mike West's avatar Mike West Committed by Commit Bot

Count instances of `javascript:` URL execution.

We're currently measuring whether or not a document is replaced by
the execution of a JavaScript URL (e.g. if the JavaScript resulted
in a string during navigation, in which case we navigate to a doc
whose body is that string). We should figure out how many pageviews
rely on `javascript:` execution generally, as that's going to be a
larger number.

R=andypaicu@chromium.org

Change-Id: I474ed7a5072f99e90ddab56351fbc8e5fe327909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1698529
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Auto-Submit: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676854}
parent 8ac17e9e
...@@ -2341,6 +2341,7 @@ enum WebFeature { ...@@ -2341,6 +2341,7 @@ enum WebFeature {
kDiscardInputEventToMovingIframe = 2952, kDiscardInputEventToMovingIframe = 2952,
kSignedExchangeSubresourcePrefetch = 2953, kSignedExchangeSubresourcePrefetch = 2953,
kBasicCardType = 2954, kBasicCardType = 2954,
kExecutedJavaScriptURL = 2955,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -273,6 +273,8 @@ void ScriptController::ExecuteJavaScriptURL( ...@@ -273,6 +273,8 @@ void ScriptController::ExecuteJavaScriptURL(
ScriptSourceCode(script_source, ScriptSourceLocationType::kJavascriptUrl), ScriptSourceCode(script_source, ScriptSourceLocationType::kJavascriptUrl),
base_url, SanitizeScriptErrors::kDoNotSanitize, ScriptFetchOptions(), base_url, SanitizeScriptErrors::kDoNotSanitize, ScriptFetchOptions(),
kDoNotExecuteScriptWhenScriptsDisabled); kDoNotExecuteScriptWhenScriptsDisabled);
UseCounter::Count(*GetFrame()->GetDocument(),
WebFeature::kExecutedJavaScriptURL);
// If executing script caused this frame to be removed from the page, we // If executing script caused this frame to be removed from the page, we
// don't want to try to replace its document! // don't want to try to replace its document!
......
...@@ -23857,6 +23857,7 @@ Called by update_net_error_codes.py.--> ...@@ -23857,6 +23857,7 @@ Called by update_net_error_codes.py.-->
<int value="2952" label="DiscardInputEventToMovingIframe"/> <int value="2952" label="DiscardInputEventToMovingIframe"/>
<int value="2953" label="SignedExchangeSubresourcePrefetch"/> <int value="2953" label="SignedExchangeSubresourcePrefetch"/>
<int value="2954" label="BasicCardType"/> <int value="2954" label="BasicCardType"/>
<int value="2955" label="ExecutedJavaScriptURL"/>
</enum> </enum>
<enum name="FeaturePolicyAllowlistType"> <enum name="FeaturePolicyAllowlistType">
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