Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: chrome/browser/profiles/profile_statistics_aggregator.h

Issue 2915053002: Replace profile statistics preference count with AutofillCounter (Closed)
Patch Set: change to SetBooleanWithoutPathExpansion Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« no previous file with comments | « chrome/browser/profiles/profile_statistics.cc ('k') | chrome/browser/profiles/profile_statistics_aggregator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698