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

Side by Side Diff: chrome/browser/net/evicted_domain_cookie_counter.h

Issue 233353003: Only commit cookie changes in prerenders after a prerender is shown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add browser tests, fix a bug in what was changed yesterday. Created 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_ 5 #ifndef CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_
6 #define CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_ 6 #define CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 size_t max_size, 83 size_t max_size,
84 size_t purge_count); 84 size_t purge_count);
85 85
86 // Returns the number of evicted cookies stored. 86 // Returns the number of evicted cookies stored.
87 size_t GetStorageSize() const; 87 size_t GetStorageSize() const;
88 88
89 // CookieMonster::Delegate implementation. 89 // CookieMonster::Delegate implementation.
90 virtual void OnCookieChanged(const net::CanonicalCookie& cookie, 90 virtual void OnCookieChanged(const net::CanonicalCookie& cookie,
91 bool removed, 91 bool removed,
92 ChangeCause cause) OVERRIDE; 92 ChangeCause cause) OVERRIDE;
93 virtual void OnLoaded() OVERRIDE;
93 94
94 private: 95 private:
95 // Identifier of an evicted cookie. 96 // Identifier of an evicted cookie.
96 typedef std::string EvictedCookieKey; 97 typedef std::string EvictedCookieKey;
97 98
98 // Storage class of evicted cookie. 99 // Storage class of evicted cookie.
99 typedef std::map<EvictedCookieKey, EvictedCookie*> EvictedCookieMap; 100 typedef std::map<EvictedCookieKey, EvictedCookie*> EvictedCookieMap;
100 101
101 virtual ~EvictedDomainCookieCounter(); 102 virtual ~EvictedDomainCookieCounter();
102 103
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 138
138 // After garbage collection, size reduces to <= |max_size_| - |purge_count_|. 139 // After garbage collection, size reduces to <= |max_size_| - |purge_count_|.
139 const size_t purge_count_; 140 const size_t purge_count_;
140 141
141 DISALLOW_COPY_AND_ASSIGN(EvictedDomainCookieCounter); 142 DISALLOW_COPY_AND_ASSIGN(EvictedDomainCookieCounter);
142 }; 143 };
143 144
144 } // namespace chrome_browser_net 145 } // namespace chrome_browser_net
145 146
146 #endif // CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_ 147 #endif // CHROME_BROWSER_NET_EVICTED_DOMAIN_COOKIE_COUNTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698