Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: third_party/WebKit/Source/core/dom/ModulatorImpl.cpp

Issue 2843873002: Insert CHECK()s to ensure module-related code are not executed without the flag (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
diff --git a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
index bc3ae8e24cccebd3e96c750cdc1d05a845ab0716..e5fb1fae307ede3751cffe7f20d2cd204a5768b1 100644
--- a/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
+++ b/third_party/WebKit/Source/core/dom/ModulatorImpl.cpp
@@ -77,12 +77,20 @@ void ModulatorImpl::FetchTreeInternal(const ModuleScriptFetchRequest& request,
const AncestorList& ancestor_list,
ModuleGraphLevel level,
ModuleTreeClient* client) {
+ // We ensure module-related code is not executed without the flag.
+ // https://crbug.com/715376
+ CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled());
+
tree_linker_registry_->Fetch(request, ancestor_list, level, this, client);
}
void ModulatorImpl::FetchSingle(const ModuleScriptFetchRequest& request,
ModuleGraphLevel level,
SingleModuleClient* client) {
+ // We ensure module-related code is not executed without the flag.
+ // https://crbug.com/715376
+ CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled());
+
map_->FetchSingleModuleScript(request, level, client);
}
@@ -90,6 +98,10 @@ void ModulatorImpl::FetchNewSingleModule(
const ModuleScriptFetchRequest& request,
ModuleGraphLevel level,
ModuleScriptLoaderClient* client) {
+ // We ensure module-related code is not executed without the flag.
+ // https://crbug.com/715376
+ CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled());
+
loader_registry_->Fetch(request, level, this, fetcher_.Get(), client);
}
@@ -141,6 +153,10 @@ inline ExecutionContext* ModulatorImpl::GetExecutionContext() const {
void ModulatorImpl::ExecuteModule(const ModuleScript* module_script) {
// https://html.spec.whatwg.org/#run-a-module-script
+ // We ensure module-related code is not executed without the flag.
+ // https://crbug.com/715376
+ CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled());
+
// 1. "Let settings be the settings object of s."
// The settings object is |this|.
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698