summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 09:06:26 +0000
committerqsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 09:06:26 +0000
commitb236b7d16f95e23ef0301c2fa6ab7badec02af21 (patch)
tree9366469d6ed9876ef81e255919e737d18a92aa3b /net/base
parentd18afeae0ed73c72e941860f25d345bc3a4004b0 (diff)
downloadchromium_src-b236b7d16f95e23ef0301c2fa6ab7badec02af21.zip
chromium_src-b236b7d16f95e23ef0301c2fa6ab7badec02af21.tar.gz
chromium_src-b236b7d16f95e23ef0301c2fa6ab7badec02af21.tar.bz2
Refactor CookieStore to allow BrowsingDataRemover to depend on it.
This allows to remove the dependency from BrowsingDataRemover to CookieMonster. BUG=none TEST=none Review URL: http://codereview.chromium.org/9004016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r--net/base/cookie_monster.h16
-rw-r--r--net/base/cookie_store.h8
-rw-r--r--net/base/cookie_store_test_helpers.cc7
-rw-r--r--net/base/cookie_store_test_helpers.h5
4 files changed, 28 insertions, 8 deletions
diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h
index d8efa37..b22578f 100644
--- a/net/base/cookie_monster.h
+++ b/net/base/cookie_monster.h
@@ -150,7 +150,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
bool InitializeFrom(const CookieList& list);
typedef base::Callback<void(const CookieList& cookies)> GetCookieListCallback;
- typedef base::Callback<void(int num_deleted)> DeleteCallback;
typedef base::Callback<void(bool success)> DeleteCookieCallback;
// Sets a cookie given explicit user-provided cookie attributes. The cookie
@@ -193,13 +192,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
// Deletes all of the cookies.
void DeleteAllAsync(const DeleteCallback& callback);
- // Deletes all of the cookies that have a creation_date greater than or equal
- // to |delete_begin| and less than |delete_end|
- // Returns the number of cookies that have been deleted.
- void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
- const base::Time& delete_end,
- const DeleteCallback& callback);
-
// Deletes all cookies that match the host of the given URL
// regardless of path. This includes all http_only and secure cookies,
// but does not include any domain cookies that may apply to this host.
@@ -274,6 +266,14 @@ class NET_EXPORT CookieMonster : public CookieStore {
const GURL& url, const std::string& cookie_name,
const base::Closure& callback) OVERRIDE;
+ // Deletes all of the cookies that have a creation_date greater than or equal
+ // to |delete_begin| and less than |delete_end|
+ // Returns the number of cookies that have been deleted.
+ virtual void DeleteAllCreatedBetweenAsync(
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) OVERRIDE;
+
virtual CookieMonster* GetCookieMonster() OVERRIDE;
// Enables writing session cookies into the cookie database. If this this
diff --git a/net/base/cookie_store.h b/net/base/cookie_store.h
index 873d88b..0336a9b 100644
--- a/net/base/cookie_store.h
+++ b/net/base/cookie_store.h
@@ -54,6 +54,7 @@ class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
typedef base::Callback<void(const std::string& cookie)>
GetCookiesCallback;
typedef base::Callback<void(bool success)> SetCookiesCallback;
+ typedef base::Callback<void(int num_deleted)> DeleteCallback;
// Sets a single cookie. Expects a cookie line, like "a=1; domain=b.com".
@@ -91,6 +92,13 @@ class NET_EXPORT CookieStore : public base::RefCountedThreadSafe<CookieStore> {
const std::string& cookie_name,
const base::Closure& callback) = 0;
+ // Deletes all of the cookies that have a creation_date greater than or equal
+ // to |delete_begin| and less than |delete_end|
+ // Returns the number of cookies that have been deleted.
+ virtual void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) = 0;
+
// Returns the underlying CookieMonster.
virtual CookieMonster* GetCookieMonster() = 0;
diff --git a/net/base/cookie_store_test_helpers.cc b/net/base/cookie_store_test_helpers.cc
index 7a69117..afc5c67 100644
--- a/net/base/cookie_store_test_helpers.cc
+++ b/net/base/cookie_store_test_helpers.cc
@@ -140,6 +140,13 @@ void DelayedCookieMonster::DeleteCookieAsync(const GURL& url,
ADD_FAILURE();
}
+void DelayedCookieMonster::DeleteAllCreatedBetweenAsync(
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) {
+ ADD_FAILURE();
+}
+
CookieMonster* DelayedCookieMonster::GetCookieMonster() {
return cookie_monster_;
}
diff --git a/net/base/cookie_store_test_helpers.h b/net/base/cookie_store_test_helpers.h
index 14b353b..de9f575 100644
--- a/net/base/cookie_store_test_helpers.h
+++ b/net/base/cookie_store_test_helpers.h
@@ -58,6 +58,11 @@ class DelayedCookieMonster : public CookieStore {
const std::string& cookie_name,
const base::Closure& callback) OVERRIDE;
+ virtual void DeleteAllCreatedBetweenAsync(
+ const base::Time& delete_begin,
+ const base::Time& delete_end,
+ const DeleteCallback& callback) OVERRIDE;
+
virtual CookieMonster* GetCookieMonster() OVERRIDE;
private: