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

Unified Diff: third_party/WebKit/Source/core/html/ImageData.cpp

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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/html/ImageData.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp
index 7f7d207fce0c03b79d451e71fb477be64faf5ffe..e5d82fa02146d541587d866732880f817ac3b51d 100644
--- a/third_party/WebKit/Source/core/html/ImageData.cpp
+++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -46,14 +46,14 @@ ImageData* ImageData::create(const IntSize& size)
if (!dataSize.IsValid() || dataSize.ValueOrDie() < 0)
return nullptr;
- RefPtr<DOMUint8ClampedArray> byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
+ DOMUint8ClampedArray* byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
if (!byteArray)
return nullptr;
- return new ImageData(size, byteArray.release());
+ return new ImageData(size, byteArray);
}
-ImageData* ImageData::create(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray)
+ImageData* ImageData::create(const IntSize& size, DOMUint8ClampedArray* byteArray)
{
CheckedNumeric<int> dataSize = 4;
dataSize *= size.width();
@@ -85,13 +85,13 @@ ImageData* ImageData::create(unsigned width, unsigned height, ExceptionState& ex
return nullptr;
}
- RefPtr<DOMUint8ClampedArray> byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
+ DOMUint8ClampedArray* byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
if (!byteArray) {
exceptionState.throwDOMException(V8GeneralError, "Out of memory at ImageData creation");
return nullptr;
}
- return new ImageData(IntSize(width, height), byteArray.release());
+ return new ImageData(IntSize(width, height), byteArray);
}
bool ImageData::validateConstructorArguments(DOMUint8ClampedArray* data, unsigned width, unsigned& lengthInPixels, ExceptionState& exceptionState)
@@ -174,7 +174,7 @@ v8::Local<v8::Object> ImageData::associateWithWrapper(v8::Isolate* isolate, cons
return wrapper;
}
-ImageData::ImageData(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray)
+ImageData::ImageData(const IntSize& size, DOMUint8ClampedArray* byteArray)
: m_size(size)
, m_data(byteArray)
{

Powered by Google App Engine
This is Rietveld 408576698