Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 SKIA_EXT_SK_TRACE_MEMORY_DUMP_CHROME_H_ | |
| 6 #define SKIA_EXT_SK_TRACE_MEMORY_DUMP_CHROME_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "third_party/skia/include/core/SkTraceMemoryDump.h" | |
| 10 | |
| 11 namespace base { | |
| 12 namespace trace_event { | |
| 13 class MemoryAllocatorDump; | |
| 14 class ProcessMemoryDump; | |
| 15 } | |
| 16 } | |
| 17 | |
| 18 namespace skia { | |
| 19 | |
| 20 class SkTraceMemoryDump_Chrome : public SkTraceMemoryDump { | |
| 21 public: | |
| 22 // This should never outlive the OnMemoryDump call since the | |
| 23 // ProcessMemoryDump is valid only in that timefrace. | |
| 24 SkTraceMemoryDump_Chrome( | |
| 25 base::trace_event::ProcessMemoryDump* process_memory_dump); | |
| 26 ~SkTraceMemoryDump_Chrome() override; | |
| 27 | |
| 28 // SkTraceMemoryDump implementation: | |
| 29 void dumpNumericValue(const char* dumpName, | |
| 30 const char* valueName, | |
| 31 const char* units, | |
| 32 uint64_t value) override; | |
| 33 void setMemoryBacking(const char* dumpName, | |
| 34 const char* backingType, | |
| 35 const char* backingObjectId) override; | |
| 36 void setDiscardableMemoryBacking( | |
| 37 const char* dumpName, | |
| 38 const SkDiscardableMemory& discardableMemoryObject) override; | |
| 39 | |
| 40 private: | |
| 41 base::trace_event::ProcessMemoryDump* process_memory_dump_; | |
|
ericrk
2015/08/26 18:12:06
As I think subclassing will lead to the most sane
| |
| 42 | |
| 43 // Helper to create allocator dumps. | |
| 44 base::trace_event::MemoryAllocatorDump* GetOrCreateAllocatorDump( | |
| 45 const char* dumpName); | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(SkTraceMemoryDump_Chrome); | |
| 48 }; | |
| 49 | |
| 50 } // namespace skia | |
| 51 | |
| 52 #endif // SKIA_EXT_SK_TRACE_MEMORY_DUMP_CHROME_H_ | |
| OLD | NEW |