diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-17 20:13:53 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-17 20:13:53 +0000 |
commit | 9de09f8474427fe1341201b946d9afe20ab01b07 (patch) | |
tree | f0ac3acf7bdba7a3259124908d627489a99f44da /chrome/browser/browser.cc | |
parent | 6b2aedb4e7f4a62a74df55b8126a2f4ed6793760 (diff) | |
download | chromium_src-9de09f8474427fe1341201b946d9afe20ab01b07.zip chromium_src-9de09f8474427fe1341201b946d9afe20ab01b07.tar.gz chromium_src-9de09f8474427fe1341201b946d9afe20ab01b07.tar.bz2 |
Refactor IDMap to support safe removing of elements during iteration.
TEST=Covered by unit_tests and other automated tests.
http://crbug.com/19202
Review URL: http://codereview.chromium.org/164518
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index ad61077..905bf11 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -128,11 +128,12 @@ class BrowserIdleTimer : public base::IdleTimer { process.ReduceWorkingSet(); // Handle the Renderer(s). - RenderProcessHost::iterator renderer_iter; - for (renderer_iter = RenderProcessHost::begin(); renderer_iter != - RenderProcessHost::end(); renderer_iter++) { - base::Process process = renderer_iter->second->process(); - process.ReduceWorkingSet(); + RenderProcessHost::iterator renderer_iter( + RenderProcessHost::AllHostsIterator()); + while (!renderer_iter.IsAtEnd()) { + base::Process process = renderer_iter.GetCurrentValue()->process(); + process.ReduceWorkingSet(); + renderer_iter.Advance(); } // Handle the child processe. We need to iterate through them on the IO |