diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 22:14:40 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 22:14:40 +0000 |
commit | 4967f792930a150b81d2cd3ca31d101cecde24e8 (patch) | |
tree | b64930d118529431fdc4530d277a3cac03114efc /content/browser/profiler_controller_impl.cc | |
parent | f0e342256f44ff6228a7bcd8fb2e221facb6368c (diff) | |
download | chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.zip chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.tar.gz chromium_src-4967f792930a150b81d2cd3ca31d101cecde24e8.tar.bz2 |
Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost. Now classes like PluginProcessHost don't derive from it, but instead use composition.
I've also moved the iterator class into its own file in the public directory. Since classes don't derive from BrowserChildProcessHost and so can't static_cast from it, I added a template helper that does this.
BUG=98716
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=118415
Review URL: https://chromiumcodereview.appspot.com/9150017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/profiler_controller_impl.cc')
-rw-r--r-- | content/browser/profiler_controller_impl.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/content/browser/profiler_controller_impl.cc b/content/browser/profiler_controller_impl.cc index 4b55357..1954da8 100644 --- a/content/browser/profiler_controller_impl.cc +++ b/content/browser/profiler_controller_impl.cc @@ -6,13 +6,15 @@ #include "base/bind.h" #include "base/values.h" -#include "content/browser/browser_child_process_host.h" #include "content/common/child_process_messages.h" +#include "content/public/browser/browser_child_process_host_iterator.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/child_process_data.h" #include "content/public/browser/profiler_subscriber.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/process_type.h" +using content::BrowserChildProcessHostIterator; using content::BrowserThread; namespace content { @@ -73,13 +75,12 @@ void ProfilerControllerImpl::GetProfilerDataFromChildProcesses( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); int pending_processes = 0; - for (BrowserChildProcessHost::Iterator child_process_host; - !child_process_host.Done(); ++child_process_host) { + for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { const std::string process_type = - content::GetProcessTypeNameInEnglish(child_process_host->data().type); + content::GetProcessTypeNameInEnglish(iter.GetData().type); ++pending_processes; - if (!child_process_host->Send(new ChildProcessMsg_GetChildProfilerData( - sequence_number, process_type))) { + if (!iter.Send(new ChildProcessMsg_GetChildProfilerData( + sequence_number, process_type))) { --pending_processes; } } @@ -123,10 +124,8 @@ void ProfilerControllerImpl::GetProfilerData(int sequence_number) { void ProfilerControllerImpl::SetProfilerStatusInChildProcesses(bool enable) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - for (BrowserChildProcessHost::Iterator child_process_host; - !child_process_host.Done(); ++child_process_host) { - child_process_host->Send(new ChildProcessMsg_SetProfilerStatus(enable)); - } + for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) + iter.Send(new ChildProcessMsg_SetProfilerStatus(enable)); } void ProfilerControllerImpl::SetProfilerStatus(bool enable) { |