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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
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/allocator/allocator_extension.h" 9 #include "base/allocator/allocator_extension.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 purge_memory_io_helper->AddRequestContextGetter( 104 purge_memory_io_helper->AddRequestContextGetter(
105 make_scoped_refptr(profiles[i]->GetRequestContext())); 105 make_scoped_refptr(profiles[i]->GetRequestContext()));
106 106
107 // NOTE: Some objects below may be duplicates across profiles. We could 107 // NOTE: Some objects below may be duplicates across profiles. We could
108 // conceivably put all these in sets and then iterate over the sets. 108 // conceivably put all these in sets and then iterate over the sets.
109 109
110 // Unload all history backends (freeing memory used to cache sqlite). 110 // Unload all history backends (freeing memory used to cache sqlite).
111 // Spinning up the history service is expensive, so we avoid doing it if it 111 // Spinning up the history service is expensive, so we avoid doing it if it
112 // hasn't been done already. 112 // hasn't been done already.
113 HistoryService* history_service = 113 HistoryService* history_service =
114 HistoryServiceFactory::GetForProfileWithoutCreating(profiles[i]); 114 HistoryServiceFactory::GetForProfileWithoutCreating(profiles[i]).get();
115 if (history_service) 115 if (history_service)
116 history_service->UnloadBackend(); 116 history_service->UnloadBackend();
117 117
118 // Unload all web databases (freeing memory used to cache sqlite). 118 // Unload all web databases (freeing memory used to cache sqlite).
119 scoped_refptr<WebDataService> web_data_service = 119 scoped_refptr<WebDataService> web_data_service =
120 WebDataServiceFactory::GetForProfileIfExists( 120 WebDataServiceFactory::GetForProfileIfExists(
121 profiles[i], Profile::EXPLICIT_ACCESS); 121 profiles[i], Profile::EXPLICIT_ACCESS);
122 if (web_data_service.get()) 122 if (web_data_service.get())
123 web_data_service->UnloadDatabase(); 123 web_data_service->UnloadDatabase();
124 124
(...skipping 28 matching lines...) Expand all
153 content::RenderProcessHost::AllHostsIterator()); 153 content::RenderProcessHost::AllHostsIterator());
154 !i.IsAtEnd(); i.Advance()) 154 !i.IsAtEnd(); i.Advance())
155 PurgeRendererForHost(i.GetCurrentValue()); 155 PurgeRendererForHost(i.GetCurrentValue());
156 } 156 }
157 157
158 // static 158 // static
159 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) { 159 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) {
160 // Direct the renderer to free everything it can. 160 // Direct the renderer to free everything it can.
161 host->Send(new ChromeViewMsg_PurgeMemory()); 161 host->Send(new ChromeViewMsg_PurgeMemory());
162 } 162 }
OLDNEW
« no previous file with comments | « chrome/browser/managed_mode/managed_mode_unittest.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698