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

Unified Diff: Source/bindings/tests/results/core/V8DataView.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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8DataView.cpp
diff --git a/Source/bindings/tests/results/core/V8DataView.cpp b/Source/bindings/tests/results/core/V8DataView.cpp
index 067195365cadb3cd2cc7c1d27ae8111abbdc6f54..bda9ac7986eb6d1a2a15af4198e242c2093acbf4 100644
--- a/Source/bindings/tests/results/core/V8DataView.cpp
+++ b/Source/bindings/tests/results/core/V8DataView.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"
@@ -49,7 +50,15 @@ TestDataView* V8DataView::toImpl(v8::Local<v8::Object> object)
return scriptWrappable->toImpl<TestDataView>();
v8::Local<v8::DataView> v8View = object.As<v8::DataView>();
- RefPtr<TestDataView> typedArray = TestDataView::create(V8ArrayBuffer::toImpl(v8View->Buffer()), v8View->ByteOffset(), v8View->ByteLength());
+ v8::Local<v8::Object> arrayBuffer = v8View->Buffer();
+ RefPtr<TestDataView> typedArray;
+ if (arrayBuffer->IsArrayBuffer()) {
+ typedArray = TestDataView::create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->ByteLength());
+ } else if (arrayBuffer->IsSharedArrayBuffer()) {
+ typedArray = TestDataView::create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->ByteLength());
+ } else {
+ ASSERT_NOT_REACHED();
+ }
typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object);
return typedArray->toImpl<TestDataView>();

Powered by Google App Engine
This is Rietveld 408576698