| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 std::unique_ptr<MemoryDumpManagerDelegate> delegate_; | 363 std::unique_ptr<MemoryDumpManagerDelegate> delegate_; |
| 364 | 364 |
| 365 // Protects from concurrent accesses to the |dump_providers_*| and |delegate_| | 365 // Protects from concurrent accesses to the |dump_providers_*| and |delegate_| |
| 366 // to guard against disabling logging while dumping on another thread. | 366 // to guard against disabling logging while dumping on another thread. |
| 367 Lock lock_; | 367 Lock lock_; |
| 368 | 368 |
| 369 // Optimization to avoid attempting any memory dump (i.e. to not walk an empty | 369 // Optimization to avoid attempting any memory dump (i.e. to not walk an empty |
| 370 // dump_providers_enabled_ list) when tracing is not enabled. | 370 // dump_providers_enabled_ list) when tracing is not enabled. |
| 371 subtle::AtomicWord memory_tracing_enabled_; | 371 subtle::AtomicWord memory_tracing_enabled_; |
| 372 | 372 |
| 373 // For triggering memory dumps. | |
| 374 std::unique_ptr<MemoryDumpScheduler> dump_scheduler_; | |
| 375 | |
| 376 // Thread used for MemoryDumpProviders which don't specify a task runner | 373 // Thread used for MemoryDumpProviders which don't specify a task runner |
| 377 // affinity. | 374 // affinity. |
| 378 std::unique_ptr<Thread> dump_thread_; | 375 std::unique_ptr<Thread> dump_thread_; |
| 379 | 376 |
| 380 // The unique id of the child process. This is created only for tracing and is | 377 // The unique id of the child process. This is created only for tracing and is |
| 381 // expected to be valid only when tracing is enabled. | 378 // expected to be valid only when tracing is enabled. |
| 382 uint64_t tracing_process_id_; | 379 uint64_t tracing_process_id_; |
| 383 | 380 |
| 384 // When true, calling |RegisterMemoryDumpProvider| is a no-op. | 381 // When true, calling |RegisterMemoryDumpProvider| is a no-op. |
| 385 bool dumper_registrations_ignored_for_testing_; | 382 bool dumper_registrations_ignored_for_testing_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 409 } | 406 } |
| 410 | 407 |
| 411 private: | 408 private: |
| 412 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 409 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
| 413 }; | 410 }; |
| 414 | 411 |
| 415 } // namespace trace_event | 412 } // namespace trace_event |
| 416 } // namespace base | 413 } // namespace base |
| 417 | 414 |
| 418 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 415 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| OLD | NEW |