Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: skia/ext/SkTraceMemoryDump_chrome.h

Issue 1319473003: [tracing] Add SkResourceCache statistics to chrome://tracing (chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discardable_objdumps
Patch Set: Mac build fix. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.cc ('k') | skia/ext/SkTraceMemoryDump_chrome.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 <string>
9
10 #include "base/macros.h"
11 #include "third_party/skia/include/core/SkTraceMemoryDump.h"
12
13 namespace base {
14 namespace trace_event {
15 class MemoryAllocatorDump;
16 class ProcessMemoryDump;
17 }
18 }
19
20 namespace skia {
21
22 class SkTraceMemoryDump_Chrome : public SkTraceMemoryDump {
23 public:
24 // This should never outlive the OnMemoryDump call since the
25 // ProcessMemoryDump is valid only in that timeframe. Optional
26 // |dump_name_prefix| argument specifies the prefix appended to the dump
27 // name skia provides. By defualt it is taken as empty string.
28 SkTraceMemoryDump_Chrome(
29 base::trace_event::ProcessMemoryDump* process_memory_dump);
30
31 SkTraceMemoryDump_Chrome(
32 const char* dump_name_prefix,
33 base::trace_event::ProcessMemoryDump* process_memory_dump);
34
35 ~SkTraceMemoryDump_Chrome() override;
36
37 // SkTraceMemoryDump implementation:
38 void dumpNumericValue(const char* dumpName,
39 const char* valueName,
40 const char* units,
41 uint64_t value) override;
42 void setMemoryBacking(const char* dumpName,
43 const char* backingType,
44 const char* backingObjectId) override;
45 void setDiscardableMemoryBacking(
46 const char* dumpName,
47 const SkDiscardableMemory& discardableMemoryObject) override;
48
49 protected:
50 base::trace_event::ProcessMemoryDump* process_memory_dump() {
51 return process_memory_dump_;
52 }
53
54 private:
55 base::trace_event::ProcessMemoryDump* process_memory_dump_;
56
57 std::string dump_name_prefix_;
58
59 // Helper to create allocator dumps.
60 base::trace_event::MemoryAllocatorDump* GetOrCreateAllocatorDump(
61 const char* dumpName);
62
63 DISALLOW_COPY_AND_ASSIGN(SkTraceMemoryDump_Chrome);
64 };
65
66 } // namespace skia
67
68 #endif // SKIA_EXT_SK_TRACE_MEMORY_DUMP_CHROME_H_
OLDNEW
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.cc ('k') | skia/ext/SkTraceMemoryDump_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698