Chromium Code Reviews| 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 } | |
|
haraken
2016/02/04 12:00:29
Nit: We normally just include <v8.h>.
peria
2016/02/08 08:41:10
It is not visible from platform/heap/HeapPage.h, w
| |
| 16 | |
| 17 namespace blink { | |
| 18 | |
| 19 class MemoryUsageProvider { | |
| 20 USING_FAST_MALLOC(MemoryUsageProvider); | |
| 21 WTF_MAKE_NONCOPYABLE(MemoryUsageProvider); | |
| 22 public: | |
| 23 static MemoryUsageProvider* instance(); | |
|
haraken
2016/02/04 12:00:29
Instead of making this class a singleton, it might
peria
2016/02/08 08:41:10
This method is expected to return thread specific
| |
| 24 MemoryUsageProvider(); | |
| 25 ~MemoryUsageProvider(); | |
| 26 | |
| 27 void setIsolate(v8::Isolate* isolate) { m_isolate = isolate; } | |
| 28 | |
| 29 void adjustAmountOfAllocatedMemory(); | |
| 30 | |
| 31 private: | |
| 32 | |
| 33 v8::Isolate* m_isolate; | |
| 34 int64_t m_previousSize; | |
| 35 }; | |
| 36 | |
| 37 } // namespace blink | |
| 38 | |
| 39 #endif // PartitionAllocMemoryDumpProvider_h | |
| OLD | NEW |