| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { | 190 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { |
| 191 return google_brand::GetBrand(brand_code); | 191 return google_brand::GetBrand(brand_code); |
| 192 } | 192 } |
| 193 | 193 |
| 194 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() { | 194 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() { |
| 195 return AsProtobufChannel(chrome::VersionInfo::GetChannel()); | 195 return AsProtobufChannel(chrome::VersionInfo::GetChannel()); |
| 196 } | 196 } |
| 197 | 197 |
| 198 std::string ChromeMetricsServiceClient::GetVersionString() { | 198 std::string ChromeMetricsServiceClient::GetVersionString() { |
| 199 chrome::VersionInfo version_info; | 199 chrome::VersionInfo version_info; |
| 200 if (!version_info.is_valid()) { | |
| 201 NOTREACHED(); | |
| 202 return std::string(); | |
| 203 } | |
| 204 | |
| 205 std::string version = version_info.Version(); | 200 std::string version = version_info.Version(); |
| 206 #if defined(ARCH_CPU_64_BITS) | 201 #if defined(ARCH_CPU_64_BITS) |
| 207 version += "-64"; | 202 version += "-64"; |
| 208 #endif // defined(ARCH_CPU_64_BITS) | 203 #endif // defined(ARCH_CPU_64_BITS) |
| 209 if (!version_info.IsOfficialBuild()) | 204 if (!version_info.IsOfficialBuild()) |
| 210 version.append("-devel"); | 205 version.append("-devel"); |
| 211 return version; | 206 return version; |
| 212 } | 207 } |
| 213 | 208 |
| 214 void ChromeMetricsServiceClient::OnLogUploadComplete() { | 209 void ChromeMetricsServiceClient::OnLogUploadComplete() { |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 // Capture the histogram samples. | 553 // Capture the histogram samples. |
| 559 if (dumps_with_crash != 0) | 554 if (dumps_with_crash != 0) |
| 560 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 555 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
| 561 if (dumps_with_no_crash != 0) | 556 if (dumps_with_no_crash != 0) |
| 562 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 557 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
| 563 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 558 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
| 564 if (total_dumps != 0) | 559 if (total_dumps != 0) |
| 565 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 560 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
| 566 } | 561 } |
| 567 #endif // defined(OS_WIN) | 562 #endif // defined(OS_WIN) |
| OLD | NEW |