| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // Brought to you by number 42. | 5 // Brought to you by number 42. |
| 6 | 6 |
| 7 #ifndef NET_BASE_COOKIE_STORE_H_ | 7 #ifndef NET_BASE_COOKIE_STORE_H_ |
| 8 #define NET_BASE_COOKIE_STORE_H_ | 8 #define NET_BASE_COOKIE_STORE_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/ref_counted.h" |
| 13 #include "base/time.h" | 14 #include "base/time.h" |
| 14 #include "net/base/cookie_options.h" | 15 #include "net/base/cookie_options.h" |
| 15 | 16 |
| 16 class GURL; | 17 class GURL; |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| 19 | 20 |
| 20 class CookieMonster; | 21 class CookieMonster; |
| 21 | 22 |
| 22 // An interface for storing and retrieving cookies. Implementations need to | 23 // An interface for storing and retrieving cookies. Implementations need to |
| 23 // be therad safe as its methods can be accessed from IO as well as UI threads. | 24 // be thread safe as its methods can be accessed from IO as well as UI threads. |
| 24 class CookieStore { | 25 class CookieStore : public base::RefCountedThreadSafe<CookieStore> { |
| 25 public: | 26 public: |
| 26 virtual ~CookieStore() {} | 27 virtual ~CookieStore() {} |
| 27 | 28 |
| 28 // Set a single cookie. Expects a cookie line, like "a=1; domain=b.com". | 29 // Set a single cookie. Expects a cookie line, like "a=1; domain=b.com". |
| 29 virtual bool SetCookie(const GURL& url, const std::string& cookie_line) = 0; | 30 virtual bool SetCookie(const GURL& url, const std::string& cookie_line) = 0; |
| 30 virtual bool SetCookieWithOptions(const GURL& url, | 31 virtual bool SetCookieWithOptions(const GURL& url, |
| 31 const std::string& cookie_line, | 32 const std::string& cookie_line, |
| 32 const CookieOptions& options) = 0; | 33 const CookieOptions& options) = 0; |
| 33 // Sets a single cookie with a specific creation date. To set a cookie with | 34 // Sets a single cookie with a specific creation date. To set a cookie with |
| 34 // a creation date of Now() use SetCookie() instead (it calls this function | 35 // a creation date of Now() use SetCookie() instead (it calls this function |
| (...skipping 22 matching lines...) Expand all Loading... |
| 57 const CookieOptions& options) = 0; | 58 const CookieOptions& options) = 0; |
| 58 | 59 |
| 59 virtual CookieMonster* GetCookieMonster() { | 60 virtual CookieMonster* GetCookieMonster() { |
| 60 return NULL; | 61 return NULL; |
| 61 }; | 62 }; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace net | 65 } // namespace net |
| 65 | 66 |
| 66 #endif // NET_BASE_COOKIE_STORE_H_ | 67 #endif // NET_BASE_COOKIE_STORE_H_ |
| OLD | NEW |