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

Unified Diff: Source/core/dom/DOMDataView.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
Index: Source/core/dom/DOMDataView.cpp
diff --git a/Source/core/dom/DOMDataView.cpp b/Source/core/dom/DOMDataView.cpp
index 4398e8ce97c6a7c40db9de7c0ef8f36e84354e80..995d5fd00192fa1d40ebca680eb129dae918ce76 100644
--- a/Source/core/dom/DOMDataView.cpp
+++ b/Source/core/dom/DOMDataView.cpp
@@ -71,6 +71,12 @@ v8::Local<v8::Object> DOMDataView::wrap(v8::Isolate* isolate, v8::Local<v8::Obje
ASSERT(v8Buffer->IsArrayBuffer());
v8::Local<v8::Object> wrapper = v8::DataView::New(v8Buffer.As<v8::ArrayBuffer>(), byteOffset(), byteLength());
+ // V8::DataView::New 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;
return associateWithWrapper(isolate, wrapperTypeInfo, wrapper);
}

Powered by Google App Engine
This is Rietveld 408576698