| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // |cookie_conflict_cb| will be called when a cookie conflict is detected. | 45 // |cookie_conflict_cb| will be called when a cookie conflict is detected. |
| 46 // The callback will be run on the UI thread. | 46 // The callback will be run on the UI thread. |
| 47 PrerenderCookieStore(scoped_refptr<net::CookieMonster> default_cookie_store_, | 47 PrerenderCookieStore(scoped_refptr<net::CookieMonster> default_cookie_store_, |
| 48 const base::Closure& cookie_conflict_cb); | 48 const base::Closure& cookie_conflict_cb); |
| 49 | 49 |
| 50 // CookieStore implementation | 50 // CookieStore implementation |
| 51 virtual void SetCookieWithOptionsAsync( | 51 virtual void SetCookieWithOptionsAsync( |
| 52 const GURL& url, | 52 const GURL& url, |
| 53 const std::string& cookie_line, | 53 const std::string& cookie_line, |
| 54 const net::CookieOptions& options, | 54 const net::CookieOptions& options, |
| 55 const SetCookiesCallback& callback) OVERRIDE; | 55 const SetCookiesCallback& callback) override; |
| 56 | 56 |
| 57 virtual void GetCookiesWithOptionsAsync( | 57 virtual void GetCookiesWithOptionsAsync( |
| 58 const GURL& url, | 58 const GURL& url, |
| 59 const net::CookieOptions& options, | 59 const net::CookieOptions& options, |
| 60 const GetCookiesCallback& callback) OVERRIDE; | 60 const GetCookiesCallback& callback) override; |
| 61 | 61 |
| 62 virtual void GetAllCookiesForURLAsync( | 62 virtual void GetAllCookiesForURLAsync( |
| 63 const GURL& url, | 63 const GURL& url, |
| 64 const GetCookieListCallback& callback) OVERRIDE; | 64 const GetCookieListCallback& callback) override; |
| 65 | 65 |
| 66 virtual void DeleteCookieAsync(const GURL& url, | 66 virtual void DeleteCookieAsync(const GURL& url, |
| 67 const std::string& cookie_name, | 67 const std::string& cookie_name, |
| 68 const base::Closure& callback) OVERRIDE; | 68 const base::Closure& callback) override; |
| 69 | 69 |
| 70 // All the following methods should not be used in the scenarios where | 70 // All the following methods should not be used in the scenarios where |
| 71 // a PrerenderCookieStore is used. This will be checked via NOTREACHED(). | 71 // a PrerenderCookieStore is used. This will be checked via NOTREACHED(). |
| 72 // Should PrerenderCookieStore used in contexts requiring these, they will | 72 // Should PrerenderCookieStore used in contexts requiring these, they will |
| 73 // need to be implemented first. They are only intended to be called on the | 73 // need to be implemented first. They are only intended to be called on the |
| 74 // IO thread. | 74 // IO thread. |
| 75 | 75 |
| 76 virtual void DeleteAllCreatedBetweenAsync( | 76 virtual void DeleteAllCreatedBetweenAsync( |
| 77 const base::Time& delete_begin, | 77 const base::Time& delete_begin, |
| 78 const base::Time& delete_end, | 78 const base::Time& delete_end, |
| 79 const DeleteCallback& callback) OVERRIDE; | 79 const DeleteCallback& callback) override; |
| 80 | 80 |
| 81 virtual void DeleteAllCreatedBetweenForHostAsync( | 81 virtual void DeleteAllCreatedBetweenForHostAsync( |
| 82 const base::Time delete_begin, | 82 const base::Time delete_begin, |
| 83 const base::Time delete_end, | 83 const base::Time delete_end, |
| 84 const GURL& url, | 84 const GURL& url, |
| 85 const DeleteCallback& callback) OVERRIDE; | 85 const DeleteCallback& callback) override; |
| 86 | 86 |
| 87 virtual void DeleteSessionCookiesAsync(const DeleteCallback&) OVERRIDE; | 87 virtual void DeleteSessionCookiesAsync(const DeleteCallback&) override; |
| 88 | 88 |
| 89 virtual net::CookieMonster* GetCookieMonster() OVERRIDE; | 89 virtual net::CookieMonster* GetCookieMonster() override; |
| 90 | 90 |
| 91 // Commits the changes made to the underlying cookie store, and switches | 91 // Commits the changes made to the underlying cookie store, and switches |
| 92 // into forwarding mode. To be called on the IO thread. | 92 // into forwarding mode. To be called on the IO thread. |
| 93 // |cookie_change_urls| will be populated with all URLs for which cookies | 93 // |cookie_change_urls| will be populated with all URLs for which cookies |
| 94 // were updated. | 94 // were updated. |
| 95 void ApplyChanges(std::vector<GURL>* cookie_change_urls); | 95 void ApplyChanges(std::vector<GURL>* cookie_change_urls); |
| 96 | 96 |
| 97 // Called when a cookie for a URL is changed in the underlying default cookie | 97 // Called when a cookie for a URL is changed in the underlying default cookie |
| 98 // store. To be called on the IO thread. If the key corresponding to the URL | 98 // store. To be called on the IO thread. If the key corresponding to the URL |
| 99 // was copied or read, the prerender will be cancelled. | 99 // was copied or read, the prerender will be cancelled. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // Indicates whether a cookie conflict has been detected yet. | 156 // Indicates whether a cookie conflict has been detected yet. |
| 157 bool cookie_conflict_; | 157 bool cookie_conflict_; |
| 158 | 158 |
| 159 DISALLOW_COPY_AND_ASSIGN(PrerenderCookieStore); | 159 DISALLOW_COPY_AND_ASSIGN(PrerenderCookieStore); |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace prerender | 162 } // namespace prerender |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ | 164 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_COOKIE_STORE_H_ |
| OLD | NEW |