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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/core/dom/DOMSharedArrayBuffer.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.cpp b/third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.cpp
index 91167426ddcee50e5198ee93d4960e0d66c4ba56..a60258c4b01ecb9baa47290b11e979d90a1b1666 100644
--- a/third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.cpp
@@ -10,6 +10,11 @@
v8::Local<v8::Object> DOMSharedArrayBuffer::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext)
{
+ // It's possible that no one except for the new wrapper owns this object at
+ // this moment, so we have to prevent GC to collect this object until the
+ // object gets associated with the wrapper.
+ RefPtr<DOMSharedArrayBuffer> protect(this);
+
DCHECK(!DOMDataStore::containsWrapper(this, isolate));
const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo();
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.h ('k') | third_party/WebKit/Source/core/dom/DOMTypedArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698