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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 931543002: Disallow wrapper creation from visitDOMWrapper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comment Created 5 years, 10 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 | « no previous file | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 5da47a89b6533626e3f90a0aa2fd535dfe2c64cc..abfc05c5d0cda070179c34b26a1cb357136f0384 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -596,8 +596,9 @@ void {{v8_class}}::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* script
{% for set_wrapper_reference_to in set_wrapper_reference_to_list %}
{{set_wrapper_reference_to.cpp_type}} {{set_wrapper_reference_to.name}} = impl->{{set_wrapper_reference_to.name}}();
if ({{set_wrapper_reference_to.name}}) {
- if (!DOMDataStore::containsWrapper({{set_wrapper_reference_to.name}}, isolate))
- {{set_wrapper_reference_to.name}}->wrap(creationContext, isolate);
+ {# The target wrapper for SetWrapperReferenceTo must be created before entering V8 GC.
+ Lazily creating a wrapper here may lead to execution of user javascript during GC. #}
+ RELEASE_ASSERT(DOMDataStore::containsWrapper({{set_wrapper_reference_to.name}}, isolate));
DOMDataStore::setWrapperReference(wrapper, {{set_wrapper_reference_to.name}}, isolate);
}
{% endfor %}
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698