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

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

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageData.h ('k') | third_party/WebKit/Source/core/mojo/MojoHandle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91a16a09966187dfd1252198bfc0d9bac2aa5b42..b42e161b4dcd789ac903e81e86824386e446a959 100644
--- a/third_party/WebKit/Source/core/html/ImageData.cpp
+++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -229,12 +229,13 @@ ImageData* ImageData::Create(const IntSize& size,
}
ImageData* ImageData::Create(const IntSize& size,
- DOMArrayBufferView* data_array,
+ NotShared<DOMArrayBufferView> data_array,
const ImageDataColorSettings* color_settings) {
- if (!ImageData::ValidateConstructorArguments(
- kParamSize | kParamData, &size, 0, 0, data_array, color_settings))
+ if (!ImageData::ValidateConstructorArguments(kParamSize | kParamData, &size,
+ 0, 0, data_array.View(),
+ color_settings))
return nullptr;
- return new ImageData(size, data_array, color_settings);
+ return new ImageData(size, data_array.View(), color_settings);
}
ImageData* ImageData::Create(unsigned width,
@@ -251,28 +252,28 @@ ImageData* ImageData::Create(unsigned width,
: nullptr;
}
-ImageData* ImageData::Create(DOMUint8ClampedArray* data,
+ImageData* ImageData::Create(NotShared<DOMUint8ClampedArray> data,
unsigned width,
ExceptionState& exception_state) {
if (!ImageData::ValidateConstructorArguments(kParamData | kParamWidth,
- nullptr, width, 0, data, nullptr,
- &exception_state))
+ nullptr, width, 0, data.View(),
+ nullptr, &exception_state))
return nullptr;
- unsigned height = data->length() / (width * 4);
- return new ImageData(IntSize(width, height), data);
+ unsigned height = data.View()->length() / (width * 4);
+ return new ImageData(IntSize(width, height), data.View());
}
-ImageData* ImageData::Create(DOMUint8ClampedArray* data,
+ImageData* ImageData::Create(NotShared<DOMUint8ClampedArray> data,
unsigned width,
unsigned height,
ExceptionState& exception_state) {
if (!ImageData::ValidateConstructorArguments(
- kParamData | kParamWidth | kParamHeight, nullptr, width, height, data,
- nullptr, &exception_state))
+ kParamData | kParamWidth | kParamHeight, nullptr, width, height,
+ data.View(), nullptr, &exception_state))
return nullptr;
- return new ImageData(IntSize(width, height), data);
+ return new ImageData(IntSize(width, height), data.View());
}
ImageData* ImageData::createImageData(
@@ -308,13 +309,13 @@ ImageData* ImageData::createImageData(ImageDataArray& data,
String storage_format_name;
if (data.isUint8ClampedArray()) {
- buffer_view = data.getAsUint8ClampedArray();
+ buffer_view = data.getAsUint8ClampedArray().View();
storage_format_name = kUint8ClampedArrayStorageFormatName;
} else if (data.isUint16Array()) {
- buffer_view = data.getAsUint16Array();
+ buffer_view = data.getAsUint16Array().View();
storage_format_name = kUint16ArrayStorageFormatName;
} else if (data.isFloat32Array()) {
- buffer_view = data.getAsFloat32Array();
+ buffer_view = data.getAsFloat32Array().View();
storage_format_name = kFloat32ArrayStorageFormatName;
} else {
NOTREACHED();
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageData.h ('k') | third_party/WebKit/Source/core/mojo/MojoHandle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698