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

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

Issue 1988343003: Access-time threshold unit failure in CookieMonster. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deconst 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 if (current_priority_level == COOKIE_PRIORITY_LOW) 355 if (current_priority_level == COOKIE_PRIORITY_LOW)
356 return false; 356 return false;
357 357
358 return cookie->Priority() == COOKIE_PRIORITY_LOW; 358 return cookie->Priority() == COOKIE_PRIORITY_LOW;
359 } 359 }
360 360
361 } // namespace 361 } // namespace
362 362
363 CookieMonster::CookieMonster(PersistentCookieStore* store, 363 CookieMonster::CookieMonster(PersistentCookieStore* store,
364 CookieMonsterDelegate* delegate) 364 CookieMonsterDelegate* delegate)
365 : CookieMonster(store, delegate, kDefaultAccessUpdateThresholdSeconds) { 365 : CookieMonster(
366 } 366 store,
367 delegate,
368 base::TimeDelta::FromSeconds(kDefaultAccessUpdateThresholdSeconds)) {}
367 369
368 CookieMonster::CookieMonster(PersistentCookieStore* store, 370 CookieMonster::CookieMonster(PersistentCookieStore* store,
369 CookieMonsterDelegate* delegate, 371 CookieMonsterDelegate* delegate,
370 int last_access_threshold_milliseconds) 372 base::TimeDelta last_access_threshold)
371 : initialized_(false), 373 : initialized_(false),
372 started_fetching_all_cookies_(false), 374 started_fetching_all_cookies_(false),
373 finished_fetching_all_cookies_(false), 375 finished_fetching_all_cookies_(false),
374 fetch_strategy_(kUnknownFetch), 376 fetch_strategy_(kUnknownFetch),
375 seen_global_task_(false), 377 seen_global_task_(false),
376 store_(store), 378 store_(store),
377 last_access_threshold_(base::TimeDelta::FromMilliseconds( 379 last_access_threshold_(last_access_threshold),
378 last_access_threshold_milliseconds)),
379 delegate_(delegate), 380 delegate_(delegate),
380 last_statistic_record_time_(base::Time::Now()), 381 last_statistic_record_time_(base::Time::Now()),
381 persist_session_cookies_(false), 382 persist_session_cookies_(false),
382 weak_ptr_factory_(this) { 383 weak_ptr_factory_(this) {
383 InitializeHistograms(); 384 InitializeHistograms();
384 cookieable_schemes_.insert( 385 cookieable_schemes_.insert(
385 cookieable_schemes_.begin(), kDefaultCookieableSchemes, 386 cookieable_schemes_.begin(), kDefaultCookieableSchemes,
386 kDefaultCookieableSchemes + kDefaultCookieableSchemesCount); 387 kDefaultCookieableSchemes + kDefaultCookieableSchemesCount);
387 } 388 }
388 389
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 it != hook_map_.end(); ++it) { 2427 it != hook_map_.end(); ++it) {
2427 std::pair<GURL, std::string> key = it->first; 2428 std::pair<GURL, std::string> key = it->first;
2428 if (cookie.IncludeForRequestURL(key.first, opts) && 2429 if (cookie.IncludeForRequestURL(key.first, opts) &&
2429 cookie.Name() == key.second) { 2430 cookie.Name() == key.second) {
2430 it->second->Notify(cookie, removed); 2431 it->second->Notify(cookie, removed);
2431 } 2432 }
2432 } 2433 }
2433 } 2434 }
2434 2435
2435 } // namespace net 2436 } // 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