OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
6 #define CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 6 #define CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class SequencedTaskRunner; | 13 class SequencedTaskRunner; |
14 } | 14 } |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 class CookieMonsterDelegate; | 17 class CookieMonsterDelegate; |
18 class CookieStore; | 18 class CookieStore; |
19 } | 19 } |
20 | 20 |
21 namespace quota { | 21 namespace storage { |
22 class SpecialStoragePolicy; | 22 class SpecialStoragePolicy; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class CookieCryptoDelegate; | 26 class CookieCryptoDelegate; |
27 | 27 |
28 struct CONTENT_EXPORT CookieStoreConfig { | 28 struct CONTENT_EXPORT CookieStoreConfig { |
29 // Specifies how session cookies are persisted in the backing data store. | 29 // Specifies how session cookies are persisted in the backing data store. |
30 // | 30 // |
31 // EPHEMERAL_SESSION_COOKIES specifies session cookies will not be written | 31 // EPHEMERAL_SESSION_COOKIES specifies session cookies will not be written |
(...skipping 17 matching lines...) Expand all Loading... |
49 CookieStoreConfig(); | 49 CookieStoreConfig(); |
50 | 50 |
51 // If |path| is empty, then this specifies an in-memory cookie store. | 51 // If |path| is empty, then this specifies an in-memory cookie store. |
52 // With in-memory cookie stores, |session_cookie_mode| must be | 52 // With in-memory cookie stores, |session_cookie_mode| must be |
53 // EPHEMERAL_SESSION_COOKIES. | 53 // EPHEMERAL_SESSION_COOKIES. |
54 // | 54 // |
55 // Note: If |crypto_delegate| is non-NULL, it must outlive any CookieStores | 55 // Note: If |crypto_delegate| is non-NULL, it must outlive any CookieStores |
56 // created using this config. | 56 // created using this config. |
57 CookieStoreConfig(const base::FilePath& path, | 57 CookieStoreConfig(const base::FilePath& path, |
58 SessionCookieMode session_cookie_mode, | 58 SessionCookieMode session_cookie_mode, |
59 quota::SpecialStoragePolicy* storage_policy, | 59 storage::SpecialStoragePolicy* storage_policy, |
60 net::CookieMonsterDelegate* cookie_delegate); | 60 net::CookieMonsterDelegate* cookie_delegate); |
61 ~CookieStoreConfig(); | 61 ~CookieStoreConfig(); |
62 | 62 |
63 const base::FilePath path; | 63 const base::FilePath path; |
64 const SessionCookieMode session_cookie_mode; | 64 const SessionCookieMode session_cookie_mode; |
65 const scoped_refptr<quota::SpecialStoragePolicy> storage_policy; | 65 const scoped_refptr<storage::SpecialStoragePolicy> storage_policy; |
66 const scoped_refptr<net::CookieMonsterDelegate> cookie_delegate; | 66 const scoped_refptr<net::CookieMonsterDelegate> cookie_delegate; |
67 | 67 |
68 // The following are infrequently used cookie store parameters. | 68 // The following are infrequently used cookie store parameters. |
69 // Rather than clutter the constructor API, these are assigned a default | 69 // Rather than clutter the constructor API, these are assigned a default |
70 // value on CookieStoreConfig construction. Clients should then override | 70 // value on CookieStoreConfig construction. Clients should then override |
71 // them as necessary. | 71 // them as necessary. |
72 | 72 |
73 // Used to provide encryption hooks for the cookie store. The | 73 // Used to provide encryption hooks for the cookie store. The |
74 // CookieCryptoDelegate must outlive any cookie store created with this | 74 // CookieCryptoDelegate must outlive any cookie store created with this |
75 // config. | 75 // config. |
(...skipping 12 matching lines...) Expand all Loading... |
88 // Only used for persistent cookie stores. | 88 // Only used for persistent cookie stores. |
89 scoped_refptr<base::SequencedTaskRunner> background_task_runner; | 89 scoped_refptr<base::SequencedTaskRunner> background_task_runner; |
90 }; | 90 }; |
91 | 91 |
92 CONTENT_EXPORT net::CookieStore* CreateCookieStore( | 92 CONTENT_EXPORT net::CookieStore* CreateCookieStore( |
93 const CookieStoreConfig& config); | 93 const CookieStoreConfig& config); |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
96 | 96 |
97 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 97 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
OLD | NEW |