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

Side by Side Diff: net/cookies/cookie_monster.cc

Issue 2007563003: Access-time threshold unit failure in CookieMonster. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: empty Created 4 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
« no previous file with comments | « net/cookies/cookie_monster.h ('k') | net/cookies/cookie_monster_unittest.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 (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 // Portions of this code based on Mozilla: 5 // Portions of this code based on Mozilla:
6 // (netwerk/cookie/src/nsCookieService.cpp) 6 // (netwerk/cookie/src/nsCookieService.cpp)
7 /* ***** BEGIN LICENSE BLOCK ***** 7 /* ***** BEGIN LICENSE BLOCK *****
8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 8 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
9 * 9 *
10 * The contents of this file are subject to the Mozilla Public License Version 10 * The contents of this file are subject to the Mozilla Public License Version
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 const CookieStore::CookieChangedCallback& callback, 305 const CookieStore::CookieChangedCallback& callback,
306 const CanonicalCookie& cookie, 306 const CanonicalCookie& cookie,
307 bool removed) { 307 bool removed) {
308 proxy->PostTask(FROM_HERE, base::Bind(callback, cookie, removed)); 308 proxy->PostTask(FROM_HERE, base::Bind(callback, cookie, removed));
309 } 309 }
310 310
311 } // namespace 311 } // namespace
312 312
313 CookieMonster::CookieMonster(PersistentCookieStore* store, 313 CookieMonster::CookieMonster(PersistentCookieStore* store,
314 CookieMonsterDelegate* delegate) 314 CookieMonsterDelegate* delegate)
315 : CookieMonster(store, delegate, kDefaultAccessUpdateThresholdSeconds) { 315 : CookieMonster(
316 } 316 store,
317 delegate,
318 base::TimeDelta::FromSeconds(kDefaultAccessUpdateThresholdSeconds)) {}
317 319
318 CookieMonster::CookieMonster(PersistentCookieStore* store, 320 CookieMonster::CookieMonster(PersistentCookieStore* store,
319 CookieMonsterDelegate* delegate, 321 CookieMonsterDelegate* delegate,
320 int last_access_threshold_milliseconds) 322 base::TimeDelta last_access_threshold)
321 : initialized_(false), 323 : initialized_(false),
322 started_fetching_all_cookies_(false), 324 started_fetching_all_cookies_(false),
323 finished_fetching_all_cookies_(false), 325 finished_fetching_all_cookies_(false),
324 fetch_strategy_(kUnknownFetch), 326 fetch_strategy_(kUnknownFetch),
325 seen_global_task_(false), 327 seen_global_task_(false),
326 store_(store), 328 store_(store),
327 last_access_threshold_(base::TimeDelta::FromMilliseconds( 329 last_access_threshold_(last_access_threshold),
328 last_access_threshold_milliseconds)),
329 delegate_(delegate), 330 delegate_(delegate),
330 last_statistic_record_time_(base::Time::Now()), 331 last_statistic_record_time_(base::Time::Now()),
331 persist_session_cookies_(false), 332 persist_session_cookies_(false),
332 weak_ptr_factory_(this) { 333 weak_ptr_factory_(this) {
333 InitializeHistograms(); 334 InitializeHistograms();
334 cookieable_schemes_.insert( 335 cookieable_schemes_.insert(
335 cookieable_schemes_.begin(), kDefaultCookieableSchemes, 336 cookieable_schemes_.begin(), kDefaultCookieableSchemes,
336 kDefaultCookieableSchemes + kDefaultCookieableSchemesCount); 337 kDefaultCookieableSchemes + kDefaultCookieableSchemesCount);
337 } 338 }
338 339
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 it != hook_map_.end(); ++it) { 2340 it != hook_map_.end(); ++it) {
2340 std::pair<GURL, std::string> key = it->first; 2341 std::pair<GURL, std::string> key = it->first;
2341 if (cookie.IncludeForRequestURL(key.first, opts) && 2342 if (cookie.IncludeForRequestURL(key.first, opts) &&
2342 cookie.Name() == key.second) { 2343 cookie.Name() == key.second) {
2343 it->second->Notify(cookie, removed); 2344 it->second->Notify(cookie, removed);
2344 } 2345 }
2345 } 2346 }
2346 } 2347 }
2347 2348
2348 } // namespace net 2349 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/cookie_monster.h ('k') | net/cookies/cookie_monster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698