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

Unified Diff: net/cookies/cookie_store.cc

Issue 1844243002: [CookieStore] Upgrading host-based deleting to predicate-based deleting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added android changes Created 4 years, 9 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
Index: net/cookies/cookie_store.cc
diff --git a/net/cookies/cookie_store.cc b/net/cookies/cookie_store.cc
index f1dff9ada436effcb849c6a63b3e87c8553db5d0..eed9d061b508847581e3d6817d07f2d8275f70a0 100644
--- a/net/cookies/cookie_store.cc
+++ b/net/cookies/cookie_store.cc
@@ -4,9 +4,17 @@
#include "net/cookies/cookie_store.h"
+#include "base/bind.h"
+#include "base/callback.h"
#include "net/cookies/cookie_options.h"
namespace net {
+namespace {
+bool DoesCookieMatchHost(const std::string& host,
+ const CanonicalCookie& cookie) {
+ return cookie.IsHostCookie() && cookie.IsDomainMatch(host);
+}
+} // namespace
CookieStore::~CookieStore() {}
@@ -42,6 +50,11 @@ std::string CookieStore::BuildCookieLine(
return cookie_line;
}
+CookieStore::CookiePredicate CookieStore::CreatePredicateForHostCookies(
+ const GURL& url) {
+ return base::Bind(&DoesCookieMatchHost, url.host());
+}
+
void CookieStore::DeleteAllAsync(const DeleteCallback& callback) {
DeleteAllCreatedBetweenAsync(base::Time(), base::Time::Max(), callback);
}

Powered by Google App Engine
This is Rietveld 408576698