Index: Source/core/html/ImageData.cpp |
diff --git a/Source/core/html/ImageData.cpp b/Source/core/html/ImageData.cpp |
index 45de50a575022064f03582ba98d8c658bb9f848b..66b62ffe04950d7400cb242a80871f4918dcdb2a 100644 |
--- a/Source/core/html/ImageData.cpp |
+++ b/Source/core/html/ImageData.cpp |
@@ -36,7 +36,7 @@ |
namespace blink { |
-PassRefPtrWillBeRawPtr<ImageData> ImageData::create(const IntSize& size) |
+ImageData* ImageData::create(const IntSize& size) |
{ |
Checked<int, RecordOverflow> dataSize = 4; |
dataSize *= size.width(); |
@@ -44,10 +44,10 @@ PassRefPtrWillBeRawPtr<ImageData> ImageData::create(const IntSize& size) |
if (dataSize.hasOverflowed()) |
return nullptr; |
- return adoptRefWillBeNoop(new ImageData(size)); |
+ return new ImageData(size); |
} |
-PassRefPtrWillBeRawPtr<ImageData> ImageData::create(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray) |
+ImageData* ImageData::create(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteArray) |
{ |
Checked<int, RecordOverflow> dataSize = 4; |
dataSize *= size.width(); |
@@ -59,10 +59,10 @@ PassRefPtrWillBeRawPtr<ImageData> ImageData::create(const IntSize& size, PassRef |
|| static_cast<unsigned>(dataSize.unsafeGet()) > byteArray->length()) |
return nullptr; |
- return adoptRefWillBeNoop(new ImageData(size, byteArray)); |
+ return new ImageData(size, byteArray); |
} |
-PassRefPtrWillBeRawPtr<ImageData> ImageData::create(unsigned width, unsigned height, ExceptionState& exceptionState) |
+ImageData* ImageData::create(unsigned width, unsigned height, ExceptionState& exceptionState) |
{ |
if (!RuntimeEnabledFeatures::imageDataConstructorEnabled()) { |
exceptionState.throwTypeError("Illegal constructor"); |
@@ -81,7 +81,7 @@ PassRefPtrWillBeRawPtr<ImageData> ImageData::create(unsigned width, unsigned hei |
return nullptr; |
} |
- return adoptRefWillBeNoop(new ImageData(IntSize(width, height))); |
+ return new ImageData(IntSize(width, height)); |
} |
bool ImageData::validateConstructorArguments(DOMUint8ClampedArray* data, unsigned width, unsigned& lengthInPixels, ExceptionState& exceptionState) |
@@ -109,7 +109,7 @@ bool ImageData::validateConstructorArguments(DOMUint8ClampedArray* data, unsigne |
return true; |
} |
-PassRefPtrWillBeRawPtr<ImageData> ImageData::create(DOMUint8ClampedArray* data, unsigned width, ExceptionState& exceptionState) |
+ImageData* ImageData::create(DOMUint8ClampedArray* data, unsigned width, ExceptionState& exceptionState) |
{ |
if (!RuntimeEnabledFeatures::imageDataConstructorEnabled()) { |
exceptionState.throwTypeError("Illegal constructor"); |
@@ -122,10 +122,10 @@ PassRefPtrWillBeRawPtr<ImageData> ImageData::create(DOMUint8ClampedArray* data, |
} |
ASSERT(lengthInPixels && width); |
unsigned height = lengthInPixels / width; |
- return adoptRefWillBeNoop(new ImageData(IntSize(width, height), data)); |
+ return new ImageData(IntSize(width, height), data); |
} |
-PassRefPtrWillBeRawPtr<ImageData> ImageData::create(DOMUint8ClampedArray* data, unsigned width, unsigned height, ExceptionState& exceptionState) |
+ImageData* ImageData::create(DOMUint8ClampedArray* data, unsigned width, unsigned height, ExceptionState& exceptionState) |
{ |
if (!RuntimeEnabledFeatures::imageDataConstructorEnabled()) { |
exceptionState.throwTypeError("Illegal constructor"); |
@@ -141,7 +141,7 @@ PassRefPtrWillBeRawPtr<ImageData> ImageData::create(DOMUint8ClampedArray* data, |
exceptionState.throwDOMException(IndexSizeError, "The input data byte length is not equal to (4 * width * height)."); |
return nullptr; |
} |
- return adoptRefWillBeNoop(new ImageData(IntSize(width, height), data)); |
+ return new ImageData(IntSize(width, height), data); |
} |
v8::Local<v8::Object> ImageData::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper) |
@@ -172,4 +172,9 @@ ImageData::ImageData(const IntSize& size, PassRefPtr<DOMUint8ClampedArray> byteA |
ASSERT_WITH_SECURITY_IMPLICATION(static_cast<unsigned>(size.width() * size.height() * 4) <= m_data->length()); |
} |
+void ImageData::dispose() |
+{ |
+ m_data.clear(); |
+} |
+ |
} // namespace blink |