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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 REMOVE_PASSWORDS = 1 << 10, | 87 REMOVE_PASSWORDS = 1 << 10, |
88 REMOVE_WEBSQL = 1 << 11, | 88 REMOVE_WEBSQL = 1 << 11, |
89 REMOVE_CHANNEL_IDS = 1 << 12, | 89 REMOVE_CHANNEL_IDS = 1 << 12, |
90 REMOVE_MEDIA_LICENSES = 1 << 13, | 90 REMOVE_MEDIA_LICENSES = 1 << 13, |
91 REMOVE_SERVICE_WORKERS = 1 << 14, | 91 REMOVE_SERVICE_WORKERS = 1 << 14, |
92 REMOVE_SITE_USAGE_DATA = 1 << 15, | 92 REMOVE_SITE_USAGE_DATA = 1 << 15, |
93 // REMOVE_NOCHECKS intentionally does not check if the browser context is | 93 // REMOVE_NOCHECKS intentionally does not check if the browser context is |
94 // prohibited from deleting history or downloads. | 94 // prohibited from deleting history or downloads. |
95 REMOVE_NOCHECKS = 1 << 16, | 95 REMOVE_NOCHECKS = 1 << 16, |
96 REMOVE_CACHE_STORAGE = 1 << 17, | 96 REMOVE_CACHE_STORAGE = 1 << 17, |
97 #if BUILDFLAG(ANDROID_JAVA_UI) | 97 #if defined(OS_ANDROID) |
98 REMOVE_WEBAPP_DATA = 1 << 18, | 98 REMOVE_WEBAPP_DATA = 1 << 18, |
99 #endif | 99 #endif |
100 REMOVE_DURABLE_PERMISSION = 1 << 19, | 100 REMOVE_DURABLE_PERMISSION = 1 << 19, |
101 | 101 |
102 // The following flag is used only in tests. In normal usage, hosted app | 102 // The following flag is used only in tests. In normal usage, hosted app |
103 // data is controlled by the REMOVE_COOKIES flag, applied to the | 103 // data is controlled by the REMOVE_COOKIES flag, applied to the |
104 // protected-web origin. | 104 // protected-web origin. |
105 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, | 105 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, |
106 | 106 |
107 // "Site data" includes cookies, appcache, file systems, indexedDBs, local | 107 // "Site data" includes cookies, appcache, file systems, indexedDBs, local |
108 // storage, webSQL, service workers, cache storage, plugin data, web app | 108 // storage, webSQL, service workers, cache storage, plugin data, web app |
109 // data (on Android) and statistics about passwords. | 109 // data (on Android) and statistics about passwords. |
110 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | | 110 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | |
111 REMOVE_INDEXEDDB | | 111 REMOVE_INDEXEDDB | |
112 REMOVE_LOCAL_STORAGE | | 112 REMOVE_LOCAL_STORAGE | |
113 REMOVE_PLUGIN_DATA | | 113 REMOVE_PLUGIN_DATA | |
114 REMOVE_SERVICE_WORKERS | | 114 REMOVE_SERVICE_WORKERS | |
115 REMOVE_CACHE_STORAGE | | 115 REMOVE_CACHE_STORAGE | |
116 REMOVE_WEBSQL | | 116 REMOVE_WEBSQL | |
117 REMOVE_CHANNEL_IDS | | 117 REMOVE_CHANNEL_IDS | |
118 #if BUILDFLAG(ANDROID_JAVA_UI) | 118 #if defined(OS_ANDROID) |
119 REMOVE_WEBAPP_DATA | | 119 REMOVE_WEBAPP_DATA | |
120 #endif | 120 #endif |
121 REMOVE_SITE_USAGE_DATA | | 121 REMOVE_SITE_USAGE_DATA | |
122 REMOVE_DURABLE_PERMISSION, | 122 REMOVE_DURABLE_PERMISSION, |
123 | 123 |
124 // Datatypes protected by Important Sites. | 124 // Datatypes protected by Important Sites. |
125 IMPORTANT_SITES_DATATYPES = REMOVE_SITE_DATA | | 125 IMPORTANT_SITES_DATATYPES = REMOVE_SITE_DATA | |
126 REMOVE_CACHE, | 126 REMOVE_CACHE, |
127 | 127 |
128 // Datatypes that can be deleted partially per URL / origin / domain, | 128 // Datatypes that can be deleted partially per URL / origin / domain, |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 // TODO(msramek): If other consumers than tests are interested in this, | 290 // TODO(msramek): If other consumers than tests are interested in this, |
291 // consider returning them in OnBrowsingDataRemoverDone() callback. | 291 // consider returning them in OnBrowsingDataRemoverDone() callback. |
292 const base::Time& GetLastUsedBeginTime(); | 292 const base::Time& GetLastUsedBeginTime(); |
293 const base::Time& GetLastUsedEndTime(); | 293 const base::Time& GetLastUsedEndTime(); |
294 int GetLastUsedRemovalMask(); | 294 int GetLastUsedRemovalMask(); |
295 int GetLastUsedOriginTypeMask(); | 295 int GetLastUsedOriginTypeMask(); |
296 | 296 |
297 protected: | 297 protected: |
298 // Use BrowsingDataRemoverFactory::GetForBrowserContext to get an instance of | 298 // Use BrowsingDataRemoverFactory::GetForBrowserContext to get an instance of |
299 // this class. The constructor is protected so that the class is mockable. | 299 // this class. The constructor is protected so that the class is mockable. |
300 BrowsingDataRemover(content::BrowserContext* browser_context); | 300 explicit BrowsingDataRemover(content::BrowserContext* browser_context); |
sky
2017/01/06 23:27:27
Nice catch!
F
2017/01/09 21:36:32
Acknowledged.
| |
301 ~BrowsingDataRemover() override; | 301 ~BrowsingDataRemover() override; |
302 | 302 |
303 // A common reduction of all public Remove[WithFilter][AndReply] methods. | 303 // A common reduction of all public Remove[WithFilter][AndReply] methods. |
304 virtual void RemoveInternal( | 304 virtual void RemoveInternal( |
305 const base::Time& delete_begin, | 305 const base::Time& delete_begin, |
306 const base::Time& delete_end, | 306 const base::Time& delete_end, |
307 int remove_mask, | 307 int remove_mask, |
308 int origin_type_mask, | 308 int origin_type_mask, |
309 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder, | 309 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder, |
310 Observer* observer); | 310 Observer* observer); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 | 446 |
447 // We do not own this. | 447 // We do not own this. |
448 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 448 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
449 | 449 |
450 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; | 450 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; |
451 | 451 |
452 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 452 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
453 }; | 453 }; |
454 | 454 |
455 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 455 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
OLD | NEW |