| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_browser_main_extra_parts_metrics.h" | 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 115 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 116 } | 116 } |
| 117 | 117 |
| 118 void RecordLinuxGlibcVersion() { | 118 void RecordLinuxGlibcVersion() { |
| 119 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 119 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 120 Version version(gnu_get_libc_version()); | 120 Version version(gnu_get_libc_version()); |
| 121 | 121 |
| 122 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; | 122 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; |
| 123 if (version.IsValid() && version.components().size() == 2) { | 123 if (version.IsValid() && version.components().size() == 2) { |
| 124 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; | 124 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; |
| 125 int glibc_major_version = version.components()[0]; | 125 uint32 glibc_major_version = version.components()[0]; |
| 126 int glibc_minor_version = version.components()[1]; | 126 uint32 glibc_minor_version = version.components()[1]; |
| 127 if (glibc_major_version == 2) { | 127 if (glibc_major_version == 2) { |
| 128 // A constant to translate glibc 2.x minor versions to their | 128 // A constant to translate glibc 2.x minor versions to their |
| 129 // equivalent UMALinuxGlibcVersion values. | 129 // equivalent UMALinuxGlibcVersion values. |
| 130 const int kGlibcMinorVersionTranslationOffset = 11 - UMA_LINUX_GLIBC_2_11; | 130 const int kGlibcMinorVersionTranslationOffset = 11 - UMA_LINUX_GLIBC_2_11; |
| 131 int translated_glibc_minor_version = | 131 uint32 translated_glibc_minor_version = |
| 132 glibc_minor_version - kGlibcMinorVersionTranslationOffset; | 132 glibc_minor_version - kGlibcMinorVersionTranslationOffset; |
| 133 if (translated_glibc_minor_version >= UMA_LINUX_GLIBC_2_11) { | 133 if (translated_glibc_minor_version >= UMA_LINUX_GLIBC_2_11) { |
| 134 glibc_version_result = | 134 glibc_version_result = |
| 135 static_cast<UMALinuxGlibcVersion>(translated_glibc_minor_version); | 135 static_cast<UMALinuxGlibcVersion>(translated_glibc_minor_version); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 UMA_HISTOGRAM_SPARSE_SLOWLY("Linux.GlibcVersion", glibc_version_result); | 139 UMA_HISTOGRAM_SPARSE_SLOWLY("Linux.GlibcVersion", glibc_version_result); |
| 140 #endif | 140 #endif |
| 141 } | 141 } |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 namespace chrome { | 297 namespace chrome { |
| 298 | 298 |
| 299 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 299 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
| 300 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 300 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace chrome | 303 } // namespace chrome |
| OLD | NEW |