| 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 81b839e5862974baf9cb0b5b6aac647a29e9b3a4..cdb8907ab5c828b0ee1f9d5c1a0e2da54f694e34 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
|
| @@ -47,6 +47,7 @@
|
| #include "bindings/core/v8/V8ThrowException.h"
|
| #include "bindings/core/v8/V8ValueCache.h"
|
| #include "core/CoreExport.h"
|
| +#include "core/dom/NotShared.h"
|
| #include "platform/heap/Handle.h"
|
| #include "v8/include/v8.h"
|
| #include "wtf/text/AtomicString.h"
|
| @@ -1152,6 +1153,23 @@ CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>,
|
| CORE_EXPORT v8::Local<v8::Value> fromJSONString(v8::Isolate*,
|
| const String& stringifiedJSON,
|
| ExceptionState&);
|
| +
|
| +// TODO(binji) : document
|
| +template <typename NotSharedType>
|
| +CORE_EXPORT NotSharedType toNotShared(v8::Isolate* isolate,
|
| + v8::Local<v8::Value> value,
|
| + ExceptionState& exceptionState) {
|
| + using DOMTypedArray = typename NotSharedType::TypedArrayType;
|
| + DOMTypedArray* domTypedArray =
|
| + V8TypeOf<DOMTypedArray>::Type::toImplWithTypeCheck(isolate, value);
|
| + if (domTypedArray->isShared()) {
|
| + exceptionState.throwTypeError(
|
| + "The provided ArrayBufferView value must not be shared.");
|
| + return NotSharedType();
|
| + }
|
| + return NotSharedType(domTypedArray);
|
| +}
|
| +
|
| } // namespace blink
|
|
|
| #endif // V8Binding_h
|
|
|