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

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 1030503003: Metrics log modification to handle external components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move deps Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/chrome_common.gypi » ('j') | chrome/common/metrics/DEPS » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/chrome_metrics_service_client.cc
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index 6aa71c8233d83c39f11217f8f3cbf356cb27f17d..c3f0abdccf96a048539d40aef7a73cd8c055abf0 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -28,8 +28,8 @@
#include "chrome/browser/ui/browser_otr_state.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/chrome_version_info.h"
#include "chrome/common/crash_keys.h"
+#include "chrome/common/metrics/version_utils.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "components/metrics/gpu/gpu_metrics_provider.h"
@@ -82,24 +82,6 @@ namespace {
// data.
const int kMaxHistogramGatheringWaitDuration = 60000; // 60 seconds.
-metrics::SystemProfileProto::Channel AsProtobufChannel(
- chrome::VersionInfo::Channel channel) {
- switch (channel) {
- case chrome::VersionInfo::CHANNEL_UNKNOWN:
- return metrics::SystemProfileProto::CHANNEL_UNKNOWN;
- case chrome::VersionInfo::CHANNEL_CANARY:
- return metrics::SystemProfileProto::CHANNEL_CANARY;
- case chrome::VersionInfo::CHANNEL_DEV:
- return metrics::SystemProfileProto::CHANNEL_DEV;
- case chrome::VersionInfo::CHANNEL_BETA:
- return metrics::SystemProfileProto::CHANNEL_BETA;
- case chrome::VersionInfo::CHANNEL_STABLE:
- return metrics::SystemProfileProto::CHANNEL_STABLE;
- }
- NOTREACHED();
- return metrics::SystemProfileProto::CHANNEL_UNKNOWN;
-}
-
// Standard interval between log uploads, in seconds.
#if defined(OS_ANDROID) || defined(OS_IOS)
const int kStandardUploadIntervalSeconds = 5 * 60; // Five minutes.
@@ -200,18 +182,11 @@ bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) {
}
metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() {
- return AsProtobufChannel(chrome::VersionInfo::GetChannel());
+ return metrics::AsProtobufChannel(chrome::VersionInfo::GetChannel());
}
std::string ChromeMetricsServiceClient::GetVersionString() {
- chrome::VersionInfo version_info;
- std::string version = version_info.Version();
-#if defined(ARCH_CPU_64_BITS)
- version += "-64";
-#endif // defined(ARCH_CPU_64_BITS)
- if (!version_info.IsOfficialBuild())
- version.append("-devel");
- return version;
+ return metrics::GetVersionString();
}
void ChromeMetricsServiceClient::OnLogUploadComplete() {
« no previous file with comments | « no previous file | chrome/chrome_common.gypi » ('j') | chrome/common/metrics/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698