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

Unified Diff: third_party/WebKit/Source/wtf/ArrayBufferContents.h

Issue 1776943002: Register ArrayBufferContents' adjustAmountOfMemory in V8Initializer::initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/Source/web/WebKit.cpp ('k') | third_party/WebKit/Source/wtf/WTF.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/ArrayBufferContents.h
diff --git a/third_party/WebKit/Source/wtf/ArrayBufferContents.h b/third_party/WebKit/Source/wtf/ArrayBufferContents.h
index 3050379251aa5d91f46e17676ae9f3e7acc5fa45..cc768c99844ece46e81d06aec7a18f7819487998 100644
--- a/third_party/WebKit/Source/wtf/ArrayBufferContents.h
+++ b/third_party/WebKit/Source/wtf/ArrayBufferContents.h
@@ -29,6 +29,7 @@
#include "wtf/Allocator.h"
#include "wtf/Assertions.h"
+#include "wtf/MainThread.h"
#include "wtf/Noncopyable.h"
#include "wtf/RefPtr.h"
#include "wtf/ThreadSafeRefCounted.h"
@@ -37,6 +38,8 @@
namespace WTF {
+typedef void(*AdjustAmountOfExternalAllocatedMemoryFunction)(int size);
+
class WTF_EXPORT ArrayBufferContents {
WTF_MAKE_NONCOPYABLE(ArrayBufferContents);
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
@@ -76,8 +79,9 @@ public:
static void allocateMemory(size_t, InitializationPolicy, void*&);
static void allocateMemoryOrNull(size_t, InitializationPolicy, void*&);
static void freeMemory(void*, size_t);
- static void setAdjustAmoutOfExternalAllocatedMemoryFunction(AdjustAmountOfExternalAllocatedMemoryFunction function)
+ static void initialize(AdjustAmountOfExternalAllocatedMemoryFunction function)
{
+ ASSERT(isMainThread());
ASSERT(!s_adjustAmountOfExternalAllocatedMemoryFunction);
s_adjustAmountOfExternalAllocatedMemoryFunction = function;
}
« no previous file with comments | « third_party/WebKit/Source/web/WebKit.cpp ('k') | third_party/WebKit/Source/wtf/WTF.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698