| 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> |
| 11 #include <set> | 11 #include <set> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | |
| 17 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 18 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 19 #include "base/sequenced_task_runner_helpers.h" | |
| 20 #include "base/synchronization/waitable_event_watcher.h" | 18 #include "base/synchronization/waitable_event_watcher.h" |
| 21 #include "base/task/cancelable_task_tracker.h" | |
| 22 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 23 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "chrome/browser/browsing_data/browsing_data_remover_delegate.h" |
| 24 #include "chrome/common/features.h" | 22 #include "chrome/common/features.h" |
| 25 #include "components/browsing_data/core/browsing_data_utils.h" | 23 #include "components/browsing_data/core/browsing_data_utils.h" |
| 26 #include "components/content_settings/core/common/content_settings_pattern.h" | |
| 27 #include "components/content_settings/core/common/content_settings_types.h" | |
| 28 #include "components/keyed_service/core/keyed_service.h" | 24 #include "components/keyed_service/core/keyed_service.h" |
| 29 #include "components/offline_pages/core/offline_page_model.h" | |
| 30 #include "components/prefs/pref_member.h" | |
| 31 #include "components/search_engines/template_url_service.h" | |
| 32 #include "media/media_features.h" | |
| 33 #include "ppapi/features/features.h" | 25 #include "ppapi/features/features.h" |
| 34 #include "storage/common/quota/quota_types.h" | 26 #include "storage/common/quota/quota_types.h" |
| 35 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 36 | 28 |
| 37 #if BUILDFLAG(ENABLE_PLUGINS) | |
| 38 #include "chrome/browser/pepper_flash_settings_manager.h" | |
| 39 #endif | |
| 40 | |
| 41 #if defined(OS_CHROMEOS) | |
| 42 #include "chromeos/dbus/dbus_method_call_status.h" | |
| 43 #endif | |
| 44 | |
| 45 class BrowsingDataFilterBuilder; | 29 class BrowsingDataFilterBuilder; |
| 46 class BrowsingDataFlashLSOHelper; | 30 class BrowsingDataFlashLSOHelper; |
| 47 class BrowsingDataRemoverFactory; | 31 class BrowsingDataRemoverFactory; |
| 48 class Profile; | 32 class Profile; |
| 49 class WebappRegistry; | |
| 50 | |
| 51 namespace chrome_browser_net { | |
| 52 class Predictor; | |
| 53 } | |
| 54 | 33 |
| 55 namespace content { | 34 namespace content { |
| 56 class BrowserContext; | 35 class BrowserContext; |
| 57 class PluginDataRemover; | 36 class PluginDataRemover; |
| 58 class StoragePartition; | 37 class StoragePartition; |
| 59 } | 38 } |
| 60 | 39 |
| 61 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 62 // BrowsingDataRemover is responsible for removing data related to browsing: | 41 // BrowsingDataRemover is responsible for removing data related to browsing: |
| 63 // visits in url database, downloads, cookies ... | 42 // visits in url database, downloads, cookies ... |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 // remover->RemoveAndReply(Unbounded(), REMOVE_COOKIES, ALL, this); | 62 // remover->RemoveAndReply(Unbounded(), REMOVE_COOKIES, ALL, this); |
| 84 // } | 63 // } |
| 85 // | 64 // |
| 86 // void OnBrowsingDataRemoverDone() { | 65 // void OnBrowsingDataRemoverDone() { |
| 87 // LOG(INFO) << "Cookies were deleted."; | 66 // LOG(INFO) << "Cookies were deleted."; |
| 88 // } | 67 // } |
| 89 // } | 68 // } |
| 90 // | 69 // |
| 91 //////////////////////////////////////////////////////////////////////////////// | 70 //////////////////////////////////////////////////////////////////////////////// |
| 92 | 71 |
| 93 class BrowsingDataRemover : public KeyedService | 72 class BrowsingDataRemover : public KeyedService { |
| 94 #if BUILDFLAG(ENABLE_PLUGINS) | |
| 95 , public PepperFlashSettingsManager::Client | |
| 96 #endif | |
| 97 { | |
| 98 public: | 73 public: |
| 99 // Mask used for Remove. | 74 // Mask used for Remove. |
| 100 enum RemoveDataMask { | 75 enum RemoveDataMask { |
| 101 REMOVE_APPCACHE = 1 << 0, | 76 REMOVE_APPCACHE = 1 << 0, |
| 102 REMOVE_CACHE = 1 << 1, | 77 REMOVE_CACHE = 1 << 1, |
| 103 REMOVE_COOKIES = 1 << 2, | 78 REMOVE_COOKIES = 1 << 2, |
| 104 REMOVE_DOWNLOADS = 1 << 3, | 79 REMOVE_DOWNLOADS = 1 << 3, |
| 105 REMOVE_FILE_SYSTEMS = 1 << 4, | 80 REMOVE_FILE_SYSTEMS = 1 << 4, |
| 106 REMOVE_FORM_DATA = 1 << 5, | 81 REMOVE_FORM_DATA = 1 << 5, |
| 107 // In addition to visits, REMOVE_HISTORY removes keywords, last session and | 82 // In addition to visits, REMOVE_HISTORY removes keywords, last session and |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // and will be prevented from completing until after the callback | 191 // and will be prevented from completing until after the callback |
| 217 // |continue_to_completion| is run. | 192 // |continue_to_completion| is run. |
| 218 virtual void OnBrowsingDataRemoverWouldComplete( | 193 virtual void OnBrowsingDataRemoverWouldComplete( |
| 219 BrowsingDataRemover* remover, | 194 BrowsingDataRemover* remover, |
| 220 const base::Closure& continue_to_completion) = 0; | 195 const base::Closure& continue_to_completion) = 0; |
| 221 | 196 |
| 222 protected: | 197 protected: |
| 223 virtual ~CompletionInhibitor() {} | 198 virtual ~CompletionInhibitor() {} |
| 224 }; | 199 }; |
| 225 | 200 |
| 201 // Used to track the deletion of a single data storage backend. |
| 202 class SubTask { |
| 203 public: |
| 204 // Creates a SubTask that calls |forward_callback| when completed. |
| 205 // |forward_callback| is only kept as a reference and must outlive SubTask. |
| 206 explicit SubTask(const base::Closure& forward_callback); |
| 207 ~SubTask(); |
| 208 |
| 209 // Indicate that the task is in progress and we're waiting. |
| 210 void Start(); |
| 211 |
| 212 // Returns a callback that should be called to indicate that the task |
| 213 // has been finished. |
| 214 base::Closure GetCompletionCallback(); |
| 215 |
| 216 // Whether the task is still in progress. |
| 217 bool is_pending() const { return is_pending_; } |
| 218 |
| 219 private: |
| 220 void CompletionCallback(); |
| 221 |
| 222 bool is_pending_; |
| 223 const base::Closure& forward_callback_; |
| 224 base::WeakPtrFactory<SubTask> weak_ptr_factory_; |
| 225 }; |
| 226 |
| 226 static TimeRange Unbounded(); | 227 static TimeRange Unbounded(); |
| 227 | 228 |
| 228 static TimeRange Period(browsing_data::TimePeriod period); | 229 static TimeRange Period(browsing_data::TimePeriod period); |
| 229 | 230 |
| 230 // Is the BrowsingDataRemover currently in the process of removing data? | 231 // Is the BrowsingDataRemover currently in the process of removing data? |
| 231 bool is_removing() { return is_removing_; } | 232 bool is_removing() { return is_removing_; } |
| 232 | 233 |
| 233 // Sets a CompletionInhibitor, which will be notified each time an instance is | 234 // Sets a CompletionInhibitor, which will be notified each time an instance is |
| 234 // about to complete a browsing data removal process, and will be able to | 235 // about to complete a browsing data removal process, and will be able to |
| 235 // artificially delay the completion. | 236 // artificially delay the completion. |
| 236 // TODO(crbug.com/483528): Make this non-static. | 237 // TODO(crbug.com/483528): Make this non-static. |
| 237 static void set_completion_inhibitor_for_testing( | 238 static void set_completion_inhibitor_for_testing( |
| 238 CompletionInhibitor* inhibitor) { | 239 CompletionInhibitor* inhibitor) { |
| 239 completion_inhibitor_ = inhibitor; | 240 completion_inhibitor_ = inhibitor; |
| 240 } | 241 } |
| 241 | 242 |
| 243 // Called by the embedder to provide the delegate that will take care of |
| 244 // deleting embedder-specific data. |
| 245 void set_embedder_delegate( |
| 246 std::unique_ptr<BrowsingDataRemoverDelegate> embedder_delegate) { |
| 247 embedder_delegate_ = std::move(embedder_delegate); |
| 248 } |
| 249 |
| 250 BrowsingDataRemoverDelegate* get_embedder_delegate() const { |
| 251 return embedder_delegate_.get(); |
| 252 } |
| 253 |
| 242 // Removes browsing data within the given |time_range|, with datatypes being | 254 // Removes browsing data within the given |time_range|, with datatypes being |
| 243 // specified by |remove_mask| and origin types by |origin_type_mask|. | 255 // specified by |remove_mask| and origin types by |origin_type_mask|. |
| 244 void Remove(const TimeRange& time_range, | 256 void Remove(const TimeRange& time_range, |
| 245 int remove_mask, | 257 int remove_mask, |
| 246 int origin_type_mask); | 258 int origin_type_mask); |
| 247 | 259 |
| 248 // A version of the above that in addition informs the |observer| when the | 260 // A version of the above that in addition informs the |observer| when the |
| 249 // removal task is finished. | 261 // removal task is finished. |
| 250 void RemoveAndReply(const TimeRange& time_range, | 262 void RemoveAndReply(const TimeRange& time_range, |
| 251 int remove_mask, | 263 int remove_mask, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 270 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder, | 282 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder, |
| 271 Observer* observer); | 283 Observer* observer); |
| 272 | 284 |
| 273 void AddObserver(Observer* observer); | 285 void AddObserver(Observer* observer); |
| 274 void RemoveObserver(Observer* observer); | 286 void RemoveObserver(Observer* observer); |
| 275 | 287 |
| 276 // Used for testing. | 288 // Used for testing. |
| 277 void OverrideStoragePartitionForTesting( | 289 void OverrideStoragePartitionForTesting( |
| 278 content::StoragePartition* storage_partition); | 290 content::StoragePartition* storage_partition); |
| 279 | 291 |
| 280 #if BUILDFLAG(ANDROID_JAVA_UI) | |
| 281 void OverrideWebappRegistryForTesting( | |
| 282 std::unique_ptr<WebappRegistry> webapp_registry); | |
| 283 #endif | |
| 284 | |
| 285 #if BUILDFLAG(ENABLE_PLUGINS) | 292 #if BUILDFLAG(ENABLE_PLUGINS) |
| 286 void OverrideFlashLSOHelperForTesting( | 293 void OverrideFlashLSOHelperForTesting( |
| 287 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper); | 294 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper); |
| 288 #endif | 295 #endif |
| 289 | 296 |
| 290 // Parameters of the last call are exposed to be used by tests. Removal and | 297 // Parameters of the last call are exposed to be used by tests. Removal and |
| 291 // origin type masks equal to -1 mean that no removal has ever been executed. | 298 // origin type masks equal to -1 mean that no removal has ever been executed. |
| 292 // TODO(msramek): If other consumers than tests are interested in this, | 299 // TODO(msramek): If other consumers than tests are interested in this, |
| 293 // consider returning them in OnBrowsingDataRemoverDone() callback. | 300 // consider returning them in OnBrowsingDataRemoverDone() callback. |
| 294 const base::Time& GetLastUsedBeginTime(); | 301 const base::Time& GetLastUsedBeginTime(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder; | 347 std::unique_ptr<BrowsingDataFilterBuilder> filter_builder; |
| 341 Observer* observer; | 348 Observer* observer; |
| 342 }; | 349 }; |
| 343 | 350 |
| 344 void Shutdown() override; | 351 void Shutdown() override; |
| 345 | 352 |
| 346 // Setter for |is_removing_|; DCHECKs that we can only start removing if we're | 353 // Setter for |is_removing_|; DCHECKs that we can only start removing if we're |
| 347 // not already removing, and vice-versa. | 354 // not already removing, and vice-versa. |
| 348 void SetRemoving(bool is_removing); | 355 void SetRemoving(bool is_removing); |
| 349 | 356 |
| 350 // Callback for when TemplateURLService has finished loading. Clears the data, | |
| 351 // clears the respective waiting flag, and invokes NotifyIfDone. | |
| 352 void OnKeywordsLoaded(base::Callback<bool(const GURL&)> url_filter); | |
| 353 | |
| 354 #if BUILDFLAG(ENABLE_PLUGINS) | 357 #if BUILDFLAG(ENABLE_PLUGINS) |
| 355 // Called when plugin data has been cleared. Invokes NotifyIfDone. | 358 // Called when plugin data has been cleared. Invokes NotifyIfDone. |
| 356 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); | 359 void OnWaitableEventSignaled(base::WaitableEvent* waitable_event); |
| 357 | 360 |
| 358 // Called when the list of |sites| storing Flash LSO cookies is fetched. | 361 // Called when the list of |sites| storing Flash LSO cookies is fetched. |
| 359 void OnSitesWithFlashDataFetched( | 362 void OnSitesWithFlashDataFetched( |
| 360 base::Callback<bool(const std::string&)> plugin_filter, | 363 base::Callback<bool(const std::string&)> plugin_filter, |
| 361 const std::vector<std::string>& sites); | 364 const std::vector<std::string>& sites); |
| 362 | 365 |
| 363 // Indicates that LSO cookies for one website have been deleted. | 366 // Indicates that LSO cookies for one website have been deleted. |
| 364 void OnFlashDataDeleted(); | 367 void OnFlashDataDeleted(); |
| 365 | |
| 366 // PepperFlashSettingsManager::Client implementation. | |
| 367 void OnDeauthorizeFlashContentLicensesCompleted(uint32_t request_id, | |
| 368 bool success) override; | |
| 369 #endif | |
| 370 | |
| 371 #if defined (OS_CHROMEOS) | |
| 372 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status, | |
| 373 bool result); | |
| 374 #endif | 368 #endif |
| 375 | 369 |
| 376 // Executes the next removal task. Called after the previous task was finished | 370 // Executes the next removal task. Called after the previous task was finished |
| 377 // or directly from Remove() if the task queue was empty. | 371 // or directly from Remove() if the task queue was empty. |
| 378 void RunNextTask(); | 372 void RunNextTask(); |
| 379 | 373 |
| 380 // Removes the specified items related to browsing for a specific host. If the | 374 // Removes the specified items related to browsing for a specific host. If the |
| 381 // provided |remove_url| is empty, data is removed for all origins; otherwise, | 375 // provided |remove_url| is empty, data is removed for all origins; otherwise, |
| 382 // it is restricted by the origin filter origin (where implemented yet). The | 376 // it is restricted by the origin filter origin (where implemented yet). The |
| 383 // |origin_type_mask| parameter defines the set of origins from which data | 377 // |origin_type_mask| parameter defines the set of origins from which data |
| 384 // should be removed (protected, unprotected, or both). | 378 // should be removed (protected, unprotected, or both). |
| 385 // TODO(ttr314): Remove "(where implemented yet)" constraint above once | 379 // TODO(ttr314): Remove "(where implemented yet)" constraint above once |
| 386 // crbug.com/113621 is done. | 380 // crbug.com/113621 is done. |
| 387 // TODO(crbug.com/589586): Support all backends w/ origin filter. | 381 // TODO(crbug.com/589586): Support all backends w/ origin filter. |
| 388 void RemoveImpl(const TimeRange& time_range, | 382 void RemoveImpl(const TimeRange& time_range, |
| 389 int remove_mask, | 383 int remove_mask, |
| 390 const BrowsingDataFilterBuilder& filter_builder, | 384 const BrowsingDataFilterBuilder& filter_builder, |
| 391 int origin_type_mask); | 385 int origin_type_mask); |
| 392 | 386 |
| 393 // Notifies observers and transitions to the idle state. | 387 // Notifies observers and transitions to the idle state. |
| 394 void Notify(); | 388 void Notify(); |
| 395 | 389 |
| 396 // Checks if we are all done, and if so, calls Notify(). | 390 // Checks if we are all done, and if so, calls Notify(). |
| 397 void NotifyIfDone(); | 391 void NotifyIfDone(); |
| 398 | 392 |
| 399 // Called when history deletion is done. | |
| 400 void OnHistoryDeletionDone(); | |
| 401 | |
| 402 // Callback for when the hostname resolution cache has been cleared. | |
| 403 // Clears the respective waiting flag and invokes NotifyIfDone. | |
| 404 void OnClearedHostnameResolutionCache(); | |
| 405 | |
| 406 // Callback for when HTTP auth cache has been cleared. | |
| 407 // Clears the respective waiting flag and invokes NotifyIfDone. | |
| 408 void OnClearedHttpAuthCache(); | |
| 409 | |
| 410 // Callback for when speculative data in the network Predictor has been | |
| 411 // cleared. Clears the respective waiting flag and invokes | |
| 412 // NotifyIfDone. | |
| 413 void OnClearedNetworkPredictor(); | |
| 414 | |
| 415 // Callback for when network related data in ProfileIOData has been cleared. | |
| 416 // Clears the respective waiting flag and invokes NotifyIfDone. | |
| 417 void OnClearedNetworkingHistory(); | |
| 418 | |
| 419 // Callback for when the cache has been deleted. Invokes | |
| 420 // NotifyIfDone. | |
| 421 void ClearedCache(); | |
| 422 #if !defined(DISABLE_NACL) | |
| 423 // Callback for when the NaCl cache has been deleted. Invokes | |
| 424 // NotifyIfDone. | |
| 425 void ClearedNaClCache(); | |
| 426 | |
| 427 // Callback for when the PNaCl translation cache has been deleted. Invokes | |
| 428 // NotifyIfDone. | |
| 429 void ClearedPnaclCache(); | |
| 430 | |
| 431 #endif | |
| 432 | |
| 433 // Callback for when passwords for the requested time range have been cleared. | |
| 434 void OnClearedPasswords(); | |
| 435 | |
| 436 // Callback for when passwords stats for the requested time range have been | |
| 437 // cleared. | |
| 438 void OnClearedPasswordsStats(); | |
| 439 | |
| 440 // Callback for when the autosignin state of passwords has been revoked. | |
| 441 void OnClearedAutoSignIn(); | |
| 442 | |
| 443 // Callback for when cookies have been deleted. Invokes NotifyIfDone. | |
| 444 void OnClearedCookies(); | |
| 445 | |
| 446 // Callback for when channel IDs have been deleted. Invokes | |
| 447 // NotifyIfDone. | |
| 448 void OnClearedChannelIDs(); | |
| 449 | |
| 450 // Callback from the above method. | |
| 451 void OnClearedFormData(); | |
| 452 | |
| 453 // Callback for when the Autofill profile and credit card origin URLs have | |
| 454 // been deleted. | |
| 455 void OnClearedAutofillOriginURLs(); | |
| 456 | |
| 457 // Callback on UI thread when the storage partition related data are cleared. | |
| 458 void OnClearedStoragePartitionData(); | |
| 459 | |
| 460 #if BUILDFLAG(ENABLE_WEBRTC) | |
| 461 // Callback on UI thread when the WebRTC logs have been deleted. | |
| 462 void OnClearedWebRtcLogs(); | |
| 463 #endif | |
| 464 | |
| 465 #if BUILDFLAG(ANDROID_JAVA_UI) | |
| 466 // Callback on UI thread when the precache history has been cleared. | |
| 467 void OnClearedPrecacheHistory(); | |
| 468 | |
| 469 // Callback on UI thread when the offline page data has been cleared. | |
| 470 void OnClearedOfflinePageData( | |
| 471 offline_pages::OfflinePageModel::DeletePageResult result); | |
| 472 #endif | |
| 473 | |
| 474 void OnClearedDomainReliabilityMonitor(); | |
| 475 | |
| 476 // Returns true if we're all done. | 393 // Returns true if we're all done. |
| 477 bool AllDone(); | 394 bool AllDone(); |
| 478 | 395 |
| 479 // Profile we're to remove from. | 396 // Profile we're to remove from. |
| 480 Profile* profile_; | 397 Profile* profile_; |
| 481 | 398 |
| 399 // A delegate to delete the embedder-specific data. |
| 400 std::unique_ptr<BrowsingDataRemoverDelegate> embedder_delegate_; |
| 401 |
| 482 // Start time to delete from. | 402 // Start time to delete from. |
| 483 base::Time delete_begin_; | 403 base::Time delete_begin_; |
| 484 | 404 |
| 485 // End time to delete to. | 405 // End time to delete to. |
| 486 base::Time delete_end_; | 406 base::Time delete_end_; |
| 487 | 407 |
| 488 // The removal mask for the current removal operation. | 408 // The removal mask for the current removal operation. |
| 489 int remove_mask_ = 0; | 409 int remove_mask_ = 0; |
| 490 | 410 |
| 491 // From which types of origins should we remove data? | 411 // From which types of origins should we remove data? |
| (...skipping 10 matching lines...) Expand all Loading... |
| 502 // to artificially delay completion. Used for testing. | 422 // to artificially delay completion. Used for testing. |
| 503 static CompletionInhibitor* completion_inhibitor_; | 423 static CompletionInhibitor* completion_inhibitor_; |
| 504 | 424 |
| 505 #if BUILDFLAG(ENABLE_PLUGINS) | 425 #if BUILDFLAG(ENABLE_PLUGINS) |
| 506 // Used to delete plugin data. | 426 // Used to delete plugin data. |
| 507 std::unique_ptr<content::PluginDataRemover> plugin_data_remover_; | 427 std::unique_ptr<content::PluginDataRemover> plugin_data_remover_; |
| 508 base::WaitableEventWatcher watcher_; | 428 base::WaitableEventWatcher watcher_; |
| 509 | 429 |
| 510 // Used for per-site plugin data deletion. | 430 // Used for per-site plugin data deletion. |
| 511 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper_; | 431 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper_; |
| 512 | |
| 513 // Used to deauthorize content licenses for Pepper Flash. | |
| 514 std::unique_ptr<PepperFlashSettingsManager> pepper_flash_settings_manager_; | |
| 515 #endif | 432 #endif |
| 516 | 433 |
| 517 uint32_t deauthorize_flash_content_licenses_request_id_ = 0; | 434 // A callback to NotifyIfDone() used by SubTasks instances. |
| 518 // True if we're waiting for various data to be deleted. | 435 const base::Closure sub_task_forward_callback_; |
| 436 |
| 437 // Keeping track of various subtasks to be completed. |
| 519 // These may only be accessed from UI thread in order to avoid races! | 438 // These may only be accessed from UI thread in order to avoid races! |
| 520 bool waiting_for_synchronous_clear_operations_ = false; | 439 SubTask synchronous_clear_operations_; |
| 521 bool waiting_for_clear_autofill_origin_urls_ = false; | 440 SubTask clear_embedder_data_; |
| 522 bool waiting_for_clear_cache_ = false; | 441 SubTask clear_cache_; |
| 523 bool waiting_for_clear_channel_ids_ = false; | 442 SubTask clear_channel_ids_; |
| 524 bool waiting_for_clear_flash_content_licenses_ = false; | 443 SubTask clear_http_auth_cache_; |
| 525 // Non-zero if waiting for cookies to be cleared. | 444 SubTask clear_storage_partition_data_; |
| 526 int waiting_for_clear_cookies_count_ = 0; | |
| 527 // Counts the number of plugin data tasks. Should be the number of LSO cookies | 445 // Counts the number of plugin data tasks. Should be the number of LSO cookies |
| 528 // to be deleted, or 1 while we're fetching LSO cookies or deleting in bulk. | 446 // to be deleted, or 1 while we're fetching LSO cookies or deleting in bulk. |
| 529 int waiting_for_clear_plugin_data_count_ = 0; | 447 int clear_plugin_data_count_ = 0; |
| 530 bool waiting_for_clear_domain_reliability_monitor_ = false; | |
| 531 bool waiting_for_clear_form_ = false; | |
| 532 bool waiting_for_clear_history_ = false; | |
| 533 bool waiting_for_clear_hostname_resolution_cache_ = false; | |
| 534 bool waiting_for_clear_http_auth_cache_ = false; | |
| 535 bool waiting_for_clear_keyword_data_ = false; | |
| 536 bool waiting_for_clear_nacl_cache_ = false; | |
| 537 bool waiting_for_clear_network_predictor_ = false; | |
| 538 bool waiting_for_clear_networking_history_ = false; | |
| 539 bool waiting_for_clear_passwords_ = false; | |
| 540 bool waiting_for_clear_passwords_stats_ = false; | |
| 541 bool waiting_for_clear_platform_keys_ = false; | |
| 542 bool waiting_for_clear_pnacl_cache_ = false; | |
| 543 #if BUILDFLAG(ANDROID_JAVA_UI) | |
| 544 bool waiting_for_clear_precache_history_ = false; | |
| 545 bool waiting_for_clear_offline_page_data_ = false; | |
| 546 #endif | |
| 547 bool waiting_for_clear_storage_partition_data_ = false; | |
| 548 #if BUILDFLAG(ENABLE_WEBRTC) | |
| 549 bool waiting_for_clear_webrtc_logs_ = false; | |
| 550 #endif | |
| 551 bool waiting_for_clear_auto_sign_in_ = false; | |
| 552 | 448 |
| 553 // Observers of the global state and individual tasks. | 449 // Observers of the global state and individual tasks. |
| 554 base::ObserverList<Observer, true> observer_list_; | 450 base::ObserverList<Observer, true> observer_list_; |
| 555 | 451 |
| 556 // Used if we need to clear history. | |
| 557 base::CancelableTaskTracker history_task_tracker_; | |
| 558 | |
| 559 std::unique_ptr<TemplateURLService::Subscription> template_url_sub_; | |
| 560 | |
| 561 // We do not own this. | 452 // We do not own this. |
| 562 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 453 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 563 | 454 |
| 564 #if BUILDFLAG(ANDROID_JAVA_UI) | |
| 565 // WebappRegistry makes calls across the JNI. In unit tests, the Java side is | |
| 566 // not initialised, so the registry must be mocked out. | |
| 567 std::unique_ptr<WebappRegistry> webapp_registry_; | |
| 568 #endif | |
| 569 | |
| 570 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; | 455 base::WeakPtrFactory<BrowsingDataRemover> weak_ptr_factory_; |
| 571 | 456 |
| 572 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); | 457 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); |
| 573 }; | 458 }; |
| 574 | 459 |
| 575 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ | 460 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ |
| OLD | NEW |