Chromium Code Reviews

Unified Diff: Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp

Issue 1097773004: Sharing of SharedArrayBuffer via PostMessage transfer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add worker global interface listing expectations Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
diff --git a/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp b/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
index 8364f8a1c737d8780de7e6d164064a18d1d6ee79..7100d0c9aaca26e1140b83a67f3733e8053899b7 100644
--- a/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
+++ b/Source/bindings/tests/results/core/V8Uint8ClampedArray.cpp
@@ -11,6 +11,7 @@
#include "bindings/core/v8/V8ArrayBuffer.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
+#include "bindings/core/v8/V8SharedArrayBuffer.h"
#include "core/dom/ContextFeatures.h"
#include "core/dom/Document.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -48,7 +49,15 @@ TestUint8ClampedArray* V8Uint8ClampedArray::toImpl(v8::Local<v8::Object> object)
return scriptWrappable->toImpl<TestUint8ClampedArray>();
v8::Local<v8::Uint8ClampedArray> v8View = object.As<v8::Uint8ClampedArray>();
- RefPtr<TestUint8ClampedArray> typedArray = TestUint8ClampedArray::create(V8ArrayBuffer::toImpl(v8View->Buffer()), v8View->ByteOffset(), v8View->Length());
+ v8::Local<v8::Object> arrayBuffer = v8View->Buffer();
+ RefPtr<TestUint8ClampedArray> typedArray;
+ if (arrayBuffer->IsArrayBuffer()) {
+ typedArray = TestUint8ClampedArray::create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->Length());
+ } else if (arrayBuffer->IsSharedArrayBuffer()) {
+ typedArray = TestUint8ClampedArray::create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->Length());
+ } else {
+ ASSERT_NOT_REACHED();
+ }
typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object);
return typedArray->toImpl<TestUint8ClampedArray>();

Powered by Google App Engine