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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/instant/instant_loader.cc ('k') | chrome/browser/metrics/metrics_service.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) 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 void PurgeMemoryIOHelper::PurgeMemoryOnIOThread() { 58 void PurgeMemoryIOHelper::PurgeMemoryOnIOThread() {
59 // Ask ProxyServices to purge any memory they can (generally garbage in the 59 // Ask ProxyServices to purge any memory they can (generally garbage in the
60 // wrapped ProxyResolver's JS engine). 60 // wrapped ProxyResolver's JS engine).
61 for (RequestContextGetters::const_iterator i( 61 for (RequestContextGetters::const_iterator i(
62 request_context_getters_.begin()); 62 request_context_getters_.begin());
63 i != request_context_getters_.end(); ++i) 63 i != request_context_getters_.end(); ++i)
64 (*i)->GetURLRequestContext()->proxy_service()->PurgeMemory(); 64 (*i)->GetURLRequestContext()->proxy_service()->PurgeMemory();
65 65
66 // The appcache and safe browsing services listen for this notification. 66 // The appcache and safe browsing services listen for this notification.
67 NotificationService::current()->Notify( 67 NotificationService::current()->Notify(
68 NotificationType::PURGE_MEMORY, 68 content::NOTIFICATION_PURGE_MEMORY,
69 Source<void>(NULL), 69 Source<void>(NULL),
70 NotificationService::NoDetails()); 70 NotificationService::NoDetails());
71 } 71 }
72 72
73 // ----------------------------------------------------------------------------- 73 // -----------------------------------------------------------------------------
74 74
75 // static 75 // static
76 void MemoryPurger::PurgeAll() { 76 void MemoryPurger::PurgeAll() {
77 PurgeBrowser(); 77 PurgeBrowser();
78 PurgeRenderers(); 78 PurgeRenderers();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ViewMsg_PurgeMemory());
156 } 156 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698