Index: content/browser/net/quota_policy_cookie_store.h |
diff --git a/content/browser/net/sqlite_persistent_cookie_store.h b/content/browser/net/quota_policy_cookie_store.h |
similarity index 68% |
copy from content/browser/net/sqlite_persistent_cookie_store.h |
copy to content/browser/net/quota_policy_cookie_store.h |
index 09835ba6216373e436d6b7ce399b43586815fc3e..f6c50a4e0189cf785c1b63874bc3dcb7ab38f7de 100644 |
--- a/content/browser/net/sqlite_persistent_cookie_store.h |
+++ b/content/browser/net/quota_policy_cookie_store.h |
@@ -1,11 +1,11 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
// A sqlite implementation of a cookie monster persistent store. |
-#ifndef CONTENT_BROWSER_NET_SQLITE_PERSISTENT_COOKIE_STORE_H_ |
-#define CONTENT_BROWSER_NET_SQLITE_PERSISTENT_COOKIE_STORE_H_ |
+#ifndef CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |
+#define CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |
#include <string> |
#include <vector> |
@@ -15,6 +15,7 @@ |
#include "base/memory/ref_counted.h" |
#include "content/common/content_export.h" |
#include "net/cookies/cookie_monster.h" |
+#include "net/extras/sqlite/sqlite_persistent_cookie_store.h" |
class Task; |
@@ -39,13 +40,13 @@ namespace content { |
// of the parent class |net::CookieMonster::PersistentCookieStore|. |
// If provided, a |SpecialStoragePolicy| is consulted when the SQLite database |
// is closed to decide which cookies to keep. |
-class CONTENT_EXPORT SQLitePersistentCookieStore |
+class CONTENT_EXPORT QuotaPolicyCookieStore |
: public net::CookieMonster::PersistentCookieStore { |
public: |
// All blocking database accesses will be performed on |
// |background_task_runner|, while |client_task_runner| is used to invoke |
// callbacks. |
- SQLitePersistentCookieStore( |
+ QuotaPolicyCookieStore( |
const base::FilePath& path, |
const scoped_refptr<base::SequencedTaskRunner>& client_task_runner, |
const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
@@ -63,17 +64,23 @@ class CONTENT_EXPORT SQLitePersistentCookieStore |
void SetForceKeepSessionState() override; |
void Flush(const base::Closure& callback) override; |
- protected: |
- ~SQLitePersistentCookieStore() override; |
- |
private: |
- class Backend; |
+ ~QuotaPolicyCookieStore() override; |
+ |
+ void OnLoad(const LoadedCallback& loaded_callback, |
+ const std::vector<net::CanonicalCookie*>& cookies); |
- scoped_refptr<Backend> backend_; |
+ // Map of (domain keys(eTLD+1), is secure cookie) to number of cookies in the |
+ // database. |
+ typedef std::map<net::SQLitePersistentCookieStore::CookieOrigin, int> |
+ CookiesPerOriginMap; |
+ CookiesPerOriginMap cookies_per_origin_; |
- DISALLOW_COPY_AND_ASSIGN(SQLitePersistentCookieStore); |
+ scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
+ scoped_refptr<net::SQLitePersistentCookieStore> persistent_store_; |
+ DISALLOW_COPY_AND_ASSIGN(QuotaPolicyCookieStore); |
}; |
} // namespace content |
-#endif // CONTENT_BROWSER_NET_SQLITE_PERSISTENT_COOKIE_STORE_H_ |
+#endif // CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_ |