OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Callback responding to deletion of a single quota managed origin's | 157 // Callback responding to deletion of a single quota managed origin's |
158 // persistent data | 158 // persistent data |
159 void OnQuotaManagedOriginDeletion(quota::QuotaStatusCode); | 159 void OnQuotaManagedOriginDeletion(quota::QuotaStatusCode); |
160 | 160 |
161 // Called to check whether all temporary and persistent origin data that | 161 // Called to check whether all temporary and persistent origin data that |
162 // should be deleted has been deleted. If everything's good to go, invokes | 162 // should be deleted has been deleted. If everything's good to go, invokes |
163 // NotifyAndDeleteIfDone on the UI thread. | 163 // NotifyAndDeleteIfDone on the UI thread. |
164 void CheckQuotaManagedDataDeletionStatus(); | 164 void CheckQuotaManagedDataDeletionStatus(); |
165 | 165 |
166 // Callback when Cookies has been deleted. Invokes NotifyAndDeleteIfDone. | |
167 void OnClearedCookies(int num_deleted); | |
168 | |
169 // Invoked on the IO thread to delete cookies. | |
170 void ClearCookiesOnIOThread(net::URLRequestContextGetter* rq_context); | |
171 | |
172 // Calculate the begin time for the deletion range specified by |time_period|. | 166 // Calculate the begin time for the deletion range specified by |time_period|. |
173 base::Time CalculateBeginDeleteTime(TimePeriod time_period); | 167 base::Time CalculateBeginDeleteTime(TimePeriod time_period); |
174 | 168 |
175 // Returns true if we're all done. | 169 // Returns true if we're all done. |
176 bool all_done() { | 170 bool all_done() { |
177 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && | 171 return registrar_.IsEmpty() && !waiting_for_clear_cache_ && |
178 !waiting_for_clear_cookies_&& | |
179 !waiting_for_clear_history_ && | 172 !waiting_for_clear_history_ && |
180 !waiting_for_clear_quota_managed_data_ && | 173 !waiting_for_clear_quota_managed_data_ && |
181 !waiting_for_clear_networking_history_ && | 174 !waiting_for_clear_networking_history_ && |
182 !waiting_for_clear_lso_data_; | 175 !waiting_for_clear_lso_data_; |
183 } | 176 } |
184 | 177 |
185 NotificationRegistrar registrar_; | 178 NotificationRegistrar registrar_; |
186 | 179 |
187 // Profile we're to remove from. | 180 // Profile we're to remove from. |
188 Profile* profile_; | 181 Profile* profile_; |
(...skipping 24 matching lines...) Expand all Loading... |
213 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; | 206 scoped_refptr<net::URLRequestContextGetter> media_context_getter_; |
214 | 207 |
215 // Used to delete plugin data. | 208 // Used to delete plugin data. |
216 scoped_refptr<PluginDataRemover> plugin_data_remover_; | 209 scoped_refptr<PluginDataRemover> plugin_data_remover_; |
217 base::WaitableEventWatcher watcher_; | 210 base::WaitableEventWatcher watcher_; |
218 | 211 |
219 // True if we're waiting for various data to be deleted. | 212 // True if we're waiting for various data to be deleted. |
220 bool waiting_for_clear_history_; | 213 bool waiting_for_clear_history_; |
221 bool waiting_for_clear_quota_managed_data_; | 214 bool waiting_for_clear_quota_managed_data_; |
222 bool waiting_for_clear_networking_history_; | 215 bool waiting_for_clear_networking_history_; |
223 bool waiting_for_clear_cookies_; | |
224 bool waiting_for_clear_cache_; | 216 bool waiting_for_clear_cache_; |
225 bool waiting_for_clear_lso_data_; | 217 bool waiting_for_clear_lso_data_; |
226 | 218 |
227 // Tracking how many origins need to be deleted, and whether we're finished | 219 // Tracking how many origins need to be deleted, and whether we're finished |
228 // gathering origins. | 220 // gathering origins. |
229 int quota_managed_origins_to_delete_count_; | 221 int quota_managed_origins_to_delete_count_; |
230 int quota_managed_storage_types_to_delete_count_; | 222 int quota_managed_storage_types_to_delete_count_; |
231 | 223 |
232 ObserverList<Observer> observer_list_; | 224 ObserverList<Observer> observer_list_; |
233 | 225 |
234 // Used if we need to clear history. | 226 // Used if we need to clear history. |
235 CancelableRequestConsumer request_consumer_; | 227 CancelableRequestConsumer request_consumer_; |
236 | 228 |
237 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 229 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
238 }; | 230 }; |
239 | 231 |
240 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ | 232 #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |