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

Unified Diff: third_party/WebKit/Source/core/dom/DOMTypedArray.h

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/core/dom/DOMTypedArray.h
diff --git a/third_party/WebKit/Source/core/dom/DOMTypedArray.h b/third_party/WebKit/Source/core/dom/DOMTypedArray.h
index e93bac1c8c39ff70b0895b0f9ca0ba390a358aa9..e8ea244f2d0bf12225cd317cbcf36dd025915ecb 100644
--- a/third_party/WebKit/Source/core/dom/DOMTypedArray.h
+++ b/third_party/WebKit/Source/core/dom/DOMTypedArray.h
@@ -29,29 +29,30 @@
public:
typedef typename WTFTypedArray::ValueType ValueType;
- static ThisType* create(PassRefPtr<WTFTypedArray> bufferView)
+ static PassRefPtr<ThisType> create(PassRefPtr<WTFTypedArray> bufferView)
{
- return new ThisType(bufferView);
+ return adoptRef(new ThisType(bufferView));
}
- static ThisType* create(unsigned length)
+ static PassRefPtr<ThisType> create(unsigned length)
{
return create(WTFTypedArray::create(length));
}
- static ThisType* create(const ValueType* array, unsigned length)
+ static PassRefPtr<ThisType> create(const ValueType* array, unsigned length)
{
return create(WTFTypedArray::create(array, length));
}
- static ThisType* create(PassRefPtr<WTF::ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
+ static PassRefPtr<ThisType> create(PassRefPtr<WTF::ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
{
return create(WTFTypedArray::create(buffer, byteOffset, length));
}
- static ThisType* create(DOMArrayBufferBase *buffer, unsigned byteOffset, unsigned length)
+ static PassRefPtr<ThisType> create(PassRefPtr<DOMArrayBufferBase> prpBuffer, unsigned byteOffset, unsigned length)
{
+ RefPtr<DOMArrayBufferBase> buffer = prpBuffer;
RefPtr<WTFTypedArray> bufferView = WTFTypedArray::create(buffer->buffer(), byteOffset, length);
- return new ThisType(bufferView.release(), buffer);
+ return adoptRef(new ThisType(bufferView.release(), buffer.release()));
}
- static ThisType* createOrNull(unsigned length)
+ static PassRefPtr<ThisType> createOrNull(unsigned length)
{
RefPtr<WTF::ArrayBuffer> buffer = WTF::ArrayBuffer::createOrNull(length, 1);
return buffer ? create(buffer.release(), 0, length) : nullptr;
@@ -71,7 +72,7 @@
private:
explicit DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView)
: DOMArrayBufferView(bufferView) { }
- DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, DOMArrayBufferBase* domArrayBuffer)
+ DOMTypedArray(PassRefPtr<WTFTypedArray> bufferView, PassRefPtr<DOMArrayBufferBase> domArrayBuffer)
: DOMArrayBufferView(bufferView, domArrayBuffer) { }
};
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMSharedArrayBuffer.cpp ('k') | third_party/WebKit/Source/core/dom/DOMTypedArray.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698