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" |
| 9 #include "base/memory/ref_counted.h" |
8 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
9 #include "net/cookies/cookie_monster.h" | 11 #include "webkit/browser/quota/special_storage_policy.h" |
10 | 12 |
11 namespace base { | 13 namespace base { |
12 class FilePath; | 14 class FilePath; |
13 } | 15 } |
14 | 16 |
15 namespace quota { | 17 namespace net { |
16 class SpecialStoragePolicy; | 18 class CookieMonsterDelegate; |
| 19 class CookieStore; |
17 } | 20 } |
18 | 21 |
19 namespace content { | 22 namespace content { |
20 | 23 |
21 CONTENT_EXPORT net::CookieStore* CreatePersistentCookieStore( | 24 struct CONTENT_EXPORT CookieStoreConfig { |
22 const base::FilePath& path, | 25 // Specifies how Session Cookies are persisted. |
23 bool restore_old_session_cookies, | 26 enum SessionCookieMode { |
24 quota::SpecialStoragePolicy* storage_policy, | 27 EPHEMERAL_SESSION_COOKIES, |
25 net::CookieMonster::Delegate* cookie_monster_delegate); | 28 PERSISTANT_SESSION_COOKIES, |
| 29 RESTORED_SESSION_COOKIES |
| 30 }; |
| 31 |
| 32 static CookieStoreConfig InMemory(); |
| 33 static CookieStoreConfig InMemoryWithOptions( |
| 34 quota::SpecialStoragePolicy* storage_policy, |
| 35 net::CookieMonsterDelegate* cookie_delegate); |
| 36 |
| 37 static CookieStoreConfig Persistent(const base::FilePath& path, |
| 38 SessionCookieMode session_cookie_mode); |
| 39 static CookieStoreConfig PersistentWithOptions( |
| 40 const base::FilePath& path, |
| 41 SessionCookieMode session_cookie_mode, |
| 42 quota::SpecialStoragePolicy* storage_policy, |
| 43 net::CookieMonsterDelegate* cookie_delegate); |
| 44 |
| 45 CookieStoreConfig(); |
| 46 ~CookieStoreConfig(); |
| 47 |
| 48 bool in_memory; |
| 49 base::FilePath path; |
| 50 SessionCookieMode session_cookie_mode; |
| 51 scoped_refptr<quota::SpecialStoragePolicy> storage_policy; |
| 52 scoped_refptr<net::CookieMonsterDelegate> cookie_delegate; |
| 53 |
| 54 private: |
| 55 CookieStoreConfig(bool in_memory, const base::FilePath& path, |
| 56 SessionCookieMode session_cookie_mode, |
| 57 quota::SpecialStoragePolicy* storage_policy, |
| 58 net::CookieMonsterDelegate* cookie_delegate); |
| 59 }; |
| 60 |
| 61 CONTENT_EXPORT net::CookieStore* CreateCookieStore( |
| 62 const CookieStoreConfig& config); |
26 | 63 |
27 } // namespace content | 64 } // namespace content |
28 | 65 |
29 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
OLD | NEW |