| 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 CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void AddCallbackAndStartAggregator( | 43 void AddCallbackAndStartAggregator( |
| 44 const profiles::ProfileStatisticsCallback& stats_callback); | 44 const profiles::ProfileStatisticsCallback& stats_callback); |
| 45 | 45 |
| 46 // The method below is used for testing. | 46 // The method below is used for testing. |
| 47 size_t GetCallbackCount(); | 47 size_t GetCallbackCount(); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 friend class base::RefCountedThreadSafe<ProfileStatisticsAggregator>; | 50 friend class base::RefCountedThreadSafe<ProfileStatisticsAggregator>; |
| 51 | 51 |
| 52 struct ProfileStatValue { | 52 struct ProfileStatValue { |
| 53 int count; | 53 int count = 0; |
| 54 bool success; // false means the statistics failed to load | 54 bool success = false; // False means the statistics failed to load. |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 ~ProfileStatisticsAggregator(); | 57 ~ProfileStatisticsAggregator(); |
| 58 | 58 |
| 59 // Start gathering statistics. Also cancels existing statistics tasks. | 59 // Start gathering statistics. Also cancels existing statistics tasks. |
| 60 void StartAggregator(); | 60 void StartAggregator(); |
| 61 | 61 |
| 62 // Callback functions | 62 // Callback functions |
| 63 // Normal callback. Appends result to |profile_category_stats_|, and then call | 63 // Normal callback. Appends result to |profile_category_stats_|, and then call |
| 64 // the external callback. All other callbacks call this function. | 64 // the external callback. All other callbacks call this function. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // Bookmark counting | 150 // Bookmark counting |
| 151 std::unique_ptr<BookmarkModelHelper> bookmark_model_helper_; | 151 std::unique_ptr<BookmarkModelHelper> bookmark_model_helper_; |
| 152 | 152 |
| 153 // Password counting. | 153 // Password counting. |
| 154 PasswordStoreConsumerHelper password_store_consumer_helper_; | 154 PasswordStoreConsumerHelper password_store_consumer_helper_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(ProfileStatisticsAggregator); | 156 DISALLOW_COPY_AND_ASSIGN(ProfileStatisticsAggregator); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 #endif // CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ | 159 #endif // CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_ |
| OLD | NEW |