| 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 in the backing data store. |
| 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 // 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); |
| 26 | 50 |
| 27 } // namespace content | 51 } // namespace content |
| 28 | 52 |
| 29 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ | 53 #endif // CONTENT_PUBLIC_BROWSER_COOKIE_STORE_FACTORY_H_ |
| OLD | NEW |