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

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

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/html/ImageData.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp
index e5d82fa02146d541587d866732880f817ac3b51d..7f7d207fce0c03b79d451e71fb477be64faf5ffe 100644
--- a/third_party/WebKit/Source/core/html/ImageData.cpp
+++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -46,14 +46,14 @@
if (!dataSize.IsValid() || dataSize.ValueOrDie() < 0)
return nullptr;
- DOMUint8ClampedArray* byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
+ RefPtr<DOMUint8ClampedArray> byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
if (!byteArray)
return nullptr;
- return new ImageData(size, byteArray);
+ return new ImageData(size, byteArray.release());
}
-ImageData* ImageData::create(const IntSize& size, DOMUint8ClampedArray* byteArray)
+ImageData* ImageData::create(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray)
{
CheckedNumeric<int> dataSize = 4;
dataSize *= size.width();
@@ -85,13 +85,13 @@
return nullptr;
}
- DOMUint8ClampedArray* byteArray = DOMUint8ClampedArray::createOrNull(dataSize.ValueOrDie());
+ RefPtr<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);
+ return new ImageData(IntSize(width, height), byteArray.release());
}
bool ImageData::validateConstructorArguments(DOMUint8ClampedArray* data, unsigned width, unsigned& lengthInPixels, ExceptionState& exceptionState)
@@ -174,7 +174,7 @@
return wrapper;
}
-ImageData::ImageData(const IntSize& size, DOMUint8ClampedArray* byteArray)
+ImageData::ImageData(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray)
: m_size(size)
, m_data(byteArray)
{
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageData.h ('k') | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698