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 CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual void StartFetching( | 36 virtual void StartFetching( |
37 const base::Callback<void(const net::CookieList& cookies)>& callback); | 37 const base::Callback<void(const net::CookieList& cookies)>& callback); |
38 | 38 |
39 // Requests a single cookie to be deleted in the IO thread. This must be | 39 // Requests a single cookie to be deleted in the IO thread. This must be |
40 // called in the UI thread. | 40 // called in the UI thread. |
41 virtual void DeleteCookie(const net::CookieMonster::CanonicalCookie& cookie); | 41 virtual void DeleteCookie(const net::CookieMonster::CanonicalCookie& cookie); |
42 | 42 |
43 protected: | 43 protected: |
44 friend class base::RefCountedThreadSafe<BrowsingDataCookieHelper>; | 44 friend class base::RefCountedThreadSafe<BrowsingDataCookieHelper>; |
45 virtual ~BrowsingDataCookieHelper(); | 45 virtual ~BrowsingDataCookieHelper(); |
| 46 Profile* profile() { return profile_; } |
46 | 47 |
47 private: | 48 private: |
48 // Fetch the cookies. This must be called in the IO thread. | 49 // Fetch the cookies. This must be called in the IO thread. |
49 void FetchCookiesOnIOThread(); | 50 void FetchCookiesOnIOThread(); |
50 | 51 |
51 // Callback function for get cookie. This must be called in the IO thread. | 52 // Callback function for get cookie. This must be called in the IO thread. |
52 void OnFetchComplete(const net::CookieList& cookies); | 53 void OnFetchComplete(const net::CookieList& cookies); |
53 | 54 |
54 // Notifies the completion callback. This must be called in the UI thread. | 55 // Notifies the completion callback. This must be called in the UI thread. |
55 void NotifyInUIThread(const net::CookieList& cookies); | 56 void NotifyInUIThread(const net::CookieList& cookies); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Check if the cookie list contains a cookie with the same name, | 112 // Check if the cookie list contains a cookie with the same name, |
112 // domain, and path as the newly created cookie. Delete the old cookie | 113 // domain, and path as the newly created cookie. Delete the old cookie |
113 // if does. | 114 // if does. |
114 bool DeleteMetchingCookie( | 115 bool DeleteMetchingCookie( |
115 const net::CookieMonster::CanonicalCookie& add_cookie); | 116 const net::CookieMonster::CanonicalCookie& add_cookie); |
116 | 117 |
117 virtual ~CannedBrowsingDataCookieHelper(); | 118 virtual ~CannedBrowsingDataCookieHelper(); |
118 | 119 |
119 net::CookieList cookie_list_; | 120 net::CookieList cookie_list_; |
120 | 121 |
121 Profile* profile_; | |
122 | |
123 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataCookieHelper); | 122 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataCookieHelper); |
124 }; | 123 }; |
125 | 124 |
126 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ | 125 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIE_HELPER_H_ |
OLD | NEW |