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

Unified Diff: src/api.cc

Issue 1110713004: Version 4.3.61.16 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 years, 8 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 | « include/v8-version.h ('k') | test/cctest/test-typedarrays.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 8a84dd39d4a88b40fd1b21bc58cde89ae89fee31..4afe5c40d8d89db3ea3f7c98097aaa99f795e3b7 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6466,6 +6466,15 @@ size_t v8::ArrayBufferView::CopyContents(void* dest, size_t byte_length) {
}
+bool v8::ArrayBufferView::HasBuffer() const {
+ i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
+ if (obj->IsJSDataView()) return true;
+ DCHECK(obj->IsJSTypedArray());
+ i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*obj));
+ return !typed_array->buffer()->IsSmi();
+}
+
+
size_t v8::ArrayBufferView::ByteOffset() {
i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
return static_cast<size_t>(obj->byte_offset()->Number());
« no previous file with comments | « include/v8-version.h ('k') | test/cctest/test-typedarrays.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698