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: . 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
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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 bool is_coordinator_; 354 bool is_coordinator_;
355 355
356 // Protects from concurrent accesses to the |dump_providers_*| and |delegate_| 356 // Protects from concurrent accesses to the |dump_providers_*| and |delegate_|
357 // to guard against disabling logging while dumping on another thread. 357 // to guard against disabling logging while dumping on another thread.
358 Lock lock_; 358 Lock lock_;
359 359
360 // Optimization to avoid attempting any memory dump (i.e. to not walk an empty 360 // Optimization to avoid attempting any memory dump (i.e. to not walk an empty
361 // dump_providers_enabled_ list) when tracing is not enabled. 361 // dump_providers_enabled_ list) when tracing is not enabled.
362 subtle::AtomicWord memory_tracing_enabled_; 362 subtle::AtomicWord memory_tracing_enabled_;
363 363
364 // For triggering memory dumps.
365 std::unique_ptr<MemoryDumpScheduler> dump_scheduler_;
366
367 // Thread used for MemoryDumpProviders which don't specify a task runner 364 // Thread used for MemoryDumpProviders which don't specify a task runner
368 // affinity. 365 // affinity.
369 std::unique_ptr<Thread> dump_thread_; 366 std::unique_ptr<Thread> dump_thread_;
370 367
371 // The unique id of the child process. This is created only for tracing and is 368 // The unique id of the child process. This is created only for tracing and is
372 // expected to be valid only when tracing is enabled. 369 // expected to be valid only when tracing is enabled.
373 uint64_t tracing_process_id_; 370 uint64_t tracing_process_id_;
374 371
375 // When true, calling |RegisterMemoryDumpProvider| is a no-op. 372 // When true, calling |RegisterMemoryDumpProvider| is a no-op.
376 bool dumper_registrations_ignored_for_testing_; 373 bool dumper_registrations_ignored_for_testing_;
(...skipping 25 matching lines...) Expand all
402 } 399 }
403 400
404 private: 401 private:
405 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); 402 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate);
406 }; 403 };
407 404
408 } // namespace trace_event 405 } // namespace trace_event
409 } // namespace base 406 } // namespace base
410 407
411 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ 408 #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') | base/trace_event/memory_dump_scheduler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698