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_BROWSING_DATA_REMOVER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 REMOVE_PLUGIN_DATA | | 158 REMOVE_PLUGIN_DATA | |
159 REMOVE_SERVICE_WORKERS | | 159 REMOVE_SERVICE_WORKERS | |
160 REMOVE_CACHE_STORAGE | | 160 REMOVE_CACHE_STORAGE | |
161 REMOVE_WEBSQL | | 161 REMOVE_WEBSQL | |
162 REMOVE_CHANNEL_IDS | | 162 REMOVE_CHANNEL_IDS | |
163 #if BUILDFLAG(ANDROID_JAVA_UI) | 163 #if BUILDFLAG(ANDROID_JAVA_UI) |
164 REMOVE_WEBAPP_DATA | | 164 REMOVE_WEBAPP_DATA | |
165 #endif | 165 #endif |
166 REMOVE_SITE_USAGE_DATA, | 166 REMOVE_SITE_USAGE_DATA, |
167 | 167 |
| 168 // Datatypes that can be deleted partially per URL / origin / domain, |
| 169 // whichever makes sense. |
| 170 FILTERABLE_DATATYPES = (REMOVE_SITE_DATA & ~REMOVE_PLUGIN_DATA) | |
| 171 REMOVE_CACHE | |
| 172 REMOVE_DOWNLOADS, |
| 173 |
168 // Includes all the available remove options. Meant to be used by clients | 174 // Includes all the available remove options. Meant to be used by clients |
169 // that wish to wipe as much data as possible from a Profile, to make it | 175 // that wish to wipe as much data as possible from a Profile, to make it |
170 // look like a new Profile. | 176 // look like a new Profile. |
171 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | | 177 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS | |
172 REMOVE_FORM_DATA | | 178 REMOVE_FORM_DATA | |
173 REMOVE_HISTORY | | 179 REMOVE_HISTORY | |
174 REMOVE_PASSWORDS | | 180 REMOVE_PASSWORDS | |
175 REMOVE_MEDIA_LICENSES, | 181 REMOVE_MEDIA_LICENSES, |
176 | 182 |
177 // Includes all available remove options. Meant to be used when the Profile | 183 // Includes all available remove options. Meant to be used when the Profile |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 266 |
261 // A version of the above that in addition informs the |observer| when the | 267 // A version of the above that in addition informs the |observer| when the |
262 // removal task is finished. | 268 // removal task is finished. |
263 void RemoveAndReply(const TimeRange& time_range, | 269 void RemoveAndReply(const TimeRange& time_range, |
264 int remove_mask, | 270 int remove_mask, |
265 int origin_type_mask, | 271 int origin_type_mask, |
266 Observer* observer); | 272 Observer* observer); |
267 | 273 |
268 // Like Remove(), but in case of URL-keyed only removes data whose URL match | 274 // Like Remove(), but in case of URL-keyed only removes data whose URL match |
269 // |filter_builder| (e.g. are on certain origin or domain). | 275 // |filter_builder| (e.g. are on certain origin or domain). |
270 // TODO(dmurph): Support all backends with filter (crbug.com/113621). | 276 // RemoveWithFilter() currently only works with FILTERABLE_DATATYPES. |
271 // DO NOT USE THIS METHOD UNLESS CALLER KNOWS WHAT THEY'RE DOING. NOT ALL | |
272 // BACKENDS ARE SUPPORTED YET, AND MORE DATA THAN EXPECTED COULD BE DELETED. | |
273 void RemoveWithFilter( | 277 void RemoveWithFilter( |
274 const TimeRange& time_range, | 278 const TimeRange& time_range, |
275 int remove_mask, | 279 int remove_mask, |
276 int origin_type_mask, | 280 int origin_type_mask, |
277 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder); | 281 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder); |
278 | 282 |
279 // A version of the above that in addition informs the |observer| when the | 283 // A version of the above that in addition informs the |observer| when the |
280 // removal task is finished. | 284 // removal task is finished. |
281 void RemoveWithFilterAndReply( | 285 void RemoveWithFilterAndReply( |
282 const TimeRange& time_range, | 286 const TimeRange& time_range, |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 // not initialised, so the registry must be mocked out. | 586 // not initialised, so the registry must be mocked out. |
583 std::unique_ptr<WebappRegistry> webapp_registry_; | 587 std::unique_ptr<WebappRegistry> webapp_registry_; |
584 #endif | 588 #endif |
585 | 589 |
586 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; | 590 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; |
587 | 591 |
588 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 592 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
589 }; | 593 }; |
590 | 594 |
591 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 595 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |