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

Unified Diff: Source/bindings/core/v8/V8BindingMacros.h

Issue 1269443002: Introduce FlexibleArrayBufferView and TypedFlexibleArrayBufferView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments 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/core/v8/V8BindingMacros.h
diff --git a/Source/bindings/core/v8/V8BindingMacros.h b/Source/bindings/core/v8/V8BindingMacros.h
index 2377e9d0c1445e71a67a83ba53490c01fedf4887..e30c3f7598d1aeec6586294194802277b5198aad 100644
--- a/Source/bindings/core/v8/V8BindingMacros.h
+++ b/Source/bindings/core/v8/V8BindingMacros.h
@@ -46,6 +46,14 @@ namespace blink {
if (UNLIKELY(!var.prepare())) \
return retVal;
+// Checks for a given v8::Value (value) whether it is an ArrayBufferView and
+// below a certain size limit. If below the limit allocates memory on the stack
Hannes Payer (out of office) 2015/07/31 07:01:00 If below the limit memory is allocated on...
Michael Lippautz 2015/07/31 07:53:38 Done.
+// to hold the actual payload. Keep the limit in sync with V8's
+// typed_array_max_size.
+#define allocateFlexibleArrayBufferViewStorage(value) \
+ (value->IsArrayBufferView() && (value.As<v8::ArrayBufferView>()->ByteLength() <= 64) ? \
+ alloca(value.As<v8::ArrayBufferView>()->ByteLength()) : nullptr)
+
template <typename T>
inline bool v8Call(v8::Maybe<T> maybe, T& outVariable)
{

Powered by Google App Engine
This is Rietveld 408576698