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

Unified Diff: src/v8.h

Issue 15855012: Change ArrayBuffer API and implementation to use embedder-provided allocator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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: src/v8.h
diff --git a/src/v8.h b/src/v8.h
index cd25dc76ea46edf52d372852cc530a6c750f8ccc..72fad6b1f52311217cf9ef6486e3a1ded07c3f2a 100644
--- a/src/v8.h
+++ b/src/v8.h
@@ -121,6 +121,15 @@ class V8 : public AllStatic {
static void RemoveCallCompletedCallback(CallCompletedCallback callback);
static void FireCallCompletedCallback(Isolate* isolate);
+ static v8::ArrayBuffer::Allocator* ArrayBufferAllocator() {
+ return array_buffer_allocator_;
+ }
+
+ static void SetArrayBufferAllocator(v8::ArrayBuffer::Allocator *allocator) {
+ CHECK(array_buffer_allocator_ == NULL);
Sven Panne 2013/06/11 09:54:37 CHECK_EQ(NULL, array_buffer_allocator_);
Dmitry Lomov (no reviews) 2013/06/11 10:40:09 Done.
+ array_buffer_allocator_ = allocator;
+ }
+
private:
static void InitializeOncePerProcessImpl();
static void InitializeOncePerProcess();
@@ -139,6 +148,8 @@ class V8 : public AllStatic {
static bool use_crankshaft_;
// List of callbacks when a Call completes.
static List<CallCompletedCallback>* call_completed_callbacks_;
+ // Allocator for external array buffers.
+ static v8::ArrayBuffer::Allocator* array_buffer_allocator_;
};

Powered by Google App Engine
This is Rietveld 408576698