| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MemoryUsageProvider_h |
| 6 #define MemoryUsageProvider_h |
| 7 |
| 8 #include "public/platform/WebCommon.h" |
| 9 #include "public/platform/WebMemoryDumpProvider.h" |
| 10 #include "wtf/Allocator.h" |
| 11 #include "wtf/Noncopyable.h" |
| 12 |
| 13 namespace v8 { |
| 14 class Isolate; |
| 15 } |
| 16 |
| 17 namespace blink { |
| 18 |
| 19 class MemoryUsageProvider { |
| 20 USING_FAST_MALLOC(MemoryUsageProvider); |
| 21 WTF_MAKE_NONCOPYABLE(MemoryUsageProvider); |
| 22 public: |
| 23 // Returns a thread specific instance. |
| 24 static MemoryUsageProvider* instance(); |
| 25 |
| 26 MemoryUsageProvider(); |
| 27 ~MemoryUsageProvider(); |
| 28 |
| 29 void setIsolate(v8::Isolate* isolate) { m_isolate = isolate; } |
| 30 |
| 31 // Returns if it reported the memory usage. |
| 32 bool adjustAmountOfAllocatedMemory(); |
| 33 |
| 34 private: |
| 35 v8::Isolate* m_isolate; |
| 36 int64_t m_previousSize; |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // PartitionAllocMemoryDumpProvider_h |
| OLD | NEW |