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

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

Issue 16296002: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/net/connection_tester_unittest.cc ('k') | chrome/browser/net/network_stats.cc » ('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 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 #include "chrome/browser/net/evicted_domain_cookie_counter.h" 5 #include "chrome/browser/net/evicted_domain_cookie_counter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ChangeCause cause) { 100 ChangeCause cause) {
101 EvictedDomainCookieCounter::EvictedCookieKey key(GetKey(cookie)); 101 EvictedDomainCookieCounter::EvictedCookieKey key(GetKey(cookie));
102 Time current_time(cookie_counter_delegate_->CurrentTime()); 102 Time current_time(cookie_counter_delegate_->CurrentTime());
103 if (removed) { 103 if (removed) {
104 if (cause == net::CookieMonster::Delegate::CHANGE_COOKIE_EVICTED) 104 if (cause == net::CookieMonster::Delegate::CHANGE_COOKIE_EVICTED)
105 StoreEvictedCookie(key, cookie, current_time); 105 StoreEvictedCookie(key, cookie, current_time);
106 } else { // Includes adds or updates. 106 } else { // Includes adds or updates.
107 ProcessNewCookie(key, cookie, current_time); 107 ProcessNewCookie(key, cookie, current_time);
108 } 108 }
109 109
110 if (next_cookie_monster_delegate_) 110 if (next_cookie_monster_delegate_.get())
111 next_cookie_monster_delegate_->OnCookieChanged(cookie, removed, cause); 111 next_cookie_monster_delegate_->OnCookieChanged(cookie, removed, cause);
112 } 112 }
113 113
114 // static 114 // static
115 EvictedDomainCookieCounter::EvictedCookieKey 115 EvictedDomainCookieCounter::EvictedCookieKey
116 EvictedDomainCookieCounter::GetKey(const net::CanonicalCookie& cookie) { 116 EvictedDomainCookieCounter::GetKey(const net::CanonicalCookie& cookie) {
117 return cookie.Domain() + ";" + cookie.Path() + ";" + cookie.Name(); 117 return cookie.Domain() + ";" + cookie.Path() + ";" + cookie.Name();
118 } 118 }
119 119
120 // static 120 // static
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 EvictedCookieMap::iterator it = evicted_cookies_.find(key); 193 EvictedCookieMap::iterator it = evicted_cookies_.find(key);
194 if (it != evicted_cookies_.end()) { 194 if (it != evicted_cookies_.end()) {
195 if (!it->second->is_expired(current_time)) // Reinstatement. 195 if (!it->second->is_expired(current_time)) // Reinstatement.
196 cookie_counter_delegate_->Report(*it->second, current_time); 196 cookie_counter_delegate_->Report(*it->second, current_time);
197 delete it->second; 197 delete it->second;
198 evicted_cookies_.erase(it); 198 evicted_cookies_.erase(it);
199 } 199 }
200 } 200 }
201 201
202 } // namespace chrome_browser_net 202 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/connection_tester_unittest.cc ('k') | chrome/browser/net/network_stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698