| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void DeleteAllCreatedBetweenWithPredicateAsync( | 82 void DeleteAllCreatedBetweenWithPredicateAsync( |
| 83 const base::Time& delete_begin, | 83 const base::Time& delete_begin, |
| 84 const base::Time& delete_end, | 84 const base::Time& delete_end, |
| 85 const base::Callback<bool(const CanonicalCookie&)>& predicate, | 85 const base::Callback<bool(const CanonicalCookie&)>& predicate, |
| 86 const DeleteCallback& callback) override; | 86 const DeleteCallback& callback) override; |
| 87 | 87 |
| 88 void DeleteSessionCookiesAsync(const DeleteCallback&) override; | 88 void DeleteSessionCookiesAsync(const DeleteCallback&) override; |
| 89 | 89 |
| 90 void FlushStore(const base::Closure& callback) override; | 90 void FlushStore(const base::Closure& callback) override; |
| 91 | 91 |
| 92 scoped_ptr<CookieStore::CookieChangedSubscription> | 92 std::unique_ptr<CookieStore::CookieChangedSubscription> AddCallbackForCookie( |
| 93 AddCallbackForCookie(const GURL& url, const std::string& name, | 93 const GURL& url, |
| 94 const CookieChangedCallback& callback) override; | 94 const std::string& name, |
| 95 const CookieChangedCallback& callback) override; |
| 95 | 96 |
| 96 bool IsEphemeral() override; | 97 bool IsEphemeral() override; |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 // Be called immediately from CookieMonster. | 100 // Be called immediately from CookieMonster. |
| 100 | 101 |
| 101 void SetCookiesInternalCallback(bool result); | 102 void SetCookiesInternalCallback(bool result); |
| 102 | 103 |
| 103 void GetCookiesWithOptionsInternalCallback(const std::string& cookie); | 104 void GetCookiesWithOptionsInternalCallback(const std::string& cookie); |
| 104 void GetCookieListWithOptionsInternalCallback(const CookieList& cookie); | 105 void GetCookieListWithOptionsInternalCallback(const CookieList& cookie); |
| 105 | 106 |
| 106 // Invoke the original callbacks. | 107 // Invoke the original callbacks. |
| 107 | 108 |
| 108 void InvokeSetCookiesCallback( | 109 void InvokeSetCookiesCallback( |
| 109 const CookieMonster::SetCookiesCallback& callback); | 110 const CookieMonster::SetCookiesCallback& callback); |
| 110 | 111 |
| 111 void InvokeGetCookieStringCallback( | 112 void InvokeGetCookieStringCallback( |
| 112 const CookieMonster::GetCookiesCallback& callback); | 113 const CookieMonster::GetCookiesCallback& callback); |
| 113 | 114 |
| 114 void InvokeGetCookieListCallback( | 115 void InvokeGetCookieListCallback( |
| 115 const CookieMonster::GetCookieListCallback& callback); | 116 const CookieMonster::GetCookieListCallback& callback); |
| 116 | 117 |
| 117 friend class base::RefCountedThreadSafe<DelayedCookieMonster>; | 118 friend class base::RefCountedThreadSafe<DelayedCookieMonster>; |
| 118 | 119 |
| 119 scoped_ptr<CookieMonster> cookie_monster_; | 120 std::unique_ptr<CookieMonster> cookie_monster_; |
| 120 | 121 |
| 121 bool did_run_; | 122 bool did_run_; |
| 122 bool result_; | 123 bool result_; |
| 123 std::string cookie_; | 124 std::string cookie_; |
| 124 std::string cookie_line_; | 125 std::string cookie_line_; |
| 125 CookieList cookie_list_; | 126 CookieList cookie_list_; |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 class CookieURLHelper { | 129 class CookieURLHelper { |
| 129 public: | 130 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 141 | 142 |
| 142 private: | 143 private: |
| 143 const GURL url_; | 144 const GURL url_; |
| 144 const std::string registry_; | 145 const std::string registry_; |
| 145 const std::string domain_and_registry_; | 146 const std::string domain_and_registry_; |
| 146 }; | 147 }; |
| 147 | 148 |
| 148 } // namespace net | 149 } // namespace net |
| 149 | 150 |
| 150 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ | 151 #endif // NET_COOKIES_COOKIE_STORE_TEST_HELPERS_H_ |
| OLD | NEW |