| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // Function provided by the embedder to handle global dump requests. | 305 // Function provided by the embedder to handle global dump requests. |
| 306 RequestGlobalDumpFunction request_dump_function_; | 306 RequestGlobalDumpFunction request_dump_function_; |
| 307 | 307 |
| 308 // True when current process coordinates the periodic dump triggering. | 308 // True when current process coordinates the periodic dump triggering. |
| 309 bool is_coordinator_; | 309 bool is_coordinator_; |
| 310 | 310 |
| 311 // Protects from concurrent accesses to the local state, eg: to guard against | 311 // Protects from concurrent accesses to the local state, eg: to guard against |
| 312 // disabling logging while dumping on another thread. | 312 // disabling logging while dumping on another thread. |
| 313 Lock lock_; | 313 Lock lock_; |
| 314 | 314 |
| 315 // Optimization to avoid attempting any memory dump (i.e. to not walk an empty | |
| 316 // dump_providers_enabled_ list) when tracing is not enabled. | |
| 317 subtle::AtomicWord is_enabled_; | |
| 318 | |
| 319 // Thread used for MemoryDumpProviders which don't specify a task runner | 315 // Thread used for MemoryDumpProviders which don't specify a task runner |
| 320 // affinity. | 316 // affinity. |
| 321 std::unique_ptr<Thread> dump_thread_; | 317 std::unique_ptr<Thread> dump_thread_; |
| 322 | 318 |
| 323 // The unique id of the child process. This is created only for tracing and is | 319 // The unique id of the child process. This is created only for tracing and is |
| 324 // expected to be valid only when tracing is enabled. | 320 // expected to be valid only when tracing is enabled. |
| 325 uint64_t tracing_process_id_; | 321 uint64_t tracing_process_id_; |
| 326 | 322 |
| 327 // When true, calling |RegisterMemoryDumpProvider| is a no-op. | 323 // When true, calling |RegisterMemoryDumpProvider| is a no-op. |
| 328 bool dumper_registrations_ignored_for_testing_; | 324 bool dumper_registrations_ignored_for_testing_; |
| 329 | 325 |
| 330 // Whether new memory dump providers should be told to enable heap profiling. | 326 // Whether new memory dump providers should be told to enable heap profiling. |
| 331 bool heap_profiling_enabled_; | 327 bool heap_profiling_enabled_; |
| 332 | 328 |
| 333 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); | 329 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager); |
| 334 }; | 330 }; |
| 335 | 331 |
| 336 } // namespace trace_event | 332 } // namespace trace_event |
| 337 } // namespace base | 333 } // namespace base |
| 338 | 334 |
| 339 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 335 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| OLD | NEW |