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

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

Issue 1069253003: [tracing] Fix single-process detection logic of ChildTraceMessageFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_4_child
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/child/child_thread_impl.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 #include "base/trace_event/memory_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(this); 70 base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(this);
71 } 71 }
72 72
73 void MemoryDumpManager::Initialize() { 73 void MemoryDumpManager::Initialize() {
74 TRACE_EVENT0(kTraceCategory, "init"); // Add to trace-viewer category list. 74 TRACE_EVENT0(kTraceCategory, "init"); // Add to trace-viewer category list.
75 trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this); 75 trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this);
76 } 76 }
77 77
78 void MemoryDumpManager::SetDelegate(MemoryDumpManagerDelegate* delegate) { 78 void MemoryDumpManager::SetDelegate(MemoryDumpManagerDelegate* delegate) {
79 AutoLock lock(lock_); 79 AutoLock lock(lock_);
80 // TODO(primiano): The DCHECK below is disabled just temporary (and it is 80 DCHECK(delegate_ == nullptr);
Avi (use Gerrit) 2015/04/08 14:42:35 DCHECK_EQ(nullptr, delegate);
Primiano Tucci (use gerrit) 2015/04/08 15:04:29 Yeah, I was just too lazy to do the cast. Unfortun
Avi (use Gerrit) 2015/04/08 15:20:19 That's surprising; I've done it quite a bit. You c
81 // strongly useful). It should be re-enabled soon as crbug.com/474973 is fixed
82 // (ETA: end of April 2015). Commenting out just to de-entangle CL deps.
83 // DCHECK(delegate_ == nullptr);
84 delegate_ = delegate; 81 delegate_ = delegate;
85 } 82 }
86 83
87 void MemoryDumpManager::RegisterDumpProvider(MemoryDumpProvider* mdp) { 84 void MemoryDumpManager::RegisterDumpProvider(MemoryDumpProvider* mdp) {
88 AutoLock lock(lock_); 85 AutoLock lock(lock_);
89 if (std::find(dump_providers_registered_.begin(), 86 if (std::find(dump_providers_registered_.begin(),
90 dump_providers_registered_.end(), 87 dump_providers_registered_.end(),
91 mdp) != dump_providers_registered_.end()) { 88 mdp) != dump_providers_registered_.end()) {
92 return; 89 return;
93 } 90 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 203 }
207 204
208 void MemoryDumpManager::OnTraceLogDisabled() { 205 void MemoryDumpManager::OnTraceLogDisabled() {
209 AutoLock lock(lock_); 206 AutoLock lock(lock_);
210 dump_providers_enabled_.clear(); 207 dump_providers_enabled_.clear();
211 subtle::NoBarrier_Store(&memory_tracing_enabled_, 0); 208 subtle::NoBarrier_Store(&memory_tracing_enabled_, 0);
212 } 209 }
213 210
214 } // namespace trace_event 211 } // namespace trace_event
215 } // namespace base 212 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698