| Index: third_party/WebKit/Source/core/html/Float32ImageData.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/Float32ImageData.cpp b/third_party/WebKit/Source/core/html/Float32ImageData.cpp
|
| index 544e19e4294561c9f4e9aa83dd26554b8a983d8b..b85ccc4a8efd771cc5c3ac04f014d6ee97af3f84 100644
|
| --- a/third_party/WebKit/Source/core/html/Float32ImageData.cpp
|
| +++ b/third_party/WebKit/Source/core/html/Float32ImageData.cpp
|
| @@ -52,12 +52,16 @@ Float32ImageData* Float32ImageData::create(const IntSize& size) {
|
| return dataArray ? new Float32ImageData(size, dataArray) : nullptr;
|
| }
|
|
|
| -Float32ImageData* Float32ImageData::create(const IntSize& size,
|
| - DOMFloat32Array* dataArray) {
|
| +Float32ImageData* Float32ImageData::create(
|
| + const IntSize& size,
|
| + const MaybeShared<DOMFloat32Array>& maybeShared) {
|
| + if (!ImageData::validateDataArgumentIsNotShared(maybeShared, nullptr))
|
| + return nullptr;
|
| + DOMFloat32Array* data = maybeShared.viewNotShared();
|
| if (!Float32ImageData::validateConstructorArguments(kParamSize | kParamData,
|
| - &size, 0, 0, dataArray))
|
| + &size, 0, 0, data))
|
| return nullptr;
|
| - return new Float32ImageData(size, dataArray);
|
| + return new Float32ImageData(size, data);
|
| }
|
|
|
| Float32ImageData* Float32ImageData::create(unsigned width,
|
| @@ -74,9 +78,13 @@ Float32ImageData* Float32ImageData::create(unsigned width,
|
| : nullptr;
|
| }
|
|
|
| -Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| - unsigned width,
|
| - ExceptionState& exceptionState) {
|
| +Float32ImageData* Float32ImageData::create(
|
| + const MaybeShared<DOMFloat32Array>& maybeShared,
|
| + unsigned width,
|
| + ExceptionState& exceptionState) {
|
| + if (!ImageData::validateDataArgumentIsNotShared(maybeShared, &exceptionState))
|
| + return nullptr;
|
| + DOMFloat32Array* data = maybeShared.viewNotShared();
|
| if (!Float32ImageData::validateConstructorArguments(kParamData | kParamWidth,
|
| nullptr, width, 0, data,
|
| nullptr, &exceptionState))
|
| @@ -85,10 +93,14 @@ Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| return new Float32ImageData(IntSize(width, height), data);
|
| }
|
|
|
| -Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| - unsigned width,
|
| - unsigned height,
|
| - ExceptionState& exceptionState) {
|
| +Float32ImageData* Float32ImageData::create(
|
| + const MaybeShared<DOMFloat32Array>& maybeShared,
|
| + unsigned width,
|
| + unsigned height,
|
| + ExceptionState& exceptionState) {
|
| + if (!ImageData::validateDataArgumentIsNotShared(maybeShared, nullptr))
|
| + return nullptr;
|
| + DOMFloat32Array* data = maybeShared.viewNotShared();
|
| if (!Float32ImageData::validateConstructorArguments(
|
| kParamData | kParamWidth | kParamHeight, nullptr, width, height, data,
|
| nullptr, &exceptionState))
|
| @@ -113,10 +125,14 @@ Float32ImageData* Float32ImageData::create(unsigned width,
|
| : nullptr;
|
| }
|
|
|
| -Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| - unsigned width,
|
| - String colorSpace,
|
| - ExceptionState& exceptionState) {
|
| +Float32ImageData* Float32ImageData::create(
|
| + const MaybeShared<DOMFloat32Array>& maybeShared,
|
| + unsigned width,
|
| + String colorSpace,
|
| + ExceptionState& exceptionState) {
|
| + if (!ImageData::validateDataArgumentIsNotShared(maybeShared, nullptr))
|
| + return nullptr;
|
| + DOMFloat32Array* data = maybeShared.viewNotShared();
|
| if (!Float32ImageData::validateConstructorArguments(
|
| kParamData | kParamWidth | kParamColorSpace, nullptr, width, 0, data,
|
| &colorSpace, &exceptionState))
|
| @@ -125,11 +141,15 @@ Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| return new Float32ImageData(IntSize(width, height), data, colorSpace);
|
| }
|
|
|
| -Float32ImageData* Float32ImageData::create(DOMFloat32Array* data,
|
| - unsigned width,
|
| - unsigned height,
|
| - String colorSpace,
|
| - ExceptionState& exceptionState) {
|
| +Float32ImageData* Float32ImageData::create(
|
| + const MaybeShared<DOMFloat32Array>& maybeShared,
|
| + unsigned width,
|
| + unsigned height,
|
| + String colorSpace,
|
| + ExceptionState& exceptionState) {
|
| + if (!ImageData::validateDataArgumentIsNotShared(maybeShared, nullptr))
|
| + return nullptr;
|
| + DOMFloat32Array* data = maybeShared.viewNotShared();
|
| if (!Float32ImageData::validateConstructorArguments(
|
| kParamData | kParamWidth | kParamHeight | kParamColorSpace, nullptr,
|
| width, height, data, &colorSpace, &exceptionState))
|
|
|