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

Unified Diff: components/tracing/child_memory_dump_manager_delegate_impl.h

Issue 1348613006: [tracing] Fix races in TraceLog's EnabledStateObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
Index: components/tracing/child_memory_dump_manager_delegate_impl.h
diff --git a/components/tracing/child_memory_dump_manager_delegate_impl.h b/components/tracing/child_memory_dump_manager_delegate_impl.h
index 099948e64185bd5edf20d0865fd33dab1bde1f28..ca5de293ed7f233cd06dcd286806c8161bd97b08 100644
--- a/components/tracing/child_memory_dump_manager_delegate_impl.h
+++ b/components/tracing/child_memory_dump_manager_delegate_impl.h
@@ -9,6 +9,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
+#include "base/synchronization/lock.h"
namespace base {
class SingleThreadTaskRunner;
@@ -64,6 +65,10 @@ class ChildMemoryDumpManagerDelegateImpl
// It is NULL iff |cmtf_| is NULL.
scoped_refptr<base::SingleThreadTaskRunner> ctmf_task_runner_;
+ // Protects from concurrent access to |ctmf_task_runner_| to allow
+ // RequestGlobalMemoryDump to be called from arbitrary threads.
+ base::Lock lock_;
+
// The unique id of the child process, created for tracing and is expected to
// be valid only when tracing is enabled.
uint64 tracing_process_id_;

Powered by Google App Engine
This is Rietveld 408576698