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

Unified Diff: Source/bindings/core/v8/V8Binding.cpp

Issue 1269443002: Introduce FlexibleArrayBufferView and TypedFlexibleArrayBufferView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo 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
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingMacros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f6b34809a196c87b5a0190104e0a72dc27d0c850 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,19 @@ EventTarget* toEventTarget(v8::Isolate* isolate, v8::Local<v8::Value> value)
return 0;
}
+void toFlexibleArrayBufferView(v8::Isolate* isolate, v8::Local<v8::Value> value, FlexibleArrayBufferView& result, void* storage)
+{
+ ASSERT(value->IsArrayBufferView());
+ 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);
« no previous file with comments | « Source/bindings/core/v8/V8Binding.h ('k') | Source/bindings/core/v8/V8BindingMacros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698