Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index 622147609723c63293c6d94cd82cbd65785a5eb5..85241625195c12f2bce7517a9389f73de3c83193 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -3426,12 +3426,12 @@ class V8_EXPORT ArrayBuffer : public Object { |
/** |
* Create a new ArrayBuffer over an existing memory block. |
- * The created array buffer is immediately in externalized state. |
+ * The created array buffer is by default immediately in externalized state. |
* The memory block will not be reclaimed when a created ArrayBuffer |
* is garbage-collected. |
*/ |
static Local<ArrayBuffer> New(Isolate* isolate, void* data, |
- size_t byte_length); |
+ size_t byte_length, bool is_external = true); |
dcarney
2015/04/20 13:19:56
no bool args! use enum class outside of class (in
|
/** |
* Returns true if ArrayBuffer is extrenalized, that is, does not |
@@ -3463,6 +3463,18 @@ class V8_EXPORT ArrayBuffer : public Object { |
*/ |
Contents Externalize(); |
+ /** |
+ * Get a pointer to the ArrayBuffer's underlying memory block without |
+ * externalizing it. If the ArrayBuffer is not externalized, this pointer |
+ * will become invalid as soon as the ArrayBuffer became garbage collected. |
+ * |
+ * The embedder should make sure to hold a strong reference to the |
+ * ArrayBuffer while accessing this pointer. |
+ * |
+ * The memory block is guaranteed to be allocated with |Allocator::Allocate|. |
+ */ |
+ Contents GetContents(); |
+ |
V8_INLINE static ArrayBuffer* Cast(Value* obj); |
static const int kInternalFieldCount = V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT; |