Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_ | |
| 6 #define COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 class PrefService; | |
| 13 class PrefRegistrySimple; | |
| 14 | |
| 15 namespace metrics { | |
| 16 | |
| 17 class SystemProfileProto; | |
| 18 | |
| 19 // 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.
| |
| 20 class EnvironmentRecorder { | |
| 21 public: | |
| 22 explicit EnvironmentRecorder(PrefService* local_state); | |
| 23 ~EnvironmentRecorder(); | |
| 24 | |
| 25 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.
| |
| 26 const SystemProfileProto& system_profile); | |
| 27 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.
| |
| 28 void ClearEnvironmentFromPrefs(); | |
| 29 | |
| 30 int64_t GetLastBuildtime(); | |
| 31 std::string GetLastVersion(); | |
| 32 void SetBuildtimeAndVersion(int64_t buildtime, const std::string& version); | |
| 33 | |
| 34 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
| |
| 35 | |
| 36 private: | |
| 37 PrefService* local_state_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(EnvironmentRecorder); | |
| 40 }; | |
| 41 | |
| 42 } // namespace metrics | |
| 43 | |
| 44 #endif // COMPONENTS_METRICS_ENVIRONMENT_RECORDER_H_ | |
| OLD | NEW |