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_MEMORY_DUMP_MANAGER_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <set> | 9 #include <set> |
9 | 10 |
10 #include "base/atomicops.h" | 11 #include "base/atomicops.h" |
11 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
12 #include "base/containers/scoped_ptr_map.h" | 13 #include "base/containers/scoped_ptr_map.h" |
13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
14 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
15 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
17 #include "base/trace_event/memory_dump_request_args.h" | 18 #include "base/trace_event/memory_dump_request_args.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 const char* system_allocator_pool_name() const { | 118 const char* system_allocator_pool_name() const { |
118 return kSystemAllocatorPoolName; | 119 return kSystemAllocatorPoolName; |
119 }; | 120 }; |
120 | 121 |
121 // When set to true, calling |RegisterMemoryDumpProvider| is a no-op. | 122 // When set to true, calling |RegisterMemoryDumpProvider| is a no-op. |
122 void set_dumper_registrations_ignored_for_testing(bool ignored) { | 123 void set_dumper_registrations_ignored_for_testing(bool ignored) { |
123 dumper_registrations_ignored_for_testing_ = ignored; | 124 dumper_registrations_ignored_for_testing_ = ignored; |
124 } | 125 } |
125 | 126 |
126 private: | 127 private: |
127 friend struct DefaultDeleter<MemoryDumpManager>; // For the testing instance. | 128 friend struct std::default_delete<MemoryDumpManager>; // For the testing |
| 129 // instance. |
128 friend struct DefaultSingletonTraits<MemoryDumpManager>; | 130 friend struct DefaultSingletonTraits<MemoryDumpManager>; |
129 friend class MemoryDumpManagerDelegate; | 131 friend class MemoryDumpManagerDelegate; |
130 friend class MemoryDumpManagerTest; | 132 friend class MemoryDumpManagerTest; |
131 | 133 |
132 // Descriptor struct used to hold information about registered MDPs. It is | 134 // Descriptor struct used to hold information about registered MDPs. It is |
133 // deliberately copyable, in order to allow it to be used as std::set value. | 135 // deliberately copyable, in order to allow it to be used as std::set value. |
134 struct MemoryDumpProviderInfo { | 136 struct MemoryDumpProviderInfo { |
135 MemoryDumpProviderInfo( | 137 MemoryDumpProviderInfo( |
136 MemoryDumpProvider* dump_provider, | 138 MemoryDumpProvider* dump_provider, |
137 const char* name, | 139 const char* name, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 303 } |
302 | 304 |
303 private: | 305 private: |
304 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 306 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
305 }; | 307 }; |
306 | 308 |
307 } // namespace trace_event | 309 } // namespace trace_event |
308 } // namespace base | 310 } // namespace base |
309 | 311 |
310 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 312 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
OLD | NEW |