| 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/safe_browsing/incident_reporting/environment_data_colle
ction.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle
ction.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 case VersionInfo::CHANNEL_STABLE: | 34 case VersionInfo::CHANNEL_STABLE: |
| 35 return Process::CHANNEL_STABLE; | 35 return Process::CHANNEL_STABLE; |
| 36 default: | 36 default: |
| 37 return Process::CHANNEL_UNKNOWN; | 37 return Process::CHANNEL_UNKNOWN; |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 // Populates |process| with data related to the chrome browser process. | 41 // Populates |process| with data related to the chrome browser process. |
| 42 void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) { | 42 void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) { |
| 43 chrome::VersionInfo version_info; | 43 chrome::VersionInfo version_info; |
| 44 if (version_info.is_valid()) { | 44 // TODO(grt): Move this logic into VersionInfo (it also appears in |
| 45 // TODO(grt): Move this logic into VersionInfo (it also appears in | 45 // ChromeMetricsServiceClient). |
| 46 // ChromeMetricsServiceClient). | 46 std::string version(version_info.Version()); |
| 47 std::string version(version_info.Version()); | |
| 48 #if defined(ARCH_CPU_64_BITS) | 47 #if defined(ARCH_CPU_64_BITS) |
| 49 version += "-64"; | 48 version += "-64"; |
| 50 #endif // defined(ARCH_CPU_64_BITS) | 49 #endif // defined(ARCH_CPU_64_BITS) |
| 51 if (!version_info.IsOfficialBuild()) | 50 if (!version_info.IsOfficialBuild()) |
| 52 version += "-devel"; | 51 version += "-devel"; |
| 53 process->set_version(version); | 52 process->set_version(version); |
| 54 } | |
| 55 | 53 |
| 56 process->set_chrome_update_channel( | 54 process->set_chrome_update_channel( |
| 57 MapChannelToProtobuf(chrome::VersionInfo::GetChannel())); | 55 MapChannelToProtobuf(chrome::VersionInfo::GetChannel())); |
| 58 | 56 |
| 59 CollectPlatformProcessData(process); | 57 CollectPlatformProcessData(process); |
| 60 } | 58 } |
| 61 | 59 |
| 62 } // namespace | 60 } // namespace |
| 63 | 61 |
| 64 void CollectEnvironmentData(ClientIncidentReport_EnvironmentData* data) { | 62 void CollectEnvironmentData(ClientIncidentReport_EnvironmentData* data) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 85 | 83 |
| 86 #if !defined(OS_WIN) | 84 #if !defined(OS_WIN) |
| 87 void CollectPlatformProcessData( | 85 void CollectPlatformProcessData( |
| 88 ClientIncidentReport_EnvironmentData_Process* process) { | 86 ClientIncidentReport_EnvironmentData_Process* process) { |
| 89 // Empty implementation for platforms that do not (yet) have their own | 87 // Empty implementation for platforms that do not (yet) have their own |
| 90 // implementations. | 88 // implementations. |
| 91 } | 89 } |
| 92 #endif | 90 #endif |
| 93 | 91 |
| 94 } // namespace safe_browsing | 92 } // namespace safe_browsing |
| OLD | NEW |