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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.h

Issue 2815793002: [SharedArrayBuffer] Add "AllowShared" extended attribute, used for WebGL (Closed)
Patch Set: merge HEAD 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/bindings/core/v8/V8Binding.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
index f783f6ab25da629154318713a47ad392a43c46bb..de21d8018ca5ea60255b34039618be8ef50e1240 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -47,7 +47,7 @@
#include "bindings/core/v8/V8ThrowException.h"
#include "bindings/core/v8/V8ValueCache.h"
#include "core/CoreExport.h"
-#include "core/dom/NotShared.h"
+#include "core/dom/ArrayBufferViewHelpers.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/text/AtomicString.h"
#include "platform/wtf/text/StringView.h"
@@ -1121,6 +1121,18 @@ NotSharedType ToNotShared(v8::Isolate* isolate,
return NotSharedType(dom_typed_array);
}
+// Wrap a typed array value in MaybeShared<>, to signify that it may be backed
+// by a SharedArrayBuffer.
+template <typename MaybeSharedType>
+MaybeSharedType ToMaybeShared(v8::Isolate* isolate,
+ v8::Local<v8::Value> value,
+ ExceptionState& exception_state) {
+ using DOMTypedArray = typename MaybeSharedType::TypedArrayType;
+ DOMTypedArray* dom_typed_array =
+ V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value);
+ return MaybeSharedType(dom_typed_array);
+}
+
} // namespace blink
#endif // V8Binding_h
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8ForCore.h ('k') | third_party/WebKit/Source/bindings/scripts/v8_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698