OLD | NEW |
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" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "chrome/browser/google/google_util.h" | 13 #include "components/google/core/browser/google_util.h" |
14 #include "net/cookies/canonical_cookie.h" | 14 #include "net/cookies/canonical_cookie.h" |
15 | 15 |
16 namespace chrome_browser_net { | 16 namespace chrome_browser_net { |
17 | 17 |
18 using base::Time; | 18 using base::Time; |
19 using base::TimeDelta; | 19 using base::TimeDelta; |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 const size_t kMaxEvictedDomainCookies = 500; | 23 const size_t kMaxEvictedDomainCookies = 500; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 EvictedCookieMap::iterator it = evicted_cookies_.find(key); | 198 EvictedCookieMap::iterator it = evicted_cookies_.find(key); |
199 if (it != evicted_cookies_.end()) { | 199 if (it != evicted_cookies_.end()) { |
200 if (!it->second->is_expired(current_time)) // Reinstatement. | 200 if (!it->second->is_expired(current_time)) // Reinstatement. |
201 cookie_counter_delegate_->Report(*it->second, current_time); | 201 cookie_counter_delegate_->Report(*it->second, current_time); |
202 delete it->second; | 202 delete it->second; |
203 evicted_cookies_.erase(it); | 203 evicted_cookies_.erase(it); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 } // namespace chrome_browser_net | 207 } // namespace chrome_browser_net |
OLD | NEW |