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

Unified Diff: base/trace_event/memory_dump_manager.h

Issue 2836933002: memory-infra: Never kill memory-infra background thread (Closed)
Patch Set: sacrifice to the dark gods of TSAN Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.h
diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
index 7d35ca5cd2f51685e0c0f4a25685ef98354ef88b..8cf8cd75a435634b2801ae34c080a9fab762d20e 100644
--- a/base/trace_event/memory_dump_manager.h
+++ b/base/trace_event/memory_dump_manager.h
@@ -34,6 +34,7 @@ class ProcessLocalDumpManagerImplTest;
namespace base {
+class SequencedTaskRunner;
class SingleThreadTaskRunner;
class Thread;
@@ -198,7 +199,7 @@ class BASE_EXPORT MemoryDumpManager {
const MemoryDumpProviderInfo::OrderedSet& dump_providers,
scoped_refptr<MemoryDumpSessionState> session_state,
ProcessMemoryDumpCallback callback,
- scoped_refptr<SingleThreadTaskRunner> dump_thread_task_runner);
+ scoped_refptr<SequencedTaskRunner> dump_thread_task_runner);
~ProcessMemoryDumpAsyncState();
// Gets or creates the memory dump container for the given target process.
@@ -239,7 +240,7 @@ class BASE_EXPORT MemoryDumpManager {
// as a separate variable as it needs to be accessed by arbitrary dumpers'
// threads outside of the lock_ to avoid races when disabling tracing.
// It is immutable for all the duration of a tracing session.
- const scoped_refptr<SingleThreadTaskRunner> dump_thread_task_runner;
+ const scoped_refptr<SequencedTaskRunner> dump_thread_task_runner;
private:
DISALLOW_COPY_AND_ASSIGN(ProcessMemoryDumpAsyncState);
@@ -257,6 +258,9 @@ class BASE_EXPORT MemoryDumpManager {
void FinalizeDumpAndAddToTrace(
std::unique_ptr<ProcessMemoryDumpAsyncState> pmd_async_state);
+ // Lazily initializes dump_thread_ and returns its TaskRunner.
+ scoped_refptr<base::SequencedTaskRunner> GetOrCreateBgTaskRunnerLocked();
+
// Calls InvokeOnMemoryDump() for the next MDP on the task runner specified by
// the MDP while registration. On failure to do so, skips and continues to
// next MDP.
@@ -310,7 +314,7 @@ class BASE_EXPORT MemoryDumpManager {
// Optimization to avoid attempting any memory dump (i.e. to not walk an empty
// dump_providers_enabled_ list) when tracing is not enabled.
- subtle::AtomicWord memory_tracing_enabled_;
+ subtle::AtomicWord is_enabled_;
// Thread used for MemoryDumpProviders which don't specify a task runner
// affinity.
« 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