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

Unified Diff: include/v8.h

Issue 1041403003: Expose an API on ArrayBufferView to copy out content w/o changing the buffer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 9 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index fd281ae0c4e91b83fb100c1d50595a6ebefc252b..8b2f39d1235ab534b5d884185a7561110eeaf62a 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -3482,6 +3482,17 @@ class V8_EXPORT ArrayBufferView : public Object {
*/
size_t ByteLength();
+ /**
+ * Copy the contents of the ArrayBufferView's buffer to an embedder defined
+ * memory without additional overhead that calling ArrayBufferView::Buffer
+ * might incur.
+ *
+ * Will write at most min(|byte_length|, ByteLength) bytes starting at
+ * ByteOffset of the underling buffer to the memory starting at |dest|.
+ * Returns the number of bytes actually written.
+ */
+ size_t CopyContents(void* dest, size_t byte_length);
+
V8_INLINE static ArrayBufferView* Cast(Value* obj);
static const int kInternalFieldCount =
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698