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

Unified Diff: third_party/WebKit/Source/bindings/templates/methods.cpp

Issue 1940253002: Disallow certain blocking DOM calls during microtask execution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/bindings/templates/methods.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp b/third_party/WebKit/Source/bindings/templates/methods.cpp
index 475263f8f2bfd5bded2e420df5aae86bc9376362..f3f60ea048be36c8c621a277fbf5fca944b636fa 100644
--- a/third_party/WebKit/Source/bindings/templates/methods.cpp
+++ b/third_party/WebKit/Source/bindings/templates/methods.cpp
@@ -410,6 +410,10 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
{% if method.deprecate_as and not overloads.deprecate_all_as %}
Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
{% endif %}
+ {% if method.not_during_microtasks %}
+ if (v8::MicrotasksScope::IsRunningMicrotasks(info.GetIsolate()))
+ return;
haraken 2016/05/03 12:10:50 As Elliott is suggesting in the bug, would it be b
+ {% endif %}
{{method.name}}{{method.overload_index}}Method{{world_suffix}}(info);
return;
}
@@ -496,6 +500,10 @@ static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
{% if method.origin_trial_enabled_function %}
{{check_origin_trial(method) | indent}}
{% endif %}
+ {% if method.not_during_microtasks %}
+ if (v8::MicrotasksScope::IsRunningMicrotasks(info.GetIsolate()))
+ return;
+ {% endif %}
{% endif %}{# not method.overloads #}
{% if world_suffix in method.activity_logging_world_list %}
ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentContext());

Powered by Google App Engine
This is Rietveld 408576698