| 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 <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" | 13 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" |
| 14 | 14 |
| 15 namespace ios { | 15 namespace ios { |
| 16 class ChromeBrowserState; | 16 class ChromeBrowserState; |
| 17 } | 17 } |
| 18 | 18 |
| 19 // A helper class that serializes execution of IOSChromeBrowsingDataRemover | 19 // A helper class that serializes execution of IOSChromeBrowsingDataRemover |
| 20 // methods since the IOSChromeBrowsingDataRemover APIs are not re-entrant. | 20 // methods since the IOSChromeBrowsingDataRemover APIs are not re-entrant. |
| 21 class BrowsingDataRemoverHelper | 21 class BrowsingDataRemoverHelper |
| 22 : public IOSChromeBrowsingDataRemover::Observer { | 22 : public IOSChromeBrowsingDataRemover::Observer { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 49 std::vector<base::Closure> callbacks; | 49 std::vector<base::Closure> callbacks; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // IOSChromeBrowsingDataRemover::Observer methods. | 52 // IOSChromeBrowsingDataRemover::Observer methods. |
| 53 void OnIOSChromeBrowsingDataRemoverDone() override; | 53 void OnIOSChromeBrowsingDataRemoverDone() override; |
| 54 | 54 |
| 55 // Removes the browsing data using IOSChromeBrowsingDataRemover. | 55 // Removes the browsing data using IOSChromeBrowsingDataRemover. |
| 56 // IOSChromeBrowsingDataRemover | 56 // IOSChromeBrowsingDataRemover |
| 57 // must not be running. | 57 // must not be running. |
| 58 void DoRemove(ios::ChromeBrowserState* browser_state, | 58 void DoRemove(ios::ChromeBrowserState* browser_state, |
| 59 scoped_ptr<BrowsingDataRemovalInfo> removal_info); | 59 std::unique_ptr<BrowsingDataRemovalInfo> removal_info); |
| 60 | 60 |
| 61 // A map that contains the all the ChromeBrowserStates that have a removal | 61 // A map that contains the all the ChromeBrowserStates that have a removal |
| 62 // operation pending along with their associated BrowsingDataRemovalInfo. | 62 // operation pending along with their associated BrowsingDataRemovalInfo. |
| 63 std::map<ios::ChromeBrowserState*, scoped_ptr<BrowsingDataRemovalInfo>> | 63 std::map<ios::ChromeBrowserState*, std::unique_ptr<BrowsingDataRemovalInfo>> |
| 64 pending_removals_; | 64 pending_removals_; |
| 65 // The BrowsingDataRemovalInfo of the currently enqueued removal operation. | 65 // The BrowsingDataRemovalInfo of the currently enqueued removal operation. |
| 66 scoped_ptr<BrowsingDataRemovalInfo> current_removal_info_; | 66 std::unique_ptr<BrowsingDataRemovalInfo> current_removal_info_; |
| 67 // The actual object that perfoms the removal of browsing data. | 67 // The actual object that perfoms the removal of browsing data. |
| 68 IOSChromeBrowsingDataRemover* current_remover_; | 68 IOSChromeBrowsingDataRemover* current_remover_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ | 71 #endif // IOS_CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_HELPER_H_ |
| OLD | NEW |