Chromium Code Reviews| 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_ |