OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ | 5 #ifndef NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ |
6 #define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ | 6 #define NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ |
7 | 7 |
8 #include "net/cookies/cookie_monster.h" | 8 #include "net/cookies/cookie_monster.h" |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 27 matching lines...) Expand all Loading... |
38 const GURL& url, | 38 const GURL& url, |
39 const GetCookieListCallback& callback) OVERRIDE; | 39 const GetCookieListCallback& callback) OVERRIDE; |
40 | 40 |
41 virtual bool SetCookieWithOptions(const GURL& url, | 41 virtual bool SetCookieWithOptions(const GURL& url, |
42 const std::string& cookie_line, | 42 const std::string& cookie_line, |
43 const CookieOptions& options); | 43 const CookieOptions& options); |
44 | 44 |
45 virtual std::string GetCookiesWithOptions(const GURL& url, | 45 virtual std::string GetCookiesWithOptions(const GURL& url, |
46 const CookieOptions& options); | 46 const CookieOptions& options); |
47 | 47 |
48 virtual void DeleteCookie(const GURL& url, | 48 virtual void DeleteCookie(const GURL& url, const std::string& cookie_name); |
49 const std::string& cookie_name); | |
50 | 49 |
51 virtual void DeleteCookieAsync(const GURL& url, | 50 virtual void DeleteCookieAsync(const GURL& url, |
52 const std::string& cookie_name, | 51 const std::string& cookie_name, |
53 const base::Closure& callback) OVERRIDE; | 52 const base::Closure& callback) OVERRIDE; |
54 | 53 |
55 virtual void DeleteAllCreatedBetweenAsync( | 54 virtual void DeleteAllCreatedBetweenAsync( |
56 const base::Time& delete_begin, | 55 const base::Time& delete_begin, |
57 const base::Time& delete_end, | 56 const base::Time& delete_end, |
58 const DeleteCallback& callback) OVERRIDE; | 57 const DeleteCallback& callback) OVERRIDE; |
59 | 58 |
60 virtual void DeleteAllCreatedBetweenForHostAsync( | 59 virtual void DeleteAllCreatedBetweenForHostAsync( |
61 const base::Time delete_begin, | 60 const base::Time delete_begin, |
62 const base::Time delete_end, | 61 const base::Time delete_end, |
63 const GURL& url, | 62 const GURL& url, |
64 const DeleteCallback& callback) OVERRIDE; | 63 const DeleteCallback& callback) OVERRIDE; |
65 | 64 |
66 virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE; | 65 virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE; |
67 | 66 |
68 virtual CookieMonster* GetCookieMonster() OVERRIDE; | 67 virtual CookieMonster* GetCookieMonster() OVERRIDE; |
69 | 68 |
70 private: | 69 private: |
71 | |
72 // Be called immediately from CookieMonster. | 70 // Be called immediately from CookieMonster. |
73 | 71 |
74 void SetCookiesInternalCallback(bool result); | 72 void SetCookiesInternalCallback(bool result); |
75 | 73 |
76 void GetCookiesWithOptionsInternalCallback(const std::string& cookie); | 74 void GetCookiesWithOptionsInternalCallback(const std::string& cookie); |
77 | 75 |
78 // Invoke the original callbacks. | 76 // Invoke the original callbacks. |
79 | 77 |
80 void InvokeSetCookiesCallback( | 78 void InvokeSetCookiesCallback( |
81 const CookieMonster::SetCookiesCallback& callback); | 79 const CookieMonster::SetCookiesCallback& callback); |
82 | 80 |
83 void InvokeGetCookieStringCallback( | 81 void InvokeGetCookieStringCallback( |
84 const CookieMonster::GetCookiesCallback& callback); | 82 const CookieMonster::GetCookiesCallback& callback); |
85 | 83 |
86 friend class base::RefCountedThreadSafe<DelayedCookieMonster>; | 84 friend class base::RefCountedThreadSafe<DelayedCookieMonster>; |
87 virtual ~DelayedCookieMonster(); | 85 virtual ~DelayedCookieMonster(); |
88 | 86 |
89 scoped_refptr<CookieMonster> cookie_monster_; | 87 scoped_refptr<CookieMonster> cookie_monster_; |
90 | 88 |
91 bool did_run_; | 89 bool did_run_; |
92 bool result_; | 90 bool result_; |
93 std::string cookie_; | 91 std::string cookie_; |
94 std::string cookie_line_; | 92 std::string cookie_line_; |
95 }; | 93 }; |
96 | 94 |
97 } // namespace net | 95 } // namespace net |
98 | 96 |
99 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ | 97 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ |
OLD | NEW |