Chromium Code Reviews| 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 54% |
| copy from content/browser/net/sqlite_persistent_cookie_store.h |
| copy to content/browser/net/quota_policy_cookie_store.h |
| index 09835ba6216373e436d6b7ce399b43586815fc3e..4d466ad23cb9bed1f55f8446fbf0f5dd26be63e8 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. |
|
Ryan Sleevi
2015/05/06 00:44:18
no (c)
rohitrao (ping after 24h)
2015/05/11 19:25:30
Done.
|
| // 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. |
| +// A cookie monster persistent store that deletes session cookies on shutdown. |
| -#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; |
| @@ -34,18 +35,18 @@ class SpecialStoragePolicy; |
| namespace content { |
| -// Implements the PersistentCookieStore interface in terms of a SQLite database. |
| -// For documentation about the actual member functions consult the documentation |
| -// 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 |
| +// Implements a PersistentCookieStore that deletes session cookies on |
| +// shutdown. For documentation about the actual member functions consult 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 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,24 @@ 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); |
|
Ryan Sleevi
2015/05/06 00:44:18
Document?
rohitrao (ping after 24h)
2015/05/11 19:25:30
Done.
|
| + |
| + // Map of (domain keys(eTLD+1), is secure cookie) to number of cookies in the |
| + // database. |
| + typedef std::map<net::SQLitePersistentCookieStore::CookieOrigin, int> |
|
Ryan Sleevi
2015/05/06 00:44:18
int? not size_t?
rohitrao (ping after 24h)
2015/05/11 19:25:30
Done.
|
| + CookiesPerOriginMap; |
| + CookiesPerOriginMap cookies_per_origin_; |
| - scoped_refptr<Backend> backend_; |
| + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
| + scoped_refptr<net::SQLitePersistentCookieStore> persistent_store_; |
| - DISALLOW_COPY_AND_ASSIGN(SQLitePersistentCookieStore); |
| + 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_ |