OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 5 #ifndef BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 6 #define BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/trace_event/trace_event_impl.h" | 10 #include "base/trace_event/trace_event_impl.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 namespace trace_event { | 13 namespace trace_event { |
14 | 14 |
| 15 class ProcessMemoryTotals; |
| 16 |
15 // A container which holds the dumps produced by the MemoryDumpProvider(s) | 17 // A container which holds the dumps produced by the MemoryDumpProvider(s) |
16 // for a specific process. ProcessMemoryDump is as a strongly typed container | 18 // for a specific process. ProcessMemoryDump is as a strongly typed container |
17 // which enforces the data model for each memory dump point. | 19 // which enforces the data model for each memory dump point. |
18 // At trace generation time (i.e. when AppendAsTraceFormat is called) the | 20 // At trace generation time (i.e. when AppendAsTraceFormat is called) the |
19 // ProcessMemoryDump will compose a key-value dictionary of the various dumps | 21 // ProcessMemoryDump will compose a key-value dictionary of the various dumps |
20 // obtained during at trace dump point time. | 22 // obtained during at trace dump point time. |
21 class BASE_EXPORT ProcessMemoryDump : public ConvertableToTraceFormat { | 23 class BASE_EXPORT ProcessMemoryDump : public ConvertableToTraceFormat { |
22 public: | 24 public: |
23 ProcessMemoryDump(); | 25 ProcessMemoryDump(); |
24 | 26 |
25 // ConvertableToTraceFormat implementation. | 27 // ConvertableToTraceFormat implementation. |
26 void AppendAsTraceFormat(std::string* out) const override; | 28 void AppendAsTraceFormat(std::string* out) const override; |
27 | 29 |
| 30 void SetProcessTotals(scoped_ptr<ProcessMemoryTotals> pmt); |
| 31 |
| 32 const ProcessMemoryTotals* process_totals() const { |
| 33 return process_totals_.get(); |
| 34 } |
| 35 |
28 private: | 36 private: |
| 37 scoped_ptr<ProcessMemoryTotals> process_totals_; |
| 38 |
29 ~ProcessMemoryDump() override; | 39 ~ProcessMemoryDump() override; |
30 | 40 |
31 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 41 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
32 }; | 42 }; |
33 | 43 |
34 } // namespace trace_event | 44 } // namespace trace_event |
35 } // namespace base | 45 } // namespace base |
36 | 46 |
37 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 47 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |