Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 58 |
| 59 static void SetInstanceForTesting(MemoryDumpManager* instance); | 59 static void SetInstanceForTesting(MemoryDumpManager* instance); |
| 60 | 60 |
| 61 MemoryDumpManager(); | 61 MemoryDumpManager(); |
| 62 virtual ~MemoryDumpManager(); | 62 virtual ~MemoryDumpManager(); |
| 63 | 63 |
| 64 // Broadcasts the dump requests to the other processes. | 64 // Broadcasts the dump requests to the other processes. |
| 65 void BroadcastDumpRequest(); | 65 void BroadcastDumpRequest(); |
| 66 | 66 |
| 67 // Creates a dump point for the current process and appends it to the trace. | 67 // Creates a dump point for the current process and appends it to the trace. |
| 68 void CreateLocalDumpPoint(); | 68 void CreateLocalDumpPoint(DumpPointType type); |
|
picksi
2015/02/26 17:58:04
IMO It would aid readability throughout if 'type'
Primiano Tucci (use gerrit)
2015/03/01 11:32:28
Done.
| |
| 69 | 69 |
| 70 std::vector<MemoryDumpProvider*> dump_providers_registered_; // Not owned. | 70 std::vector<MemoryDumpProvider*> dump_providers_registered_; // Not owned. |
| 71 std::vector<MemoryDumpProvider*> dump_providers_enabled_; // Not owned. | 71 std::vector<MemoryDumpProvider*> dump_providers_enabled_; // Not owned. |
| 72 | 72 |
| 73 // Protects from concurrent accesses to the |dump_providers_*|, e.g., tearing | 73 // Protects from concurrent accesses to the |dump_providers_*|, e.g., tearing |
| 74 // down logging while creating a dump point on another thread. | 74 // down logging while creating a dump point on another thread. |
| 75 Lock lock_; | 75 Lock lock_; |
| 76 | 76 |
| 77 // Optimization to avoid attempting any dump point (i.e. to not walk an empty | 77 // Optimization to avoid attempting any dump point (i.e. to not walk an empty |
| 78 // dump_providers_enabled_ list) when tracing is not enabled. | 78 // dump_providers_enabled_ list) when tracing is not enabled. |
| 79 subtle::AtomicWord memory_tracing_enabled_; | 79 subtle::AtomicWord memory_tracing_enabled_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); | 81 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace trace_event | 84 } // namespace trace_event |
| 85 } // namespace base | 85 } // namespace base |
| 86 | 86 |
| 87 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 87 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| OLD | NEW |