Commit 8085fd3c authored by Kouhei Ueno's avatar Kouhei Ueno Committed by Commit Bot

[ES6 modules] Add UseCounter for preparing a module script

Bug: 594639
Change-Id: Iabb2f3780d21c0f896073e6cad6178deced61e83
Reviewed-on: https://chromium-review.googlesource.com/575797Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487432}
parent 96813a43
......@@ -45,6 +45,7 @@
#include "core/events/Event.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/SubresourceIntegrity.h"
#include "core/frame/UseCounter.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/imports/HTMLImport.h"
#include "core/html/parser/HTMLParserIdioms.h"
......@@ -357,6 +358,9 @@ bool ScriptLoader::PrepareScript(const TextPosition& script_start_position,
ParserDisposition parser_state =
IsParserInserted() ? kParserInserted : kNotParserInserted;
if (GetScriptType() == ScriptType::kModule)
UseCounter::Count(*context_document, WebFeature::kPrepareModuleScript);
// 21. "If the element has a src content attribute, run these substeps:"
if (element_->HasSourceAttribute()) {
// 21.1. Let src be the value of the element's src attribute.
......
......@@ -1597,6 +1597,7 @@ enum WebFeature {
kRequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe = 2059,
kMediaSourceKeyframeTimeGreaterThanDependant = 2060,
kMediaSourceMuxedSequenceMode = 2061,
kPrepareModuleScript = 2062,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -15898,6 +15898,7 @@ uploading your change for review. These are checked by presubmit scripts.
label="RequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe"/>
<int value="2060" label="MediaSourceKeyframeTimeGreaterThanDependant"/>
<int value="2061" label="MediaSourceMuxedSequenceMode"/>
<int value="2062" label="PrepareModuleScript"/>
</enum>
<enum name="FeedbackSource">
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