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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 private: | 84 private: |
85 // Descriptor struct used to hold information about registered MDPs. It is | 85 // Descriptor struct used to hold information about registered MDPs. It is |
86 // deliberately copyable, in order to allow to be used as hash_map value. | 86 // deliberately copyable, in order to allow to be used as hash_map value. |
87 struct MemoryDumpProviderInfo { | 87 struct MemoryDumpProviderInfo { |
88 MemoryDumpProviderInfo( | 88 MemoryDumpProviderInfo( |
89 const scoped_refptr<SingleThreadTaskRunner>& task_runner); | 89 const scoped_refptr<SingleThreadTaskRunner>& task_runner); |
90 ~MemoryDumpProviderInfo(); | 90 ~MemoryDumpProviderInfo(); |
91 | 91 |
92 scoped_refptr<SingleThreadTaskRunner> task_runner; // Optional. | 92 scoped_refptr<SingleThreadTaskRunner> task_runner; // Optional. |
| 93 int consecutive_failures; // Number of times the provider failed (to |
| 94 // disable the MDPs). |
93 bool disabled; // For fail-safe logic (auto-disable failing MDPs). | 95 bool disabled; // For fail-safe logic (auto-disable failing MDPs). |
94 }; | 96 }; |
95 | 97 |
96 friend struct DefaultDeleter<MemoryDumpManager>; // For the testing instance. | 98 friend struct DefaultDeleter<MemoryDumpManager>; // For the testing instance. |
97 friend struct DefaultSingletonTraits<MemoryDumpManager>; | 99 friend struct DefaultSingletonTraits<MemoryDumpManager>; |
98 friend class MemoryDumpManagerDelegate; | 100 friend class MemoryDumpManagerDelegate; |
99 friend class MemoryDumpManagerTest; | 101 friend class MemoryDumpManagerTest; |
100 | 102 |
101 static void SetInstanceForTesting(MemoryDumpManager* instance); | 103 static void SetInstanceForTesting(MemoryDumpManager* instance); |
102 | 104 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 163 } |
162 | 164 |
163 private: | 165 private: |
164 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 166 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
165 }; | 167 }; |
166 | 168 |
167 } // namespace trace_event | 169 } // namespace trace_event |
168 } // namespace base | 170 } // namespace base |
169 | 171 |
170 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 172 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
OLD | NEW |