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/trace_event/process_memory_totals.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/trace_event/trace_event_impl.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 namespace trace_event { | 13 namespace trace_event { |
13 | 14 |
14 class ConvertableToTraceFormat; | 15 // A container which holds the dumps produced by the MemoryDumpProvider(s) |
15 | 16 // for a specific process. ProcessMemoryDump is as a strongly typed container |
16 // ProcessMemoryDump is as a strongly typed container which enforces the data | 17 // which enforces the data model for each memory dump point. |
17 // model for each memory dump point and holds the dumps produced by the | 18 // At trace generation time (i.e. when AppendAsTraceFormat is called) the |
18 // MemoryDumpProvider(s) for a specific process. | 19 // ProcessMemoryDump will compose a key-value dictionary of the various dumps |
19 // At trace generation time (i.e. when AsValue() is called), ProcessMemoryDump | 20 // obtained during at trace dump point time. |
20 // will compose a key-value dictionary of the various dumps obtained at trace | 21 class BASE_EXPORT ProcessMemoryDump : public ConvertableToTraceFormat { |
21 // dump point time. | |
22 class BASE_EXPORT ProcessMemoryDump { | |
23 public: | 22 public: |
24 ProcessMemoryDump(); | 23 ProcessMemoryDump(); |
25 ~ProcessMemoryDump(); | |
26 | 24 |
27 // Called at trace generation time to populate the TracedValue. | 25 // ConvertableToTraceFormat implementation. |
28 void AsValueInto(TracedValue* value) const; | 26 void AppendAsTraceFormat(std::string* out) const override; |
29 | |
30 ProcessMemoryTotals* process_totals() { return &process_totals_; } | |
31 bool has_process_totals() const { return has_process_totals_; } | |
32 void set_has_process_totals() { has_process_totals_ = true; } | |
33 | 27 |
34 private: | 28 private: |
35 ProcessMemoryTotals process_totals_; | 29 ~ProcessMemoryDump() override; |
36 bool has_process_totals_; | |
37 | 30 |
38 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); | 31 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDump); |
39 }; | 32 }; |
40 | 33 |
41 } // namespace trace_event | 34 } // namespace trace_event |
42 } // namespace base | 35 } // namespace base |
43 | 36 |
44 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ | 37 #endif // BASE_TRACE_EVENT_PROCESS_MEMORY_DUMP_H_ |
OLD | NEW |