Index: net/base/cookie_monster_store_test.cc |
=================================================================== |
--- net/base/cookie_monster_store_test.cc (revision 100188) |
+++ net/base/cookie_monster_store_test.cc (working copy) |
@@ -80,7 +80,18 @@ |
const std::string& cookie_line, |
const base::Time& creation_time, |
std::vector<CookieMonster::CanonicalCookie*>* out_list) { |
+ scoped_ptr<CookieMonster::CanonicalCookie> cookie( |
+ new CookieMonster::CanonicalCookie( |
+ BuildCanonicalCookie(key, cookie_line, creation_time))); |
+ out_list->push_back(cookie.release()); |
+} |
+ |
+CookieMonster::CanonicalCookie BuildCanonicalCookie( |
+ const std::string& key, |
+ const std::string& cookie_line, |
+ const base::Time& creation_time) { |
+ |
// Parse the cookie line. |
CookieMonster::ParsedCookie pc(cookie_line); |
EXPECT_TRUE(pc.IsValid()); |
@@ -94,15 +105,12 @@ |
CookieMonster::ParseCookieTime(pc.Expires()) : base::Time(); |
std::string cookie_path = pc.Path(); |
- scoped_ptr<CookieMonster::CanonicalCookie> cookie( |
- new CookieMonster::CanonicalCookie( |
- GURL(), pc.Name(), pc.Value(), key, cookie_path, |
- pc.MACKey(), pc.MACAlgorithm(), |
- creation_time, creation_time, cookie_expires, |
- pc.IsSecure(), pc.IsHttpOnly(), |
- !cookie_expires.is_null())); |
- |
- out_list->push_back(cookie.release()); |
+ return CookieMonster::CanonicalCookie( |
+ GURL(), pc.Name(), pc.Value(), key, cookie_path, |
+ pc.MACKey(), pc.MACAlgorithm(), |
+ creation_time, creation_time, cookie_expires, |
+ pc.IsSecure(), pc.IsHttpOnly(), |
+ !cookie_expires.is_null()); |
} |
MockSimplePersistentCookieStore::MockSimplePersistentCookieStore() {} |