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

Side by Side Diff: content/browser/net/quota_policy_cookie_store.h

Issue 1016643004: Moves SQLitePersistentCookieStore to net/extras/sqlite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cookies
Patch Set: Review. Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/net/quota_policy_cookie_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_
6 #define CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h"
14 #include "content/common/content_export.h"
15 #include "net/cookies/cookie_monster.h"
16 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
17
18 class Task;
19
20 namespace base {
21 class FilePath;
22 class SequencedTaskRunner;
23 } // namespace base
24
25 namespace net {
26 class CanonicalCookie;
27 class CookieCryptoDelegate;
28 } // namespace net
29
30 namespace storage {
31 class SpecialStoragePolicy;
32 } // namespace storage
33
34 namespace content {
35
36 // Implements a PersistentCookieStore that deletes session cookies on
37 // shutdown. For documentation about the actual member functions consult the
38 // parent class |net::CookieMonster::PersistentCookieStore|. If provided, a
39 // |SpecialStoragePolicy| is consulted when the SQLite database is closed to
40 // decide which cookies to keep.
41 class CONTENT_EXPORT QuotaPolicyCookieStore
42 : public net::CookieMonster::PersistentCookieStore {
43 public:
44 // Wraps the passed-in |cookie_store|.
45 QuotaPolicyCookieStore(
46 const scoped_refptr<net::SQLitePersistentCookieStore>& cookie_store,
47 storage::SpecialStoragePolicy* special_storage_policy);
48
49 // net::CookieMonster::PersistentCookieStore:
50 void Load(const LoadedCallback& loaded_callback) override;
51 void LoadCookiesForKey(const std::string& key,
52 const LoadedCallback& callback) override;
53 void AddCookie(const net::CanonicalCookie& cc) override;
54 void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override;
55 void DeleteCookie(const net::CanonicalCookie& cc) override;
56 void SetForceKeepSessionState() override;
57 void Flush(const base::Closure& callback) override;
58
59 private:
60 typedef std::map<net::SQLitePersistentCookieStore::CookieOrigin, size_t>
61 CookiesPerOriginMap;
62
63 ~QuotaPolicyCookieStore() override;
64
65 // Called after cookies are loaded from the database. Calls |loaded_callback|
66 // when done.
67 void OnLoad(const LoadedCallback& loaded_callback,
68 const std::vector<net::CanonicalCookie*>& cookies);
69
70 // Map of (domain keys(eTLD+1), is secure cookie) to number of cookies in the
71 // database.
72 CookiesPerOriginMap cookies_per_origin_;
73
74 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_;
75 scoped_refptr<net::SQLitePersistentCookieStore> persistent_store_;
76
77 DISALLOW_COPY_AND_ASSIGN(QuotaPolicyCookieStore);
78 };
79
80 } // namespace content
81
82 #endif // CONTENT_BROWSER_NET_QUOTA_POLICY_COOKIE_STORE_H_
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/net/quota_policy_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698