| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/memory_purger.h" | 5 #include "chrome/browser/memory_purger.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // cause them to page everything in to do it, which could take a lot of time/ | 145 // cause them to page everything in to do it, which could take a lot of time/ |
| 146 // cause jank. | 146 // cause jank. |
| 147 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 147 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 148 !i.IsAtEnd(); i.Advance()) | 148 !i.IsAtEnd(); i.Advance()) |
| 149 PurgeRendererForHost(i.GetCurrentValue()); | 149 PurgeRendererForHost(i.GetCurrentValue()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | 152 // static |
| 153 void MemoryPurger::PurgeRendererForHost(RenderProcessHost* host) { | 153 void MemoryPurger::PurgeRendererForHost(RenderProcessHost* host) { |
| 154 // Direct the renderer to free everything it can. | 154 // Direct the renderer to free everything it can. |
| 155 host->Send(new ViewMsg_PurgeMemory()); | 155 host->Send(new ChromeViewMsg_PurgeMemory()); |
| 156 } | 156 } |
| OLD | NEW |