Chromium Code Reviews| Index: Source/core/dom/DOMSharedArrayBuffer.cpp |
| diff --git a/Source/core/dom/DOMArrayBuffer.cpp b/Source/core/dom/DOMSharedArrayBuffer.cpp |
| similarity index 70% |
| copy from Source/core/dom/DOMArrayBuffer.cpp |
| copy to Source/core/dom/DOMSharedArrayBuffer.cpp |
| index 41fdae243981748fd6fc8390497f5bd824fe493a..231ecee5ad022f27dbefa3160e3f0baec7eb775e 100644 |
| --- a/Source/core/dom/DOMArrayBuffer.cpp |
| +++ b/Source/core/dom/DOMSharedArrayBuffer.cpp |
| @@ -3,7 +3,7 @@ |
| // found in the LICENSE file. |
| #include "config.h" |
| -#include "core/dom/DOMArrayBuffer.h" |
| +#include "core/dom/DOMSharedArrayBuffer.h" |
| #include "bindings/core/v8/DOMDataStore.h" |
| #include "bindings/core/v8/V8DOMWrapper.h" |
| @@ -11,28 +11,29 @@ |
| namespace blink { |
| -v8::Local<v8::Object> DOMArrayBuffer::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext) |
| +v8::Handle<v8::Object> DOMSharedArrayBuffer::wrap(v8::Isolate* isolate, v8::Handle<v8::Object> creationContext) |
|
Yuki
2015/06/09 06:18:07
v8::Handle is obsolete. Please use v8::Local.
binji
2015/06/10 06:04:38
Done.
|
| { |
| // 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<DOMArrayBuffer> protect(this); |
| + RefPtr<DOMSharedArrayBuffer> protect(this); |
| ASSERT(!DOMDataStore::containsWrapper(this, isolate)); |
| const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); |
| - v8::Local<v8::Object> wrapper = v8::ArrayBuffer::New(isolate, data(), byteLength()); |
| + v8::Handle<v8::Object> wrapper = v8::SharedArrayBuffer::New(isolate, data(), byteLength()); |
| // Only when we create a new wrapper, let V8 know that we allocated and |
| // associated a new memory block with the wrapper. Note that |
| // setDeallocationObserver implicitly calls |
| // DOMArrayBufferDeallocationObserver::blinkAllocatedMemory. |
| + // TODO(binji): Should this be a different observer? Perhaps we want to track shared memory separately. |
| buffer()->setDeallocationObserver(DOMArrayBufferDeallocationObserver::instance()); |
| return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); |
| } |
| -v8::Local<v8::Object> DOMArrayBuffer::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper) |
| +v8::Handle<v8::Object> DOMSharedArrayBuffer::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Handle<v8::Object> wrapper) |
| { |
| // This function does not set a deallocation observer to the underlying |
| // array buffer. It's a caller's duty. |