blob: 84160cbdbb796f3fd65507e555f3c8300d9507df [file] [log] [blame]
[email protected]eb7974c2012-01-25 17:38:481// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit09911bf2008-07-26 23:55:294
[email protected]b0cb5e82012-07-19 19:22:475#ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
6#define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
initial.commit09911bf2008-07-26 23:55:297
[email protected]bb95acab2011-11-16 22:22:278#include <set>
[email protected]654512b2010-09-01 02:09:429
[email protected]92269382012-03-03 09:00:0810#include "base/gtest_prod_util.h"
[email protected]3b63f8f42011-03-28 01:54:1511#include "base/memory/ref_counted.h"
initial.commit09911bf2008-07-26 23:55:2912#include "base/observer_list.h"
[email protected]1ab137b2013-03-21 03:33:1813#include "base/prefs/pref_member.h"
[email protected]fb441962013-05-08 05:35:2414#include "base/sequenced_task_runner_helpers.h"
[email protected]c7d58d62011-01-21 10:27:1815#include "base/synchronization/waitable_event_watcher.h"
[email protected]e95b717f2014-02-06 13:47:1316#include "base/task/cancelable_task_tracker.h"
[email protected]4dcb7972013-06-28 15:15:4117#include "base/time/time.h"
[email protected]1a559442012-05-27 07:18:4618#include "chrome/browser/pepper_flash_settings_manager.h"
[email protected]bf5c532d2014-07-05 00:29:5319#include "components/search_engines/template_url_service.h"
[email protected]027188c2013-11-01 22:51:4520#if defined(OS_CHROMEOS)
21#include "chromeos/dbus/dbus_method_call_status.h"
22#endif
pilgrim16330552014-09-10 01:32:2223#include "storage/common/quota/quota_types.h"
[email protected]761fa4702013-07-02 15:25:1524#include "url/gurl.h"
initial.commit09911bf2008-07-26 23:55:2925
[email protected]19eb80152011-02-26 00:28:4326class ExtensionSpecialStoragePolicy;
[email protected]d6f37fc2011-02-13 23:58:4127class IOThread;
initial.commit09911bf2008-07-26 23:55:2928class Profile;
29
[email protected]ec49c182014-06-11 18:03:4730namespace chrome_browser_net {
31class Predictor;
32}
33
[email protected]d8e682012011-11-17 18:31:5434namespace content {
35class PluginDataRemover;
[email protected]88562b512013-11-06 21:10:4436class StoragePartition;
[email protected]d8e682012011-11-17 18:31:5437}
38
[email protected]d885bfe2010-05-21 18:29:4539namespace disk_cache {
40class Backend;
41}
42
[email protected]abe2c032011-03-31 18:49:3443namespace net {
44class URLRequestContextGetter;
45}
46
[email protected]cd501a72014-08-22 19:58:3147namespace storage {
[email protected]94704172011-08-01 16:23:4048class QuotaManager;
49}
50
[email protected]5f2aa722013-08-07 16:59:4151namespace content {
52class DOMStorageContext;
[email protected]832c03ac2012-11-06 12:43:2453struct LocalStorageUsageInfo;
54struct SessionStorageUsageInfo;
55}
56
initial.commit09911bf2008-07-26 23:55:2957// BrowsingDataRemover is responsible for removing data related to browsing:
58// visits in url database, downloads, cookies ...
59
[email protected]3118d342013-10-08 17:29:0360class BrowsingDataRemover
[email protected]6d17f6392012-12-05 05:24:5461#if defined(ENABLE_PLUGINS)
[email protected]3118d342013-10-08 17:29:0362 : public PepperFlashSettingsManager::Client
[email protected]6d17f6392012-12-05 05:24:5463#endif
[email protected]3118d342013-10-08 17:29:0364 {
initial.commit09911bf2008-07-26 23:55:2965 public:
[email protected]25364e12009-05-22 01:37:1966 // Time period ranges available when doing browsing data removals.
67 enum TimePeriod {
[email protected]5c7d3102010-02-11 00:25:4468 LAST_HOUR = 0,
69 LAST_DAY,
[email protected]25364e12009-05-22 01:37:1970 LAST_WEEK,
71 FOUR_WEEKS,
72 EVERYTHING
73 };
74
initial.commit09911bf2008-07-26 23:55:2975 // Mask used for Remove.
[email protected]cf5db4c2011-06-20 21:02:5776 enum RemoveDataMask {
[email protected]dceaa912011-09-06 17:17:2377 REMOVE_APPCACHE = 1 << 0,
78 REMOVE_CACHE = 1 << 1,
[email protected]cf5db4c2011-06-20 21:02:5779 REMOVE_COOKIES = 1 << 2,
[email protected]dceaa912011-09-06 17:17:2380 REMOVE_DOWNLOADS = 1 << 3,
81 REMOVE_FILE_SYSTEMS = 1 << 4,
82 REMOVE_FORM_DATA = 1 << 5,
83 // In addition to visits, REMOVE_HISTORY removes keywords and last session.
84 REMOVE_HISTORY = 1 << 6,
85 REMOVE_INDEXEDDB = 1 << 7,
86 REMOVE_LOCAL_STORAGE = 1 << 8,
[email protected]59eca0f2011-12-13 19:16:3987 REMOVE_PLUGIN_DATA = 1 << 9,
[email protected]dceaa912011-09-06 17:17:2388 REMOVE_PASSWORDS = 1 << 10,
89 REMOVE_WEBSQL = 1 << 11,
[email protected]6b8a3c742014-07-25 00:25:3590 REMOVE_CHANNEL_IDS = 1 << 12,
[email protected]18a4d63c82012-05-25 23:37:0391 REMOVE_CONTENT_LICENSES = 1 << 13,
[email protected]1f19f122014-08-11 20:22:1392 REMOVE_SERVICE_WORKERS = 1 << 14,
[email protected]17ee2cc22014-02-08 00:32:5893#if defined(OS_ANDROID)
[email protected]1f19f122014-08-11 20:22:1394 REMOVE_APP_BANNER_DATA = 1 << 15,
[email protected]17ee2cc22014-02-08 00:32:5895#endif
[email protected]c1c8bc92013-02-15 15:47:3796 // The following flag is used only in tests. In normal usage, hosted app
97 // data is controlled by the REMOVE_COOKIES flag, applied to the
98 // protected-web origin.
99 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31,
[email protected]dceaa912011-09-06 17:17:23100
101 // "Site data" includes cookies, appcache, file systems, indexedDBs, local
[email protected]1f19f122014-08-11 20:22:13102 // storage, webSQL, service workers, and plugin data.
103 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS |
[email protected]17ee2cc22014-02-08 00:32:58104 REMOVE_INDEXEDDB |
105 REMOVE_LOCAL_STORAGE |
106 REMOVE_PLUGIN_DATA |
[email protected]1f19f122014-08-11 20:22:13107 REMOVE_SERVICE_WORKERS |
[email protected]17ee2cc22014-02-08 00:32:58108 REMOVE_WEBSQL |
109#if defined(OS_ANDROID)
110 REMOVE_APP_BANNER_DATA |
111#endif
[email protected]6b8a3c742014-07-25 00:25:35112 REMOVE_CHANNEL_IDS,
[email protected]1cfad7502013-07-29 22:17:40113
114 // Includes all the available remove options. Meant to be used by clients
115 // that wish to wipe as much data as possible from a Profile, to make it
116 // look like a new Profile.
[email protected]1f19f122014-08-11 20:22:13117 REMOVE_ALL = REMOVE_SITE_DATA | REMOVE_CACHE | REMOVE_DOWNLOADS |
[email protected]17ee2cc22014-02-08 00:32:58118 REMOVE_FORM_DATA |
119 REMOVE_HISTORY |
120 REMOVE_PASSWORDS |
121 REMOVE_CONTENT_LICENSES,
[email protected]cf5db4c2011-06-20 21:02:57122 };
initial.commit09911bf2008-07-26 23:55:29123
[email protected]8d7554d82011-12-13 17:11:08124 // When BrowsingDataRemover successfully removes data, a notification of type
125 // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of
126 // this type.
127 struct NotificationDetails {
128 NotificationDetails();
129 NotificationDetails(const NotificationDetails& details);
130 NotificationDetails(base::Time removal_begin,
[email protected]009cf7d72012-06-14 13:21:46131 int removal_mask,
132 int origin_set_mask);
[email protected]8d7554d82011-12-13 17:11:08133 ~NotificationDetails();
134
135 // The beginning of the removal time range.
136 base::Time removal_begin;
137
[email protected]009cf7d72012-06-14 13:21:46138 // The removal mask (see the RemoveDataMask enum for details).
[email protected]8d7554d82011-12-13 17:11:08139 int removal_mask;
[email protected]009cf7d72012-06-14 13:21:46140
141 // The origin set mask (see BrowsingDataHelper::OriginSetMask for details).
142 int origin_set_mask;
[email protected]8d7554d82011-12-13 17:11:08143 };
144
initial.commit09911bf2008-07-26 23:55:29145 // Observer is notified when the removal is done. Done means keywords have
146 // been deleted, cache cleared and all other tasks scheduled.
147 class Observer {
148 public:
149 virtual void OnBrowsingDataRemoverDone() = 0;
[email protected]135fd3b62009-12-16 01:07:08150
151 protected:
152 virtual ~Observer() {}
initial.commit09911bf2008-07-26 23:55:29153 };
154
squedf2e50a2015-01-26 21:19:57155 using Callback = base::Callback<void(const NotificationDetails&)>;
156 using CallbackSubscription = scoped_ptr<
157 base::CallbackList<void(const NotificationDetails&)>::Subscription>;
158
[email protected]a6b511a72014-04-17 23:51:34159 // The completion inhibitor can artificially delay completion of the browsing
160 // data removal process. It is used during testing to simulate scenarios in
161 // which the deletion stalls or takes a very long time.
162 class CompletionInhibitor {
163 public:
164 // Invoked when a |remover| is just about to complete clearing browser data,
165 // and will be prevented from completing until after the callback
166 // |continue_to_completion| is run.
167 virtual void OnBrowsingDataRemoverWouldComplete(
168 BrowsingDataRemover* remover,
169 const base::Closure& continue_to_completion) = 0;
170
171 protected:
172 virtual ~CompletionInhibitor() {}
173 };
174
[email protected]38b892b42012-09-04 13:25:47175 // Creates a BrowsingDataRemover object that removes data regardless of the
176 // time it was last modified. Returns a raw pointer, as BrowsingDataRemover
177 // retains ownership of itself, and deletes itself once finished.
178 static BrowsingDataRemover* CreateForUnboundedRange(Profile* profile);
[email protected]25364e12009-05-22 01:37:19179
[email protected]38b892b42012-09-04 13:25:47180 // Creates a BrowsingDataRemover object bound on both sides by a time. Returns
181 // a raw pointer, as BrowsingDataRemover retains ownership of itself, and
182 // deletes itself once finished.
183 static BrowsingDataRemover* CreateForRange(Profile* profile,
184 base::Time delete_begin,
185 base::Time delete_end);
186
187 // Creates a BrowsingDataRemover bound to a specific period of time (as
188 // defined via a TimePeriod). Returns a raw pointer, as BrowsingDataRemover
189 // retains ownership of itself, and deletes itself once finished.
190 static BrowsingDataRemover* CreateForPeriod(Profile* profile,
191 TimePeriod period);
192
[email protected]c606b462013-02-04 10:51:10193 // Calculate the begin time for the deletion range specified by |time_period|.
194 static base::Time CalculateBeginDeleteTime(TimePeriod time_period);
195
[email protected]38b892b42012-09-04 13:25:47196 // Is the BrowsingDataRemover currently in the process of removing data?
197 static bool is_removing() { return is_removing_; }
initial.commit09911bf2008-07-26 23:55:29198
[email protected]a6b511a72014-04-17 23:51:34199 // Sets a CompletionInhibitor, which will be notified each time an instance is
200 // about to complete a browsing data removal process, and will be able to
201 // artificially delay the completion.
202 static void set_completion_inhibitor_for_testing(
203 CompletionInhibitor* inhibitor) {
204 completion_inhibitor_ = inhibitor;
205 }
206
squedf2e50a2015-01-26 21:19:57207 // Add a callback to the list of callbacks to be called during a browsing data
208 // removal event. Returns a subscription object that can be used to
209 // un-register the callback.
210 static CallbackSubscription RegisterOnBrowsingDataRemovedCallback(
211 const Callback& callback);
212
[email protected]3d4d4cf2012-06-04 10:40:55213 // Removes the specified items related to browsing for all origins that match
214 // the provided |origin_set_mask| (see BrowsingDataHelper::OriginSetMask).
215 void Remove(int remove_mask, int origin_set_mask);
initial.commit09911bf2008-07-26 23:55:29216
217 void AddObserver(Observer* observer);
218 void RemoveObserver(Observer* observer);
219
220 // Called when history deletion is done.
221 void OnHistoryDeletionDone();
222
[email protected]55eb70e762012-02-20 17:38:39223 // Used for testing.
[email protected]88562b512013-11-06 21:10:44224 void OverrideStoragePartitionForTesting(
225 content::StoragePartition* storage_partition);
[email protected]55eb70e762012-02-20 17:38:39226
initial.commit09911bf2008-07-26 23:55:29227 private:
[email protected]6093d742011-08-26 16:37:18228 // The clear API needs to be able to toggle removing_ in order to test that
229 // only one BrowsingDataRemover instance can be called at a time.
[email protected]8f5090a52012-02-10 11:36:21230 FRIEND_TEST_ALL_PREFIXES(ExtensionBrowsingDataTest, OneAtATime);
[email protected]6093d742011-08-26 16:37:18231
[email protected]8d4ec682012-02-17 12:20:17232 // The BrowsingDataRemover tests need to be able to access the implementation
233 // of Remove(), as it exposes details that aren't yet available in the public
234 // API. As soon as those details are exposed via new methods, this should be
235 // removed.
236 //
237 // TODO(mkwst): See http://crbug.com/113621
238 friend class BrowsingDataRemoverTest;
239
[email protected]d885bfe2010-05-21 18:29:45240 enum CacheState {
241 STATE_NONE,
242 STATE_CREATE_MAIN,
243 STATE_CREATE_MEDIA,
244 STATE_DELETE_MAIN,
245 STATE_DELETE_MEDIA,
246 STATE_DONE
247 };
248
[email protected]38b892b42012-09-04 13:25:47249 // Setter for |is_removing_|; DCHECKs that we can only start removing if we're
250 // not already removing, and vice-versa.
251 static void set_removing(bool is_removing);
252
253 // Creates a BrowsingDataRemover to remove browser data from the specified
254 // profile in the specified time range. Use Remove to initiate the removal.
255 BrowsingDataRemover(Profile* profile,
256 base::Time delete_begin,
257 base::Time delete_end);
258
[email protected]a25e59e2012-06-21 00:28:16259 // BrowsingDataRemover deletes itself (using DeleteHelper) and is not supposed
260 // to be deleted by other objects so make destructor private and DeleteHelper
[email protected]24740312009-09-30 14:22:54261 // a friend.
[email protected]b1d183282011-12-30 04:32:58262 friend class base::DeleteHelper<BrowsingDataRemover>;
dchengd2d19202014-10-22 00:06:00263
264 // When plugins aren't enabled, there is no base class, so adding an override
265 // specifier would result in a compile error.
266#if defined(ENABLE_PLUGINS)
267 ~BrowsingDataRemover() override;
268#else
269 ~BrowsingDataRemover();
270#endif
[email protected]24740312009-09-30 14:22:54271
[email protected]3118d342013-10-08 17:29:03272 // Callback for when TemplateURLService has finished loading. Clears the data,
273 // clears the respective waiting flag, and invokes NotifyAndDeleteIfDone.
274 void OnKeywordsLoaded();
initial.commit09911bf2008-07-26 23:55:29275
tommyclie86b2982015-03-16 20:16:45276 // Called when plugin data has been cleared. Invokes NotifyAndDeleteIfDone.
[email protected]329be052013-02-04 18:14:28277 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event);
[email protected]c7d58d62011-01-21 10:27:18278
[email protected]6d17f6392012-12-05 05:24:54279#if defined(ENABLE_PLUGINS)
[email protected]1a559442012-05-27 07:18:46280 // PepperFlashSettingsManager::Client implementation.
dchengd2d19202014-10-22 00:06:00281 void OnDeauthorizeContentLicensesCompleted(uint32 request_id,
282 bool success) override;
[email protected]6d17f6392012-12-05 05:24:54283#endif
[email protected]1a559442012-05-27 07:18:46284
[email protected]027188c2013-11-01 22:51:45285#if defined (OS_CHROMEOS)
286 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status,
287 bool result);
288#endif
289
[email protected]8d4ec682012-02-17 12:20:17290 // Removes the specified items related to browsing for a specific host. If the
[email protected]3d4d4cf2012-06-04 10:40:55291 // provided |origin| is empty, data is removed for all origins. The
292 // |origin_set_mask| parameter defines the set of origins from which data
293 // should be removed (protected, unprotected, or both).
[email protected]8d4ec682012-02-17 12:20:17294 void RemoveImpl(int remove_mask,
295 const GURL& origin,
[email protected]3d4d4cf2012-06-04 10:40:55296 int origin_set_mask);
[email protected]8d4ec682012-02-17 12:20:17297
[email protected]a6b511a72014-04-17 23:51:34298 // Notifies observers and deletes this object.
299 void NotifyAndDelete();
300
301 // Checks if we are all done, and if so, calls NotifyAndDelete().
initial.commit09911bf2008-07-26 23:55:29302 void NotifyAndDeleteIfDone();
303
[email protected]3118d342013-10-08 17:29:03304 // Callback for when the hostname resolution cache has been cleared.
[email protected]e0e1fc22012-11-05 20:25:36305 // Clears the respective waiting flag and invokes NotifyAndDeleteIfDone.
306 void OnClearedHostnameResolutionCache();
[email protected]d6f37fc2011-02-13 23:58:41307
[email protected]e0e1fc22012-11-05 20:25:36308 // Invoked on the IO thread to clear the hostname resolution cache.
309 void ClearHostnameResolutionCacheOnIOThread(IOThread* io_thread);
310
[email protected]3118d342013-10-08 17:29:03311 // Callback for when the LoggedIn Predictor has been cleared.
[email protected]20a47b972013-04-17 17:26:39312 // Clears the respective waiting flag and invokes NotifyAndDeleteIfDone.
313 void OnClearedLoggedInPredictor();
314
315 // Clears the LoggedIn Predictor.
316 void ClearLoggedInPredictor();
317
[email protected]3118d342013-10-08 17:29:03318 // Callback for when speculative data in the network Predictor has been
319 // cleared. Clears the respective waiting flag and invokes
320 // NotifyAndDeleteIfDone.
[email protected]e0e1fc22012-11-05 20:25:36321 void OnClearedNetworkPredictor();
322
323 // Invoked on the IO thread to clear speculative data related to hostname
324 // pre-resolution from the network Predictor.
[email protected]ec49c182014-06-11 18:03:47325 void ClearNetworkPredictorOnIOThread(
326 chrome_browser_net::Predictor* predictor);
[email protected]e0e1fc22012-11-05 20:25:36327
[email protected]3118d342013-10-08 17:29:03328 // Callback for when network related data in ProfileIOData has been cleared.
[email protected]e0e1fc22012-11-05 20:25:36329 // Clears the respective waiting flag and invokes NotifyAndDeleteIfDone.
330 void OnClearedNetworkingHistory();
[email protected]d6f37fc2011-02-13 23:58:41331
[email protected]3118d342013-10-08 17:29:03332 // Callback for when the cache has been deleted. Invokes
333 // NotifyAndDeleteIfDone.
initial.commit09911bf2008-07-26 23:55:29334 void ClearedCache();
335
336 // Invoked on the IO thread to delete from the cache.
[email protected]d885bfe2010-05-21 18:29:45337 void ClearCacheOnIOThread();
338
339 // Performs the actual work to delete the cache.
340 void DoClearCache(int rv);
initial.commit09911bf2008-07-26 23:55:29341
[email protected]43e497fd2012-06-14 21:14:52342#if !defined(DISABLE_NACL)
343 // Callback for when the NaCl cache has been deleted. Invokes
344 // NotifyAndDeleteIfDone.
345 void ClearedNaClCache();
346
347 // Invokes the ClearedNaClCache on the UI thread.
348 void ClearedNaClCacheOnIOThread();
349
350 // Invoked on the IO thread to delete the NaCl cache.
351 void ClearNaClCacheOnIOThread();
[email protected]abc31ee2013-08-09 07:25:35352
353 // Callback for when the PNaCl translation cache has been deleted. Invokes
354 // NotifyAndDeleteIfDone.
355 void ClearedPnaclCache();
356
357 // Invokes ClearedPnaclCacheOn on the UI thread.
358 void ClearedPnaclCacheOnIOThread();
359
360 // Invoked on the IO thread to delete entries in the PNaCl translation cache.
361 void ClearPnaclCacheOnIOThread(base::Time begin, base::Time end);
[email protected]43e497fd2012-06-14 21:14:52362#endif
363
[email protected]3118d342013-10-08 17:29:03364 // Callback for when Cookies has been deleted. Invokes NotifyAndDeleteIfDone.
[email protected]ade9abe2011-09-02 17:29:12365 void OnClearedCookies(int num_deleted);
366
367 // Invoked on the IO thread to delete cookies.
368 void ClearCookiesOnIOThread(net::URLRequestContextGetter* rq_context);
369
[email protected]6b8a3c742014-07-25 00:25:35370 // Invoked on the IO thread to delete channel IDs.
371 void ClearChannelIDsOnIOThread(
[email protected]eb7974c2012-01-25 17:38:48372 net::URLRequestContextGetter* rq_context);
373
[email protected]6b8a3c742014-07-25 00:25:35374 // Callback on IO Thread when channel IDs have been deleted. Clears SSL
375 // connection pool and posts to UI thread to run OnClearedChannelIDs.
376 void OnClearedChannelIDsOnIOThread(
[email protected]646a6202013-01-25 03:57:30377 net::URLRequestContextGetter* rq_context);
378
[email protected]6b8a3c742014-07-25 00:25:35379 // Callback for when channel IDs have been deleted. Invokes
[email protected]eb7974c2012-01-25 17:38:48380 // NotifyAndDeleteIfDone.
[email protected]6b8a3c742014-07-25 00:25:35381 void OnClearedChannelIDs();
[email protected]eb7974c2012-01-25 17:38:48382
[email protected]1696d7a2012-08-22 17:06:40383 // Callback from the above method.
384 void OnClearedFormData();
385
[email protected]3118d342013-10-08 17:29:03386 // Callback for when the Autofill profile and credit card origin URLs have
387 // been deleted.
[email protected]4dacf9a2013-05-22 01:06:49388 void OnClearedAutofillOriginURLs();
389
[email protected]88562b512013-11-06 21:10:44390 // Callback on UI thread when the storage partition related data are cleared.
391 void OnClearedStoragePartitionData();
[email protected]ec346e02013-08-08 22:03:53392
[email protected]25021cfb2014-03-25 17:20:35393#if defined(ENABLE_WEBRTC)
394 // Callback on UI thread when the WebRTC logs have been deleted.
395 void OnClearedWebRtcLogs();
396#endif
397
[email protected]9b2034032014-05-11 18:10:31398 void OnClearedDomainReliabilityMonitor();
399
initial.commit09911bf2008-07-26 23:55:29400 // Returns true if we're all done.
[email protected]43e497fd2012-06-14 21:14:52401 bool AllDone();
initial.commit09911bf2008-07-26 23:55:29402
403 // Profile we're to remove from.
404 Profile* profile_;
405
406 // Start time to delete from.
[email protected]e1acf6f2008-10-27 20:43:33407 const base::Time delete_begin_;
initial.commit09911bf2008-07-26 23:55:29408
409 // End time to delete to.
[email protected]2c1765f72012-08-08 10:07:37410 base::Time delete_end_;
initial.commit09911bf2008-07-26 23:55:29411
412 // True if Remove has been invoked.
[email protected]38b892b42012-09-04 13:25:47413 static bool is_removing_;
initial.commit09911bf2008-07-26 23:55:29414
[email protected]a6b511a72014-04-17 23:51:34415 // If non-NULL, the |completion_inhibitor_| is notified each time an instance
416 // is about to complete a browsing data removal process, and has the ability
417 // to artificially delay completion. Used for testing.
418 static CompletionInhibitor* completion_inhibitor_;
419
[email protected]d885bfe2010-05-21 18:29:45420 CacheState next_cache_state_;
421 disk_cache::Backend* cache_;
[email protected]d6f37fc2011-02-13 23:58:41422
[email protected]94704172011-08-01 16:23:40423 // Used to delete data from HTTP cache.
[email protected]abe2c032011-03-31 18:49:34424 scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
425 scoped_refptr<net::URLRequestContextGetter> media_context_getter_;
[email protected]d885bfe2010-05-21 18:29:45426
[email protected]c3cdc732012-12-07 09:16:56427#if defined(ENABLE_PLUGINS)
[email protected]09d81f82010-12-15 16:46:42428 // Used to delete plugin data.
[email protected]d8e682012011-11-17 18:31:54429 scoped_ptr<content::PluginDataRemover> plugin_data_remover_;
[email protected]c7d58d62011-01-21 10:27:18430 base::WaitableEventWatcher watcher_;
[email protected]09d81f82010-12-15 16:46:42431
[email protected]1a559442012-05-27 07:18:46432 // Used to deauthorize content licenses for Pepper Flash.
433 scoped_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_;
[email protected]6d17f6392012-12-05 05:24:54434#endif
[email protected]1a559442012-05-27 07:18:46435
[email protected]6d17f6392012-12-05 05:24:54436 uint32 deauthorize_content_licenses_request_id_;
[email protected]d68a4fc62010-03-05 23:40:02437 // True if we're waiting for various data to be deleted.
[email protected]dcdf7a712011-09-06 11:46:17438 // These may only be accessed from UI thread in order to avoid races!
[email protected]4dacf9a2013-05-22 01:06:49439 bool waiting_for_clear_autofill_origin_urls_;
initial.commit09911bf2008-07-26 23:55:29440 bool waiting_for_clear_cache_;
[email protected]6b8a3c742014-07-25 00:25:35441 bool waiting_for_clear_channel_ids_;
[email protected]e0e1fc22012-11-05 20:25:36442 bool waiting_for_clear_content_licenses_;
[email protected]dde7a5a2012-02-22 23:16:34443 // Non-zero if waiting for cookies to be cleared.
444 int waiting_for_clear_cookies_count_;
[email protected]9b2034032014-05-11 18:10:31445 bool waiting_for_clear_domain_reliability_monitor_;
[email protected]e0e1fc22012-11-05 20:25:36446 bool waiting_for_clear_form_;
[email protected]eb7974c2012-01-25 17:38:48447 bool waiting_for_clear_history_;
[email protected]e0e1fc22012-11-05 20:25:36448 bool waiting_for_clear_hostname_resolution_cache_;
[email protected]88562b512013-11-06 21:10:44449 bool waiting_for_clear_keyword_data_;
[email protected]20a47b972013-04-17 17:26:39450 bool waiting_for_clear_logged_in_predictor_;
[email protected]e0e1fc22012-11-05 20:25:36451 bool waiting_for_clear_nacl_cache_;
452 bool waiting_for_clear_network_predictor_;
[email protected]eb7974c2012-01-25 17:38:48453 bool waiting_for_clear_networking_history_;
[email protected]88562b512013-11-06 21:10:44454 bool waiting_for_clear_platform_keys_;
[email protected]59eca0f2011-12-13 19:16:39455 bool waiting_for_clear_plugin_data_;
[email protected]abc31ee2013-08-09 07:25:35456 bool waiting_for_clear_pnacl_cache_;
[email protected]88562b512013-11-06 21:10:44457 bool waiting_for_clear_storage_partition_data_;
[email protected]25021cfb2014-03-25 17:20:35458#if defined(ENABLE_WEBRTC)
459 bool waiting_for_clear_webrtc_logs_;
460#endif
initial.commit09911bf2008-07-26 23:55:29461
[email protected]8d7554d82011-12-13 17:11:08462 // The removal mask for the current removal operation.
463 int remove_mask_;
464
[email protected]8d4ec682012-02-17 12:20:17465 // The origin for the current removal operation.
466 GURL remove_origin_;
467
[email protected]3d4d4cf2012-06-04 10:40:55468 // From which types of origins should we remove data?
469 int origin_set_mask_;
[email protected]8d4ec682012-02-17 12:20:17470
initial.commit09911bf2008-07-26 23:55:29471 ObserverList<Observer> observer_list_;
472
473 // Used if we need to clear history.
[email protected]e95b717f2014-02-06 13:47:13474 base::CancelableTaskTracker history_task_tracker_;
initial.commit09911bf2008-07-26 23:55:29475
[email protected]3118d342013-10-08 17:29:03476 scoped_ptr<TemplateURLService::Subscription> template_url_sub_;
477
[email protected]88562b512013-11-06 21:10:44478 // We do not own this.
479 content::StoragePartition* storage_partition_for_testing_;
480
[email protected]bfd04a62009-02-01 18:16:56481 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover);
initial.commit09911bf2008-07-26 23:55:29482};
483
[email protected]b0cb5e82012-07-19 19:22:47484#endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_