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

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

Issue 10071036: RefCounted types should not have public destructors, chrome/browser/ part 6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation fixes Created 8 years, 7 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/io_thread.cc ('k') | chrome/browser/metrics/field_trial_synchronizer.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 28 matching lines...) Expand all
39 PurgeMemoryIOHelper() { 39 PurgeMemoryIOHelper() {
40 safe_browsing_service_ = g_browser_process->safe_browsing_service(); 40 safe_browsing_service_ = g_browser_process->safe_browsing_service();
41 } 41 }
42 42
43 void AddRequestContextGetter( 43 void AddRequestContextGetter(
44 scoped_refptr<net::URLRequestContextGetter> request_context_getter); 44 scoped_refptr<net::URLRequestContextGetter> request_context_getter);
45 45
46 void PurgeMemoryOnIOThread(); 46 void PurgeMemoryOnIOThread();
47 47
48 private: 48 private:
49 friend class base::RefCountedThreadSafe<PurgeMemoryIOHelper>;
50
51 virtual ~PurgeMemoryIOHelper() {}
52
49 typedef scoped_refptr<net::URLRequestContextGetter> RequestContextGetter; 53 typedef scoped_refptr<net::URLRequestContextGetter> RequestContextGetter;
54 std::vector<RequestContextGetter> request_context_getters_;
50 55
51 std::vector<RequestContextGetter> request_context_getters_;
52 scoped_refptr<SafeBrowsingService> safe_browsing_service_; 56 scoped_refptr<SafeBrowsingService> safe_browsing_service_;
53 57
54 DISALLOW_COPY_AND_ASSIGN(PurgeMemoryIOHelper); 58 DISALLOW_COPY_AND_ASSIGN(PurgeMemoryIOHelper);
55 }; 59 };
56 60
57 void PurgeMemoryIOHelper::AddRequestContextGetter( 61 void PurgeMemoryIOHelper::AddRequestContextGetter(
58 scoped_refptr<net::URLRequestContextGetter> request_context_getter) { 62 scoped_refptr<net::URLRequestContextGetter> request_context_getter) {
59 request_context_getters_.push_back(request_context_getter); 63 request_context_getters_.push_back(request_context_getter);
60 } 64 }
61 65
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 content::RenderProcessHost::AllHostsIterator()); 152 content::RenderProcessHost::AllHostsIterator());
149 !i.IsAtEnd(); i.Advance()) 153 !i.IsAtEnd(); i.Advance())
150 PurgeRendererForHost(i.GetCurrentValue()); 154 PurgeRendererForHost(i.GetCurrentValue());
151 } 155 }
152 156
153 // static 157 // static
154 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) { 158 void MemoryPurger::PurgeRendererForHost(content::RenderProcessHost* host) {
155 // Direct the renderer to free everything it can. 159 // Direct the renderer to free everything it can.
156 host->Send(new ChromeViewMsg_PurgeMemory()); 160 host->Send(new ChromeViewMsg_PurgeMemory());
157 } 161 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/metrics/field_trial_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698