diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 15:22:15 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 15:22:15 +0000 |
commit | 10b691f4261e09a0c824ecec44f37ac74fc4dcec (patch) | |
tree | 4f00f2cb6a58eb23c04b1f231367d4810229d835 /chrome/browser/net | |
parent | 7afca868e97f8228878fc6d3db9194c5596ecf22 (diff) | |
download | chromium_src-10b691f4261e09a0c824ecec44f37ac74fc4dcec.zip chromium_src-10b691f4261e09a0c824ecec44f37ac74fc4dcec.tar.gz chromium_src-10b691f4261e09a0c824ecec44f37ac74fc4dcec.tar.bz2 |
Remove the force_session cookie option, as it's not used anymore
BUG=133903
TEST=none
TBR=sky@chromium.org,wtc@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10694093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146121 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
3 files changed, 22 insertions, 45 deletions
diff --git a/chrome/browser/net/sqlite_persistent_cookie_store.cc b/chrome/browser/net/sqlite_persistent_cookie_store.cc index 33ddb35..1d7f241 100644 --- a/chrome/browser/net/sqlite_persistent_cookie_store.cc +++ b/chrome/browser/net/sqlite_persistent_cookie_store.cc @@ -253,7 +253,7 @@ class SQLitePersistentCookieStore::Backend // database can store session cookies as well as persistent cookies. Databases // of version 5 are incompatible with older versions of code. If a database of // version 5 is read by older code, session cookies will be treated as normal -// cookies. +// cookies. Currently, these fields are written, but not read anymore. // // In version 4, we migrated the time epoch. If you open the DB with an older // version on Mac or Linux, the times will look wonky, but the file will likely @@ -627,9 +627,7 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains( Time::FromInternalValue(smt.ColumnInt64(5)), // expires_utc Time::FromInternalValue(smt.ColumnInt64(8)), // last_access_utc smt.ColumnInt(6) != 0, // secure - smt.ColumnInt(7) != 0, // httponly - smt.ColumnInt(9) != 0, // has_expires - smt.ColumnInt(10) != 0)); // is_persistent + smt.ColumnInt(7) != 0)); // httponly DLOG_IF(WARNING, cc->CreationDate() > Time::Now()) << L"CreationDate too recent"; cookies_per_origin_[CookieOrigin(cc->Domain(), cc->IsSecure())]++; @@ -854,7 +852,7 @@ void SQLitePersistentCookieStore::Backend::Commit() { add_smt.BindInt(6, po->cc().IsSecure()); add_smt.BindInt(7, po->cc().IsHttpOnly()); add_smt.BindInt64(8, po->cc().LastAccessDate().ToInternalValue()); - add_smt.BindInt(9, po->cc().DoesExpire()); + add_smt.BindInt(9, po->cc().IsPersistent()); add_smt.BindInt(10, po->cc().IsPersistent()); if (!add_smt.Run()) NOTREACHED() << "Could not add a cookie to the DB."; diff --git a/chrome/browser/net/sqlite_persistent_cookie_store_perftest.cc b/chrome/browser/net/sqlite_persistent_cookie_store_perftest.cc index 8087e13..88d614fc 100644 --- a/chrome/browser/net/sqlite_persistent_cookie_store_perftest.cc +++ b/chrome/browser/net/sqlite_persistent_cookie_store_perftest.cc @@ -65,7 +65,7 @@ class SQLitePersistentCookieStorePerfTest : public testing::Test { net::CookieMonster::CanonicalCookie(gurl, base::StringPrintf("Cookie_%d", cookie_num), "1", domain_name, "/", std::string(), std::string(), - t, t, t, false, false, true, true)); + t, t, t, false, false)); } } // Replace the store effectively destroying the current one and forcing it diff --git a/chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc b/chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc index 323c7ed..384332d 100644 --- a/chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc +++ b/chrome/browser/net/sqlite_persistent_cookie_store_unittest.cc @@ -99,7 +99,7 @@ class SQLitePersistentCookieStoreTest : public testing::Test { CookieMonster::CanonicalCookie(GURL(), name, value, domain, path, std::string(), std::string(), creation, creation, creation, - false, false, true, true)); + false, false)); } virtual void SetUp() { @@ -335,8 +335,8 @@ TEST_F(SQLitePersistentCookieStoreTest, TestLoadOldSessionCookies) { store_->AddCookie( CookieMonster::CanonicalCookie( GURL(), "C", "D", "sessioncookie.com", "/", std::string(), - std::string(), base::Time::Now(), base::Time::Now(), - base::Time::Now(), false, false, true, false /*is_persistent*/)); + std::string(), base::Time::Now(), base::Time(), + base::Time::Now(), false, false)); // Force the store to write its data to the disk. DestroyStore(); @@ -362,8 +362,8 @@ TEST_F(SQLitePersistentCookieStoreTest, TestDontLoadOldSessionCookies) { store_->AddCookie( CookieMonster::CanonicalCookie( GURL(), "C", "D", "sessioncookie.com", "/", std::string(), - std::string(), base::Time::Now(), base::Time::Now(), - base::Time::Now(), false, false, true, false /*is_persistent*/)); + std::string(), base::Time::Now(), base::Time(), + base::Time::Now(), false, false)); // Force the store to write its data to the disk. DestroyStore(); @@ -384,45 +384,31 @@ TEST_F(SQLitePersistentCookieStoreTest, TestDontLoadOldSessionCookies) { ASSERT_EQ(0U, cookies.size()); } -TEST_F(SQLitePersistentCookieStoreTest, PersistHasExpiresAndIsPersistent) { +TEST_F(SQLitePersistentCookieStoreTest, PersistIsPersistent) { InitializeStore(true); - static const char kSessionHasExpiresName[] = "session-hasexpires"; - static const char kSessionNoExpiresName[] = "session-noexpires"; + static const char kSessionName[] = "session"; static const char kPersistentName[] = "persistent"; - // Add a session cookie with has_expires = false, and another session cookie - // with has_expires = true. - store_->AddCookie( - CookieMonster::CanonicalCookie( - GURL(), kSessionHasExpiresName, "val", "sessioncookie.com", "/", - std::string(), std::string(), - base::Time::Now() - base::TimeDelta::FromDays(3), base::Time::Now(), - base::Time::Now(), false, false, true /* has_expires */, - false /* is_persistent */)); + // Add a session cookie. store_->AddCookie( CookieMonster::CanonicalCookie( - GURL(), kSessionNoExpiresName, "val", "sessioncookie.com", "/", + GURL(), kSessionName, "val", "sessioncookie.com", "/", std::string(), std::string(), - base::Time::Now() - base::TimeDelta::FromDays(2), base::Time::Now(), - base::Time::Now(), false, false, false /* has_expires */, - false /* is_persistent */)); + base::Time::Now(), base::Time(), base::Time::Now(), + false, false)); // Add a persistent cookie. store_->AddCookie( CookieMonster::CanonicalCookie( GURL(), kPersistentName, "val", "sessioncookie.com", "/", std::string(), std::string(), base::Time::Now() - base::TimeDelta::FromDays(1), base::Time::Now(), - base::Time::Now(), false, false, true /* has_expires */, - true /* is_persistent */)); + base::Time::Now(), false, false)); - // Force the store to write its data to the disk. - DestroyStore(); - - // Create a store that loads session cookies and test that the the DoesExpire - // and IsPersistent attributes are restored. + // Create a store that loads session cookie and test that the the IsPersistent + // attribute is restored. CanonicalCookieVector cookies; CreateAndLoad(true, &cookies); - ASSERT_EQ(3U, cookies.size()); + ASSERT_EQ(2U, cookies.size()); std::map<std::string, CookieMonster::CanonicalCookie*> cookie_map; for (CanonicalCookieVector::const_iterator it = cookies.begin(); @@ -432,19 +418,12 @@ TEST_F(SQLitePersistentCookieStoreTest, PersistHasExpiresAndIsPersistent) { } std::map<std::string, CookieMonster::CanonicalCookie*>::const_iterator it = - cookie_map.find(kSessionHasExpiresName); - ASSERT_TRUE(it != cookie_map.end()); - EXPECT_TRUE(cookie_map[kSessionHasExpiresName]->DoesExpire()); - EXPECT_FALSE(cookie_map[kSessionHasExpiresName]->IsPersistent()); - - it = cookie_map.find(kSessionNoExpiresName); + cookie_map.find(kSessionName); ASSERT_TRUE(it != cookie_map.end()); - EXPECT_FALSE(cookie_map[kSessionNoExpiresName]->DoesExpire()); - EXPECT_FALSE(cookie_map[kSessionNoExpiresName]->IsPersistent()); + EXPECT_FALSE(cookie_map[kSessionName]->IsPersistent()); it = cookie_map.find(kPersistentName); ASSERT_TRUE(it != cookie_map.end()); - EXPECT_TRUE(cookie_map[kPersistentName]->DoesExpire()); EXPECT_TRUE(cookie_map[kPersistentName]->IsPersistent()); STLDeleteElements(&cookies); @@ -506,7 +485,7 @@ TEST_F(SQLitePersistentCookieStoreTest, TestClearOnExitPolicy) { CookieMonster::CanonicalCookie(GURL(), "D", "4", session_origin, "/", std::string(), std::string(), t, t, t, - true, false, true, true)); + true, false)); // First, check that we can override the policy. store_->SetForceKeepSessionState(); |