| 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_IMPL_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_IMPL_H_ |
| 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_IMPL_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_IMPL_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/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/synchronization/waitable_event_watcher.h" | 17 #include "base/synchronization/waitable_event_watcher.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 21 #include "chrome/common/features.h" | 21 #include "chrome/common/features.h" |
| 22 #include "components/keyed_service/core/keyed_service.h" | |
| 23 #include "ppapi/features/features.h" | 22 #include "ppapi/features/features.h" |
| 24 #include "storage/common/quota/quota_types.h" | 23 #include "storage/common/quota/quota_types.h" |
| 25 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 26 | 25 |
| 27 class BrowsingDataRemoverFactory; | 26 class BrowsingDataRemoverFactory; |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 class BrowserContext; | 29 class BrowserContext; |
| 31 class BrowsingDataFilterBuilder; | 30 class BrowsingDataFilterBuilder; |
| 32 class StoragePartition; | 31 class StoragePartition; |
| 33 } | 32 } |
| 34 | 33 |
| 35 class BrowsingDataRemoverImpl : | 34 class BrowsingDataRemoverImpl : public BrowsingDataRemover { |
| 36 public BrowsingDataRemover, | |
| 37 public KeyedService { | |
| 38 public: | 35 public: |
| 39 // The completion inhibitor can artificially delay completion of the browsing | 36 // The completion inhibitor can artificially delay completion of the browsing |
| 40 // data removal process. It is used during testing to simulate scenarios in | 37 // data removal process. It is used during testing to simulate scenarios in |
| 41 // which the deletion stalls or takes a very long time. | 38 // which the deletion stalls or takes a very long time. |
| 42 class CompletionInhibitor { | 39 class CompletionInhibitor { |
| 43 public: | 40 public: |
| 44 // Invoked when a |remover| is just about to complete clearing browser data, | 41 // Invoked when a |remover| is just about to complete clearing browser data, |
| 45 // and will be prevented from completing until after the callback | 42 // and will be prevented from completing until after the callback |
| 46 // |continue_to_completion| is run. | 43 // |continue_to_completion| is run. |
| 47 virtual void OnBrowsingDataRemoverWouldComplete( | 44 virtual void OnBrowsingDataRemoverWouldComplete( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 248 |
| 252 // We do not own this. | 249 // We do not own this. |
| 253 content::StoragePartition* storage_partition_for_testing_ = nullptr; | 250 content::StoragePartition* storage_partition_for_testing_ = nullptr; |
| 254 | 251 |
| 255 base::WeakPtrFactory<BrowsingDataRemoverImpl> weak_ptr_factory_; | 252 base::WeakPtrFactory<BrowsingDataRemoverImpl> weak_ptr_factory_; |
| 256 | 253 |
| 257 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverImpl); | 254 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemoverImpl); |
| 258 }; | 255 }; |
| 259 | 256 |
| 260 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_IMPL_H_ | 257 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_IMPL_H_ |
| OLD | NEW |