Chromium Code Reviews| Index: Source/bindings/core/v8/V8Binding.cpp |
| diff --git a/Source/bindings/core/v8/V8Binding.cpp b/Source/bindings/core/v8/V8Binding.cpp |
| index 4673a2dde2921d9c01937d14adc5f711d3263502..e2846065b1f7bb78711da41431f5ac6dc8967431 100644 |
| --- a/Source/bindings/core/v8/V8Binding.cpp |
| +++ b/Source/bindings/core/v8/V8Binding.cpp |
| @@ -33,6 +33,7 @@ |
| #include "bindings/core/v8/ScriptController.h" |
| #include "bindings/core/v8/V8AbstractEventListener.h" |
| +#include "bindings/core/v8/V8ArrayBufferView.h" |
| #include "bindings/core/v8/V8BindingMacros.h" |
| #include "bindings/core/v8/V8Element.h" |
| #include "bindings/core/v8/V8EventTarget.h" |
| @@ -47,6 +48,7 @@ |
| #include "bindings/core/v8/custom/V8CustomXPathNSResolver.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/Element.h" |
| +#include "core/dom/FlexibleArrayBufferView.h" |
| #include "core/dom/NodeFilter.h" |
| #include "core/dom/QualifiedName.h" |
| #include "core/frame/LocalDOMWindow.h" |
| @@ -756,6 +758,20 @@ EventTarget* toEventTarget(v8::Isolate* isolate, v8::Local<v8::Value> value) |
| return 0; |
| } |
| +void toFlexibleArrayBufferView(v8::Isolate* isolate, v8::Handle<v8::Value> value, FlexibleArrayBufferView& result, void* storage) |
| +{ |
| + if (!value->IsArrayBufferView()) |
|
haraken
2015/07/30 20:34:43
Is this a valid situation? If not, we can change t
Michael Lippautz
2015/07/31 07:53:38
As far as I see, it should always be an ArrayBuffe
|
| + return; |
| + v8::Local<v8::ArrayBufferView> buffer = value.As<v8::ArrayBufferView>(); |
| + if (!storage) { |
| + result.setFull(V8ArrayBufferView::toImpl(buffer)); |
| + return; |
| + } |
| + size_t length = buffer->ByteLength(); |
| + buffer->CopyContents(storage, length); |
| + result.setSmall(storage, length); |
| +} |
| + |
| v8::Local<v8::Context> toV8Context(ExecutionContext* context, DOMWrapperWorld& world) |
| { |
| ASSERT(context); |