Index: Source/core/dom/DOMSharedArrayBuffer.cpp |
diff --git a/Source/core/dom/DOMSharedArrayBuffer.cpp b/Source/core/dom/DOMSharedArrayBuffer.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..95c6366ee308ee6ab397110b3866122c16a2783f |
--- /dev/null |
+++ b/Source/core/dom/DOMSharedArrayBuffer.cpp |
@@ -0,0 +1,33 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
haraken
2015/07/01 00:16:08
2015
binji
2015/07/01 16:25:51
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/dom/DOMSharedArrayBuffer.h" |
+ |
+#include "bindings/core/v8/DOMDataStore.h" |
+#include "bindings/core/v8/V8DOMWrapper.h" |
+ |
+namespace blink { |
+ |
+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); |
+ |
+ ASSERT(!DOMDataStore::containsWrapper(this, isolate)); |
+ |
+ const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); |
+ v8::Local<v8::Object> wrapper = v8::SharedArrayBuffer::New(isolate, data(), byteLength()); |
haraken
2015/07/01 00:16:09
We added more code here yesterday. See DOMArrayBuf
binji
2015/07/01 16:25:51
Done.
|
+ |
+ return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); |
+} |
+ |
+v8::Local<v8::Object> DOMSharedArrayBuffer::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper) |
+{ |
+ return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTypeInfo, wrapper); |
+} |
+ |
+} // namespace blink |