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