Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
haraken
2015/07/01 00:16:08
2015
binji
2015/07/01 16:25:51
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "core/dom/DOMSharedArrayBuffer.h" | |
| 7 | |
| 8 #include "bindings/core/v8/DOMDataStore.h" | |
| 9 #include "bindings/core/v8/V8DOMWrapper.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 v8::Local<v8::Object> DOMSharedArrayBuffer::wrap(v8::Isolate* isolate, v8::Local <v8::Object> creationContext) | |
| 14 { | |
| 15 // It's possible that no one except for the new wrapper owns this object at | |
| 16 // this moment, so we have to prevent GC to collect this object until the | |
| 17 // object gets associated with the wrapper. | |
| 18 RefPtr<DOMSharedArrayBuffer> protect(this); | |
| 19 | |
| 20 ASSERT(!DOMDataStore::containsWrapper(this, isolate)); | |
| 21 | |
| 22 const WrapperTypeInfo* wrapperTypeInfo = this->wrapperTypeInfo(); | |
| 23 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.
| |
| 24 | |
| 25 return associateWithWrapper(isolate, wrapperTypeInfo, wrapper); | |
| 26 } | |
| 27 | |
| 28 v8::Local<v8::Object> DOMSharedArrayBuffer::associateWithWrapper(v8::Isolate* is olate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper) | |
| 29 { | |
| 30 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTypeIn fo, wrapper); | |
| 31 } | |
| 32 | |
| 33 } // namespace blink | |
| OLD | NEW |