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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.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
Index: third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
index a55e8ee4682f4add309b975597465936e72840b3..268e507d5f23f83edcc1a07fa8bf5b39805f423f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
@@ -36,7 +36,7 @@ ScriptPromise WebGLGetBufferSubDataAsync::getBufferSubDataAsync(
ScriptState* script_state,
GLenum target,
GLintptr src_byte_offset,
- DOMArrayBufferView* dst_data,
+ NotShared<DOMArrayBufferView> dst_data,
GLuint dst_offset,
GLuint length) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
@@ -61,8 +61,8 @@ ScriptPromise WebGLGetBufferSubDataAsync::getBufferSubDataAsync(
void* destination_data_ptr = nullptr;
long long destination_byte_length = 0;
const char* message = context->ValidateGetBufferSubData(
- __FUNCTION__, target, src_byte_offset, dst_data, dst_offset, length,
- &source_buffer, &destination_data_ptr, &destination_byte_length);
+ __FUNCTION__, target, src_byte_offset, dst_data.View(), dst_offset,
+ length, &source_buffer, &destination_data_ptr, &destination_byte_length);
if (message) {
// If there was a GL error, it was already synthesized in
// validateGetBufferSubData, so it's not done here.
@@ -83,7 +83,7 @@ ScriptPromise WebGLGetBufferSubDataAsync::getBufferSubDataAsync(
// If the length of the copy is zero, this is a no-op.
if (!destination_byte_length) {
- resolver->Resolve(dst_data);
+ resolver->Resolve(dst_data.View());
return promise;
}
@@ -101,8 +101,8 @@ ScriptPromise WebGLGetBufferSubDataAsync::getBufferSubDataAsync(
}
auto callback_object = new WebGLGetBufferSubDataAsyncCallback(
- context, resolver, mapped_data, query_id, dst_data, destination_data_ptr,
- destination_byte_length);
+ context, resolver, mapped_data, query_id, dst_data.View(),
+ destination_data_ptr, destination_byte_length);
context->RegisterGetBufferSubDataAsyncCallback(callback_object);
auto callback = WTF::Bind(&WebGLGetBufferSubDataAsyncCallback::Resolve,
WrapPersistent(callback_object));

Powered by Google App Engine
This is Rietveld 408576698