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; |
} |