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

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

Issue 1179373004: Add DOMSharedArrayBuffer type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: merge master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DOMSharedArrayBuffer.h ('k') | Source/core/dom/DOMTypedArray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMSharedArrayBuffer.cpp
diff --git a/Source/core/dom/DOMArrayBuffer.cpp b/Source/core/dom/DOMSharedArrayBuffer.cpp
similarity index 60%
copy from Source/core/dom/DOMArrayBuffer.cpp
copy to Source/core/dom/DOMSharedArrayBuffer.cpp
index c0ee1e5143bad2f4ce4317604979f0cc9019e613..4655184c9a3fb99d10a49aba0f43edb2f340ef66 100644
--- a/Source/core/dom/DOMArrayBuffer.cpp
+++ b/Source/core/dom/DOMSharedArrayBuffer.cpp
@@ -1,27 +1,27 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors. All rights reserved.
// 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/DOMArrayBuffer.h"
+#include "core/dom/DOMSharedArrayBuffer.h"
#include "bindings/core/v8/DOMDataStore.h"
#include "bindings/core/v8/V8DOMWrapper.h"
namespace blink {
-v8::Local<v8::Object> DOMArrayBuffer::wrap(v8::Isolate* isolate, v8::Local<v8::Object> creationContext)
+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<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::ArrayBuffer::New may run an arbitrary script and it may result in
+ v8::Local<v8::Object> wrapper = v8::SharedArrayBuffer::New(isolate, data(), byteLength());
+ // V8::SharedArrayBuffer::New may run an arbitrary script and it may result in
// creating a new wrapper and associating it with |this|. If so, the
// wrapper already created and associated must be used.
v8::Local<v8::Object> associatedWrapper = DOMDataStore::getWrapper(this, isolate);
@@ -31,11 +31,8 @@ v8::Local<v8::Object> DOMArrayBuffer::wrap(v8::Isolate* isolate, v8::Local<v8::O
return associateWithWrapper(isolate, wrapperTypeInfo, wrapper);
}
-v8::Local<v8::Object> DOMArrayBuffer::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper)
+v8::Local<v8::Object> DOMSharedArrayBuffer::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperTypeInfo, v8::Local<v8::Object> wrapper)
{
- // This function does not set a deallocation observer to the underlying
- // array buffer. It's a caller's duty.
-
return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperTypeInfo, wrapper);
}
« 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