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

Unified Diff: trunk/src/chrome/browser/prefs/pref_metrics_service.h

Issue 23597020: Revert 221944 "Add UMA to report Preferences File Corruption" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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: trunk/src/chrome/browser/prefs/pref_metrics_service.h
===================================================================
--- trunk/src/chrome/browser/prefs/pref_metrics_service.h (revision 221965)
+++ trunk/src/chrome/browser/prefs/pref_metrics_service.h (working copy)
@@ -10,15 +10,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
-#include "base/memory/weak_ptr.h"
-#include "base/prefs/pref_change_registrar.h"
#include "chrome/browser/prefs/synced_pref_change_registrar.h"
#include "chrome/browser/profiles/profile.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
-class PrefRegistrySimple;
-
// PrefMetricsService is responsible for recording prefs-related UMA stats.
class PrefMetricsService : public BrowserContextKeyedService {
public:
@@ -44,23 +40,16 @@
content::BrowserContext* context) const OVERRIDE;
};
- // Registers preferences in local state.
- static void RegisterPrefs(PrefRegistrySimple* registry);
-
private:
- friend class PrefMetricsServiceTest;
+ // Use a map to convert domains to their histogram identifiers. Ids are
+ // defined in tools/metrics/histograms/histograms.xml and (usually) also in
+ // chrome/browser/search_engines/prepopulated_engines.json.
+ typedef std::map<std::string, int> DomainIdMap;
// Function to log a Value to a histogram
typedef base::Callback<void(const std::string&, const Value*)>
LogHistogramValueCallback;
- // For unit testing only.
- PrefMetricsService(Profile* profile,
- PrefService* local_settings,
- const std::string& device_id,
- const char** tracked_pref_paths,
- int tracked_pref_path_count);
-
// Record prefs state on browser context creation.
void RecordLaunchPrefs();
@@ -93,45 +82,8 @@
const std::string& histogram_name,
const Value* value);
- // Callback to receive a unique device_id.
- void GetDeviceIdCallback(const std::string& device_id);
-
- // Checks the tracked preferences against their last known values and reports
- // any discrepancies. This must be called after |device_id| has been set.
- void CheckTrackedPreferences();
-
- // Updates the hash of the tracked preference in local state. This must be
- // called after |device_id| has been set.
- void UpdateTrackedPreference(const char* path);
-
- // Removes the tracked preference from local state. Returns 'true' iff. the
- // value was present.
- bool RemoveTrackedPreference(const char* path);
-
- // Gets the path to the preference value hash in local state.
- std::string GetHashedPrefPath(const char* path);
-
- // Computes an MD5 hash for the given preference value.
- std::string GetHashedPrefValue(const char* path, const base::Value* value);
-
- void InitializePrefObservers();
-
Profile* profile_;
- PrefService* prefs_;
- PrefService* local_state_;
- std::string profile_name_;
- std::string pref_hash_seed_;
- std::string device_id_;
- const char** tracked_pref_paths_;
- const int tracked_pref_path_count_;
- bool checked_tracked_prefs_;
-
- PrefChangeRegistrar pref_registrar_;
scoped_ptr<SyncedPrefChangeRegistrar> synced_pref_change_registrar_;
-
- base::WeakPtrFactory<PrefMetricsService> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(PrefMetricsService);
};
#endif // CHROME_BROWSER_PREFS_PREF_METRICS_SERVICE_H_
« no previous file with comments | « trunk/src/chrome/browser/prefs/browser_prefs.cc ('k') | trunk/src/chrome/browser/prefs/pref_metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698