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

Unified Diff: chrome/browser/memory_purger.cc

Issue 4291001: Convert implicit scoped_refptr constructor calls to explicit ones, part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/build
Patch Set: comments Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/memory_purger.cc
diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc
index d1431dade56309bf3ba4ab9da5d45fec5089cab3..3543ee59cd33afdb751ed5e53376c53dd377ebcc 100644
--- a/chrome/browser/memory_purger.cc
+++ b/chrome/browser/memory_purger.cc
@@ -37,7 +37,8 @@ class PurgeMemoryIOHelper
: safe_browsing_service_(safe_browsing_service) {
}
- void AddRequestContextGetter(URLRequestContextGetter* request_context_getter);
+ void AddRequestContextGetter(
+ scoped_refptr<URLRequestContextGetter> request_context_getter);
void PurgeMemoryOnIOThread();
@@ -52,11 +53,8 @@ class PurgeMemoryIOHelper
};
void PurgeMemoryIOHelper::AddRequestContextGetter(
- URLRequestContextGetter* request_context_getter) {
- if (!request_context_getters_.count(request_context_getter)) {
- request_context_getters_.insert(
- RequestContextGetter(request_context_getter));
- }
+ scoped_refptr<URLRequestContextGetter> request_context_getter) {
+ request_context_getters_.insert(request_context_getter);
}
void PurgeMemoryIOHelper::PurgeMemoryOnIOThread() {
@@ -104,7 +102,7 @@ void MemoryPurger::PurgeBrowser() {
i != profile_manager->end(); ++i) {
Profile* profile = *i;
purge_memory_io_helper->AddRequestContextGetter(
- profile->GetRequestContext());
+ make_scoped_refptr(profile->GetRequestContext()));
// NOTE: Some objects below may be duplicates across profiles. We could
// conceivably put all these in sets and then iterate over the sets.
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698