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

Unified Diff: ios/net/cookies/cookie_store_ios.mm

Issue 1666513002: Promote CookieMonster::DeleteCanonicalCookieAsync to CookieStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cookie_monster13
Patch Set: Rebase Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/net/cookies/cookie_store_ios.h ('k') | ios/net/cookies/cookie_store_ios_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/net/cookies/cookie_store_ios.mm
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm
index 519c129a708f34148b88ee5fd804292ab633fe6e..f50f0f8f4298edc3318201b0fd6afcdd72e3a01b 100644
--- a/ios/net/cookies/cookie_store_ios.mm
+++ b/ios/net/cookies/cookie_store_ios.mm
@@ -620,6 +620,29 @@ void CookieStoreIOS::DeleteCookieAsync(const GURL& url,
}
}
+void CookieStoreIOS::DeleteCanonicalCookieAsync(
+ const CanonicalCookie& cookie,
+ const DeleteCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ switch (synchronization_state_) {
+ case NOT_SYNCHRONIZED:
+ cookie_monster_->DeleteCanonicalCookieAsync(cookie,
+ WrapDeleteCallback(callback));
+ break;
+ case SYNCHRONIZING:
+ tasks_pending_synchronization_.push_back(
+ base::Bind(&CookieStoreIOS::DeleteCanonicalCookieAsync, this, cookie,
+ WrapDeleteCallback(callback)));
+ break;
+ case SYNCHRONIZED:
+ // This relies on the fact cookies are given unique creation dates.
+ CookieFilterFunction filter = base::Bind(
+ IsCookieCreatedBetween, cookie.CreationDate(), cookie.CreationDate());
+ DeleteCookiesWithFilter(filter, callback);
+ }
+}
+
// CookieStoreIOS is an implementation of CookieStore which is not a
// CookieMonster. As CookieStore is the main cookie API, a caller of
// GetCookieMonster must handle the case where this returns null.
« no previous file with comments | « ios/net/cookies/cookie_store_ios.h ('k') | ios/net/cookies/cookie_store_ios_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698