| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ | 5 #ifndef IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ |
| 6 #define IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ | 6 #define IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // |callback| when the browsing data is actually removed. |browser_state| | 28 // |callback| when the browsing data is actually removed. |browser_state| |
| 29 // cannot be null and must not be off the record. | 29 // cannot be null and must not be off the record. |
| 30 // |callback| is called on the main thread. | 30 // |callback| is called on the main thread. |
| 31 // Note: Removal operations are not necessarily processed in the sequence that | 31 // Note: Removal operations are not necessarily processed in the sequence that |
| 32 // they are received in. | 32 // they are received in. |
| 33 void Remove(ios::ChromeBrowserState* browser_state, | 33 void Remove(ios::ChromeBrowserState* browser_state, |
| 34 int remove_mask, | 34 int remove_mask, |
| 35 browsing_data::TimePeriod time_period, | 35 browsing_data::TimePeriod time_period, |
| 36 const base::Closure& callback); | 36 const base::Closure& callback); |
| 37 | 37 |
| 38 // DEPRECATED: Same as above, but setting the |time_period| to ALL_TIME. | |
| 39 // TODO(ioanap): Remove after all call sites are changed. | |
| 40 void Remove(ios::ChromeBrowserState* browser_state, | |
| 41 int remove_mask, | |
| 42 const base::Closure& callback); | |
| 43 | |
| 44 private: | 38 private: |
| 45 // Encapsulates the information that is needed to remove browsing data from | 39 // Encapsulates the information that is needed to remove browsing data from |
| 46 // a ChromeBrowserState. | 40 // a ChromeBrowserState. |
| 47 struct BrowsingDataRemovalInfo { | 41 struct BrowsingDataRemovalInfo { |
| 48 // Creates a BrowsingDataRemovalInfo with a single callback |callback|. | 42 // Creates a BrowsingDataRemovalInfo with a single callback |callback|. |
| 49 BrowsingDataRemovalInfo(int remove_mask, | 43 BrowsingDataRemovalInfo(int remove_mask, |
| 50 browsing_data::TimePeriod time_period, | 44 browsing_data::TimePeriod time_period, |
| 51 const base::Closure& callback); | 45 const base::Closure& callback); |
| 52 ~BrowsingDataRemovalInfo(); | 46 ~BrowsingDataRemovalInfo(); |
| 53 // The mask of all the types of browsing data that needs to be removed. | 47 // The mask of all the types of browsing data that needs to be removed. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 73 // operation pending along with their associated BrowsingDataRemovalInfo. | 67 // operation pending along with their associated BrowsingDataRemovalInfo. |
| 74 std::map<ios::ChromeBrowserState*, std::unique_ptr<BrowsingDataRemovalInfo>> | 68 std::map<ios::ChromeBrowserState*, std::unique_ptr<BrowsingDataRemovalInfo>> |
| 75 pending_removals_; | 69 pending_removals_; |
| 76 // The BrowsingDataRemovalInfo of the currently enqueued removal operation. | 70 // The BrowsingDataRemovalInfo of the currently enqueued removal operation. |
| 77 std::unique_ptr<BrowsingDataRemovalInfo> current_removal_info_; | 71 std::unique_ptr<BrowsingDataRemovalInfo> current_removal_info_; |
| 78 // The actual object that perfoms the removal of browsing data. | 72 // The actual object that perfoms the removal of browsing data. |
| 79 IOSChromeBrowsingDataRemover* current_remover_; | 73 IOSChromeBrowsingDataRemover* current_remover_; |
| 80 }; | 74 }; |
| 81 | 75 |
| 82 #endif // IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ | 76 #endif // IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ |
| OLD | NEW |