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( | |
Primiano Tucci (use gerrit)
2015/08/30 18:28:36
typo: s/timefrace/timeframe/
ssid
2015/09/02 12:59:52
Done.
| |
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 protected: | |
41 base::trace_event::ProcessMemoryDump* process_memory_dump() { | |
42 return process_memory_dump_; | |
43 } | |
44 | |
45 private: | |
46 base::trace_event::ProcessMemoryDump* process_memory_dump_; | |
47 | |
48 // Helper to create allocator dumps. | |
49 base::trace_event::MemoryAllocatorDump* GetOrCreateAllocatorDump( | |
50 const char* dumpName); | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(SkTraceMemoryDump_Chrome); | |
53 }; | |
54 | |
55 } // namespace skia | |
56 | |
57 #endif // SKIA_EXT_SK_TRACE_MEMORY_DUMP_CHROME_H_ | |
OLD | NEW |