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

Side by Side Diff: Source/core/dom/DOMSharedArrayBuffer.cpp

Issue 1179373004: Add DOMSharedArrayBuffer type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: . Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/DOMSharedArrayBuffer.h ('k') | Source/core/dom/DOMTypedArray.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « Source/core/dom/DOMSharedArrayBuffer.h ('k') | Source/core/dom/DOMTypedArray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698