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

Side by Side Diff: chrome/browser/memory_purger.cc

Issue 9600036: Move Render(View|Widget)Host and associated classes to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 years, 9 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 | « chrome/browser/memory_details.cc ('k') | chrome/browser/notifications/balloon_host.h » ('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) 2012 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 "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/bind.h" 9 #include "base/bind.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 PurgeRenderers(); 78 PurgeRenderers();
79 79
80 // TODO(pkasting): 80 // TODO(pkasting):
81 // * Tell the plugin processes to release their free memory? Other stuff? 81 // * Tell the plugin processes to release their free memory? Other stuff?
82 // * Enumerate what other processes exist and what to do for them. 82 // * Enumerate what other processes exist and what to do for them.
83 } 83 }
84 84
85 // static 85 // static
86 void MemoryPurger::PurgeBrowser() { 86 void MemoryPurger::PurgeBrowser() {
87 // Dump the backing stores. 87 // Dump the backing stores.
88 RenderWidgetHost::RemoveAllBackingStores(); 88 content::RenderWidgetHost::RemoveAllBackingStores();
89 89
90 // Per-profile cleanup. 90 // Per-profile cleanup.
91 scoped_refptr<PurgeMemoryIOHelper> purge_memory_io_helper( 91 scoped_refptr<PurgeMemoryIOHelper> purge_memory_io_helper(
92 new PurgeMemoryIOHelper()); 92 new PurgeMemoryIOHelper());
93 ProfileManager* profile_manager = g_browser_process->profile_manager(); 93 ProfileManager* profile_manager = g_browser_process->profile_manager();
94 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles()); 94 std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
95 for (size_t i = 0; i < profiles.size(); ++i) { 95 for (size_t i = 0; i < profiles.size(); ++i) {
96 purge_memory_io_helper->AddRequestContextGetter( 96 purge_memory_io_helper->AddRequestContextGetter(
97 make_scoped_refptr(profiles[i]->GetRequestContext())); 97 make_scoped_refptr(profiles[i]->GetRequestContext()));
98 98
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 content::RenderProcessHost::AllHostsIterator()); 146 content::RenderProcessHost::AllHostsIterator());
147 !i.IsAtEnd(); i.Advance()) 147 !i.IsAtEnd(); i.Advance())
148 PurgeRendererForHost(i.GetCurrentValue()); 148 PurgeRendererForHost(i.GetCurrentValue());
149 } 149 }
150 150
151 // static 151 // static
152 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) { 152 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) {
153 // Direct the renderer to free everything it can. 153 // Direct the renderer to free everything it can.
154 host->Send(new ChromeViewMsg_PurgeMemory()); 154 host->Send(new ChromeViewMsg_PurgeMemory());
155 } 155 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/notifications/balloon_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698