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" | |
10 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
11 #include "webkit/browser/quota/special_storage_policy.h" | 9 #include "net/cookies/cookie_monster.h" |
12 | 10 |
13 namespace base { | 11 namespace base { |
14 class FilePath; | 12 class FilePath; |
15 } | 13 } |
16 | 14 |
17 namespace net { | 15 namespace quota { |
18 class CookieMonsterDelegate; | 16 class SpecialStoragePolicy; |
19 class CookieStore; | |
20 } | 17 } |
21 | 18 |
22 namespace content { | 19 namespace content { |
23 | 20 |
24 struct CONTENT_EXPORT CookieStoreConfig { | 21 CONTENT_EXPORT net::CookieStore* CreatePersistentCookieStore( |
25 // Specifies how session cookies are persisted in the backing data store. | 22 const base::FilePath& path, |
26 enum SessionCookieMode { | 23 bool restore_old_session_cookies, |
27 EPHEMERAL_SESSION_COOKIES, | 24 quota::SpecialStoragePolicy* storage_policy, |
28 PERSISTANT_SESSION_COOKIES, | 25 net::CookieMonster::Delegate* cookie_monster_delegate); |
29 RESTORED_SESSION_COOKIES | |
30 }; | |
31 | |
32 // If |path| is empty, then this specifies an in-memory cookie store. | |
33 // With in-memory cookie stores, |session_cookie_mode| must be | |
34 // EPHEMERAL_SESSION_COOKIES. | |
35 CookieStoreConfig(); | |
36 CookieStoreConfig(const base::FilePath& path, | |
37 SessionCookieMode session_cookie_mode, | |
38 quota::SpecialStoragePolicy* storage_policy, | |
39 net::CookieMonsterDelegate* cookie_delegate); | |
40 ~CookieStoreConfig(); | |
41 | |
42 base::FilePath path; | |
43 SessionCookieMode session_cookie_mode; | |
44 scoped_refptr<quota::SpecialStoragePolicy> storage_policy; | |
45 scoped_refptr<net::CookieMonsterDelegate> cookie_delegate; | |
46 }; | |
47 | |
48 CONTENT_EXPORT net::CookieStore* CreateCookieStore( | |
49 const CookieStoreConfig& config); | |
50 | 26 |
51 } // namespace content | 27 } // namespace content |
52 | 28 |
53 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 29 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
OLD | NEW |