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

Side by Side Diff: content/browser/profiler_controller_impl.cc

Issue 9181002: Track parent-child relations during profiling (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/profiler_controller_impl.h ('k') | content/browser/profiler_message_filter.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/profiler_controller_impl.h" 5 #include "content/browser/profiler_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "content/common/child_process_messages.h" 9 #include "content/common/child_process_messages.h"
10 #include "content/public/browser/browser_child_process_host_iterator.h" 10 #include "content/public/browser/browser_child_process_host_iterator.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 OnPendingProcesses(sequence_number, pending_processes, false); 114 OnPendingProcesses(sequence_number, pending_processes, false);
115 115
116 BrowserThread::PostTask( 116 BrowserThread::PostTask(
117 BrowserThread::IO, 117 BrowserThread::IO,
118 FROM_HERE, 118 FROM_HERE,
119 base::Bind(&ProfilerControllerImpl::GetProfilerDataFromChildProcesses, 119 base::Bind(&ProfilerControllerImpl::GetProfilerDataFromChildProcesses,
120 base::Unretained(this), 120 base::Unretained(this),
121 sequence_number)); 121 sequence_number));
122 } 122 }
123 123
124 void ProfilerControllerImpl::SetProfilerStatusInChildProcesses(bool enable) { 124 void ProfilerControllerImpl::SetProfilerStatusInChildProcesses(
125 tracked_objects::ThreadData::Status status) {
125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
126 127
127 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) 128 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter)
128 iter.Send(new ChildProcessMsg_SetProfilerStatus(enable)); 129 iter.Send(new ChildProcessMsg_SetProfilerStatus(status));
129 } 130 }
130 131
131 void ProfilerControllerImpl::SetProfilerStatus(bool enable) { 132 void ProfilerControllerImpl::SetProfilerStatus(
133 tracked_objects::ThreadData::Status status) {
132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
133 135
134 BrowserThread::PostTask( 136 BrowserThread::PostTask(
135 BrowserThread::IO, 137 BrowserThread::IO,
136 FROM_HERE, 138 FROM_HERE,
137 base::Bind(&ProfilerControllerImpl::SetProfilerStatusInChildProcesses, 139 base::Bind(&ProfilerControllerImpl::SetProfilerStatusInChildProcesses,
138 base::Unretained(this), 140 base::Unretained(this),
139 enable)); 141 status));
140 142
141 for (content::RenderProcessHost::iterator it( 143 for (content::RenderProcessHost::iterator it(
142 content::RenderProcessHost::AllHostsIterator()); 144 content::RenderProcessHost::AllHostsIterator());
143 !it.IsAtEnd(); it.Advance()) { 145 !it.IsAtEnd(); it.Advance()) {
144 it.GetCurrentValue()->Send(new ChildProcessMsg_SetProfilerStatus(enable)); 146 it.GetCurrentValue()->Send(new ChildProcessMsg_SetProfilerStatus(status));
145 } 147 }
146 } 148 }
147 } // namespace content 149 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/profiler_controller_impl.h ('k') | content/browser/profiler_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698