diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 07:51:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-20 07:51:54 +0000 |
commit | f177ffd84b0f1b94de05fa0166520783cb5cddb9 (patch) | |
tree | 54f755e0de2d845cd2d8b481f08c528911ce62d2 /content/browser/profiler_controller_impl.cc | |
parent | 57c1b56f4ae39e8cb1cd805fb46653423d4e5456 (diff) | |
download | chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.zip chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.tar.gz chromium_src-f177ffd84b0f1b94de05fa0166520783cb5cddb9.tar.bz2 |
Revert 118415 - 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
Review URL: https://chromiumcodereview.appspot.com/9150017
TBR=jam@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118420 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, 10 insertions, 9 deletions
diff --git a/content/browser/profiler_controller_impl.cc b/content/browser/profiler_controller_impl.cc index 1954da8..4b55357 100644 --- a/content/browser/profiler_controller_impl.cc +++ b/content/browser/profiler_controller_impl.cc @@ -6,15 +6,13 @@ #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 { @@ -75,12 +73,13 @@ void ProfilerControllerImpl::GetProfilerDataFromChildProcesses( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); int pending_processes = 0; - for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { + for (BrowserChildProcessHost::Iterator child_process_host; + !child_process_host.Done(); ++child_process_host) { const std::string process_type = - content::GetProcessTypeNameInEnglish(iter.GetData().type); + content::GetProcessTypeNameInEnglish(child_process_host->data().type); ++pending_processes; - if (!iter.Send(new ChildProcessMsg_GetChildProfilerData( - sequence_number, process_type))) { + if (!child_process_host->Send(new ChildProcessMsg_GetChildProfilerData( + sequence_number, process_type))) { --pending_processes; } } @@ -124,8 +123,10 @@ void ProfilerControllerImpl::GetProfilerData(int sequence_number) { void ProfilerControllerImpl::SetProfilerStatusInChildProcesses(bool enable) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) - iter.Send(new ChildProcessMsg_SetProfilerStatus(enable)); + for (BrowserChildProcessHost::Iterator child_process_host; + !child_process_host.Done(); ++child_process_host) { + child_process_host->Send(new ChildProcessMsg_SetProfilerStatus(enable)); + } } void ProfilerControllerImpl::SetProfilerStatus(bool enable) { |