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) { } |
}; |