summaryrefslogtreecommitdiffstats
path: root/ios/net
diff options
context:
space:
mode:
Diffstat (limited to 'ios/net')
-rw-r--r--ios/net/cookies/cookie_store_ios.h5
-rw-r--r--ios/net/cookies/cookie_store_ios.mm28
-rw-r--r--ios/net/cookies/cookie_store_ios_unittest.mm10
3 files changed, 23 insertions, 20 deletions
diff --git a/ios/net/cookies/cookie_store_ios.h b/ios/net/cookies/cookie_store_ios.h
index 6d34c67..36f92e3 100644
--- a/ios/net/cookies/cookie_store_ios.h
+++ b/ios/net/cookies/cookie_store_ios.h
@@ -124,8 +124,9 @@ class CookieStoreIOS : public net::CookieStore,
const std::string& value,
const std::string& domain,
const std::string& path,
- const base::Time creation_time,
- const base::Time expiration_time,
+ base::Time creation_time,
+ base::Time expiration_time,
+ base::Time last_access_time,
bool secure,
bool http_only,
bool same_site,
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm
index 0162799..519c129 100644
--- a/ios/net/cookies/cookie_store_ios.mm
+++ b/ios/net/cookies/cookie_store_ios.mm
@@ -435,8 +435,9 @@ void CookieStoreIOS::SetCookieWithDetailsAsync(
const std::string& value,
const std::string& domain,
const std::string& path,
- const base::Time creation_time,
- const base::Time expiration_time,
+ base::Time creation_time,
+ base::Time expiration_time,
+ base::Time last_access_time,
bool secure,
bool http_only,
bool same_site,
@@ -449,15 +450,15 @@ void CookieStoreIOS::SetCookieWithDetailsAsync(
case NOT_SYNCHRONIZED:
cookie_monster_->SetCookieWithDetailsAsync(
url, name, value, domain, path, creation_time, expiration_time,
- secure, http_only, same_site, enforce_strict_secure, priority,
- WrapSetCallback(callback));
+ last_access_time, secure, http_only, same_site, enforce_strict_secure,
+ priority, WrapSetCallback(callback));
break;
case SYNCHRONIZING:
- tasks_pending_synchronization_.push_back(
- base::Bind(&CookieStoreIOS::SetCookieWithDetailsAsync, this, url,
- name, value, domain, path, creation_time, expiration_time,
- secure, http_only, same_site, enforce_strict_secure,
- priority, WrapSetCallback(callback)));
+ tasks_pending_synchronization_.push_back(base::Bind(
+ &CookieStoreIOS::SetCookieWithDetailsAsync, this, url, name, value,
+ domain, path, creation_time, expiration_time, last_access_time,
+ secure, http_only, same_site, enforce_strict_secure, priority,
+ WrapSetCallback(callback)));
break;
case SYNCHRONIZED:
// If cookies are not allowed, they are stashed in the CookieMonster, and
@@ -466,6 +467,9 @@ void CookieStoreIOS::SetCookieWithDetailsAsync(
bool success = false;
+ if (creation_time.is_null())
+ creation_time = base::Time::Now();
+
// First create a CanonicalCookie, to normalize the arguments,
// particularly domain and path, and perform validation.
scoped_ptr<net::CanonicalCookie> canonical_cookie =
@@ -480,13 +484,9 @@ void CookieStoreIOS::SetCookieWithDetailsAsync(
if (cookie != nil) {
[system_store_ setCookie:cookie];
- base::Time base_creation_time = creation_time;
- if (base_creation_time.is_null()) {
- base_creation_time = base::Time::Now();
- }
creation_time_manager_->SetCreationTime(
cookie, creation_time_manager_->MakeUniqueCreationTime(
- base_creation_time));
+ canonical_cookie->CreationDate()));
success = true;
}
}
diff --git a/ios/net/cookies/cookie_store_ios_unittest.mm b/ios/net/cookies/cookie_store_ios_unittest.mm
index 5518c60..41319a8 100644
--- a/ios/net/cookies/cookie_store_ios_unittest.mm
+++ b/ios/net/cookies/cookie_store_ios_unittest.mm
@@ -92,8 +92,9 @@ class RoundTripTestCookieStore : public net::CookieStore {
const std::string& value,
const std::string& domain,
const std::string& path,
- const base::Time creation_time,
- const base::Time expiration_time,
+ base::Time creation_time,
+ base::Time expiration_time,
+ base::Time last_access_time,
bool secure,
bool http_only,
bool same_site,
@@ -102,8 +103,9 @@ class RoundTripTestCookieStore : public net::CookieStore {
const SetCookiesCallback& callback) override {
RoundTrip();
store_->SetCookieWithDetailsAsync(
- url, name, value, domain, path, creation_time, expiration_time, secure,
- http_only, same_site, enforce_strict_secure, priority, callback);
+ url, name, value, domain, path, creation_time, expiration_time,
+ last_access_time, secure, http_only, same_site, enforce_strict_secure,
+ priority, callback);
}
void GetCookiesWithOptionsAsync(const GURL& url,