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

Unified Diff: components/metrics/environment_recorder.h

Issue 2687393004: Gather stability prefs into managing objects. (Closed)
Patch Set: Remove unused method Created 3 years, 10 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: components/metrics/environment_recorder.h
diff --git a/components/metrics/environment_recorder.h b/components/metrics/environment_recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..051924b7656c3cbee8f7bfdf71d3a7e4a4c0bbf2
--- /dev/null
+++ b/components/metrics/environment_recorder.h
@@ -0,0 +1,44 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_
+#define COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_
+
+#include <string>
+
+#include "base/macros.h"
+
+class PrefService;
+class PrefRegistrySimple;
+
+namespace metrics {
+
+class SystemProfileProto;
+
+// Stores and loads system information to prefs for stability logs.
rkaplow 2017/02/14 20:11:19 to and from prefs for ... ?
Steven Holte 2017/02/15 22:42:09 Expanded comment.
+class EnvironmentRecorder {
+ public:
+ explicit EnvironmentRecorder(PrefService* local_state);
+ ~EnvironmentRecorder();
+
+ std::string RecordEnvironmentToPrefs(
rkaplow 2017/02/14 20:11:19 cna you also mention returns empty string if it wa
rkaplow 2017/02/14 20:11:19 prefer some comments - not obvious what string thi
Steven Holte 2017/02/15 22:42:09 Done.
Steven Holte 2017/02/15 22:42:09 Done.
+ const SystemProfileProto& system_profile);
+ bool LoadEnvironmentFromPrefs(SystemProfileProto* system_profile);
rkaplow 2017/02/14 20:11:19 similar, mention what is this returning (and it's
Steven Holte 2017/02/15 22:42:09 Done.
+ void ClearEnvironmentFromPrefs();
+
+ int64_t GetLastBuildtime();
+ std::string GetLastVersion();
+ void SetBuildtimeAndVersion(int64_t buildtime, const std::string& version);
+
+ static void RegisterPrefs(PrefRegistrySimple* registry);
rkaplow 2017/02/14 20:11:19 I havn't done a ton of pref logic, so maybe this i
Steven Holte 2017/02/15 22:42:09 No, this is a fairly common name. It is describin
+
+ private:
+ PrefService* local_state_;
+
+ DISALLOW_COPY_AND_ASSIGN(EnvironmentRecorder);
+};
+
+} // namespace metrics
+
+#endif // COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_

Powered by Google App Engine
This is Rietveld 408576698