| Index: chrome/browser/profiles/profile_statistics_aggregator.h
|
| diff --git a/chrome/browser/profiles/profile_statistics_aggregator.h b/chrome/browser/profiles/profile_statistics_aggregator.h
|
| index d7d361b96727939aa85b6095d296eb8f3d2082b4..39adc64bc23aa5acb1f6fb51dded95cb893a546f 100644
|
| --- a/chrome/browser/profiles/profile_statistics_aggregator.h
|
| +++ b/chrome/browser/profiles/profile_statistics_aggregator.h
|
| @@ -5,65 +5,40 @@
|
| #ifndef CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_
|
| #define CHROME_BROWSER_PROFILES_PROFILE_STATISTICS_AGGREGATOR_H_
|
|
|
| -#include <stddef.h>
|
| -
|
| #include <memory>
|
| -#include <set>
|
| #include <vector>
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/files/file_path.h"
|
| -#include "base/memory/ref_counted.h"
|
| -#include "base/task/cancelable_task_tracker.h"
|
| -#include "base/task_runner.h"
|
| #include "chrome/browser/profiles/profile_statistics_common.h"
|
| #include "components/browsing_data/core/counters/browsing_data_counter.h"
|
|
|
| class Profile;
|
|
|
| -class ProfileStatisticsAggregator
|
| - : public base::RefCountedThreadSafe<ProfileStatisticsAggregator> {
|
| - // This class is used internally by GetProfileStatistics and
|
| - // StoreProfileStatisticsToCache.
|
| +class ProfileStatisticsAggregator {
|
| + // This class is used internally by ProfileStatistics
|
| //
|
| // The class collects statistical information about the profile and returns
|
| // the information via a callback function. Currently bookmarks, history,
|
| - // logins and preferences are counted.
|
| - //
|
| - // The class is RefCounted because this is needed for CancelableTaskTracker
|
| - // to function properly.
|
| + // logins and sites with autofill forms are counted.
|
|
|
| public:
|
| ProfileStatisticsAggregator(Profile* profile,
|
| const base::Closure& done_callback);
|
|
|
| + ~ProfileStatisticsAggregator();
|
| +
|
| void AddCallbackAndStartAggregator(
|
| const profiles::ProfileStatisticsCallback& stats_callback);
|
|
|
| - // The method below is used for testing.
|
| - size_t GetCallbackCount();
|
| -
|
| private:
|
| - friend class base::RefCountedThreadSafe<ProfileStatisticsAggregator>;
|
| -
|
| - struct ProfileStatValue {
|
| - int count = 0;
|
| - bool success = false; // False means the statistics failed to load.
|
| - };
|
| -
|
| - ~ProfileStatisticsAggregator();
|
| -
|
| // Start gathering statistics. Also cancels existing statistics tasks.
|
| void StartAggregator();
|
|
|
| // Callback functions
|
| - // Normal callback. Appends result to |profile_category_stats_|, and then call
|
| - // the external callback. All other callbacks call this function.
|
| - void StatisticsCallback(const char* category, ProfileStatValue result);
|
| - // Callback for reporting success.
|
| - void StatisticsCallbackSuccess(const char* category, int count);
|
| - // Callback for reporting failure.
|
| - void StatisticsCallbackFailure(const char* category);
|
| + // Appends result to |profile_category_stats_|, and then calls
|
| + // the external callback.
|
| + void StatisticsCallback(const char* category, int count);
|
|
|
| // Callback for counters.
|
| void OnCounterResult(
|
| @@ -72,9 +47,6 @@ class ProfileStatisticsAggregator
|
| // Registers, initializes and starts a BrowsingDataCounter.
|
| void AddCounter(std::unique_ptr<browsing_data::BrowsingDataCounter> counter);
|
|
|
| - // Preference counting.
|
| - ProfileStatValue CountPrefs() const;
|
| -
|
| Profile* profile_;
|
| base::FilePath profile_path_;
|
| profiles::ProfileCategoryStats profile_category_stats_;
|
| @@ -86,8 +58,6 @@ class ProfileStatisticsAggregator
|
| // Callback function to be called when all statistics are calculated.
|
| base::Closure done_callback_;
|
|
|
| - base::CancelableTaskTracker tracker_;
|
| -
|
| std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ProfileStatisticsAggregator);
|
|
|