diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:30:15 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-19 11:30:15 +0000 |
commit | 9b464b9ca9cebbad516d537a742c2ea9c351a860 (patch) | |
tree | 89ed6c1451b2674d83d9802fd611b000b378426d /net/base/cookie_monster_store_test.cc | |
parent | 9e5154ebd5a3d9bb06cbc8306a4fd555385cb967 (diff) | |
download | chromium_src-9b464b9ca9cebbad516d537a742c2ea9c351a860.zip chromium_src-9b464b9ca9cebbad516d537a742c2ea9c351a860.tar.gz chromium_src-9b464b9ca9cebbad516d537a742c2ea9c351a860.tar.bz2 |
Cleanup: Standardizing argument order for CanonicalCookie constructors.
Also took the opportunity to clarify the flow of CreateMonsterFromStoreForGC by
dropping one of the `for` loops.
BUG=79723
TEST=Compile, run tests, hope nothing breaks.
Review URL: http://codereview.chromium.org/6882007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/cookie_monster_store_test.cc')
-rw-r--r-- | net/base/cookie_monster_store_test.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/net/base/cookie_monster_store_test.cc b/net/base/cookie_monster_store_test.cc index b975c28..3fcaa29 100644 --- a/net/base/cookie_monster_store_test.cc +++ b/net/base/cookie_monster_store_test.cc @@ -95,10 +95,9 @@ void AddCookieToList( scoped_ptr<CookieMonster::CanonicalCookie> cookie( new CookieMonster::CanonicalCookie( GURL(), pc.Name(), pc.Value(), key, cookie_path, + creation_time, creation_time, cookie_expires, pc.IsSecure(), pc.IsHttpOnly(), - creation_time, creation_time, - !cookie_expires.is_null(), - cookie_expires)); + !cookie_expires.is_null())); out_list->push_back(cookie.release()); } @@ -156,19 +155,18 @@ CookieMonster* CreateMonsterFromStoreForGC( scoped_refptr<MockSimplePersistentCookieStore> store( new MockSimplePersistentCookieStore); // Must expire to be persistent - for (int i = 0; i < num_old_cookies; i++) { - CookieMonster::CanonicalCookie cc( - GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), "/path", false, - false, past_creation + base::TimeDelta::FromMicroseconds(i), - current - base::TimeDelta::FromDays(days_old), - true, current + base::TimeDelta::FromDays(30)); - store->AddCookie(cc); - } - for (int i = num_old_cookies; i < num_cookies; i++) { + for (int i = 0; i < num_cookies; i++) { + base::Time creation_time = + past_creation + base::TimeDelta::FromMicroseconds(i); + base::Time expiration_time = current + base::TimeDelta::FromDays(30); + base::Time last_access_time = + (i < num_old_cookies) ? current - base::TimeDelta::FromDays(days_old) : + current; + CookieMonster::CanonicalCookie cc( - GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), "/path", false, - false, past_creation + base::TimeDelta::FromMicroseconds(i), current, - true, current + base::TimeDelta::FromDays(30)); + GURL(), "a", "1", base::StringPrintf("h%05d.izzle", i), "/path", + creation_time, expiration_time, last_access_time, + false, false, true); store->AddCookie(cc); } |