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

Unified Diff: Source/core/dom/Node.cpp

Issue 1210083004: bindings: Supports reentrance to ScriptWrappable::wrap through V8DOMWrapper::createWrapper. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index c1a6aae93108c806125dc9b2725e7b48ed6e6b92..2b4c35fdb3ccd87f6eaeee36acc75a313bec8941 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -2425,6 +2425,12 @@ v8::Local<v8::Object> Node::wrap(v8::Isolate* isolate, v8::Local<v8::Object> cre
const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
v8::Local<v8::Object> wrapper = V8DOMWrapper::createWrapper(isolate, creationContext, wrapperType, this);
+ // V8DOMWrapper::createWrapper may run an arbitrary script and it may result
+ // in creating a new wrapper and associating it with |this|. If so, the
+ // wrapper already created and associated must be used.
+ v8::Local<v8::Object> associatedWrapper = DOMDataStore::getWrapper(this, isolate);
+ if (UNLIKELY(!associatedWrapper.IsEmpty()))
+ return associatedWrapper;
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698