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