Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: base/trace_event/memory_dump_manager.h

Issue 2743993004: [memory-infra] Make MemoryDumpScheduler non-thread safe singleton (Closed)
Patch Set: rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698