| 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" |
| 11 #include "chrome/common/chrome_version_info.h" | 11 #include "chrome/common/chrome_version_info.h" |
| 12 #include "chrome/common/safe_browsing/csd.pb.h" | 12 #include "chrome/common/safe_browsing/csd.pb.h" |
| 13 | 13 |
| 14 namespace safe_browsing { | 14 namespace safe_browsing { |
| 15 | 15 |
| 16 // Populates |process| with platform-specific data related to the chrome browser | 16 // Populates |process| with platform-specific data related to the chrome browser |
| 17 // process. | 17 // process. |
| 18 void CollectPlatformProcessData( | 18 void CollectPlatformProcessData( |
| 19 ClientIncidentReport_EnvironmentData_Process* process); | 19 ClientIncidentReport_EnvironmentData_Process* process); |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 ClientIncidentReport_EnvironmentData_Process_Channel MapChannelToProtobuf( | 23 ClientIncidentReport_EnvironmentData_Process_Channel MapChannelToProtobuf( |
| 24 chrome::VersionInfo::Channel channel) { | 24 version_info::Channel channel) { |
| 25 typedef chrome::VersionInfo VersionInfo; | |
| 26 typedef ClientIncidentReport_EnvironmentData_Process Process; | 25 typedef ClientIncidentReport_EnvironmentData_Process Process; |
| 27 switch (channel) { | 26 switch (channel) { |
| 28 case VersionInfo::CHANNEL_CANARY: | 27 case version_info::Channel::CANARY: |
| 29 return Process::CHANNEL_CANARY; | 28 return Process::CHANNEL_CANARY; |
| 30 case VersionInfo::CHANNEL_DEV: | 29 case version_info::Channel::DEV: |
| 31 return Process::CHANNEL_DEV; | 30 return Process::CHANNEL_DEV; |
| 32 case VersionInfo::CHANNEL_BETA: | 31 case version_info::Channel::BETA: |
| 33 return Process::CHANNEL_BETA; | 32 return Process::CHANNEL_BETA; |
| 34 case VersionInfo::CHANNEL_STABLE: | 33 case version_info::Channel::STABLE: |
| 35 return Process::CHANNEL_STABLE; | 34 return Process::CHANNEL_STABLE; |
| 36 default: | 35 default: |
| 37 return Process::CHANNEL_UNKNOWN; | 36 return Process::CHANNEL_UNKNOWN; |
| 38 } | 37 } |
| 39 } | 38 } |
| 40 | 39 |
| 41 // Populates |process| with data related to the chrome browser process. | 40 // Populates |process| with data related to the chrome browser process. |
| 42 void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) { | 41 void CollectProcessData(ClientIncidentReport_EnvironmentData_Process* process) { |
| 43 chrome::VersionInfo version_info; | 42 chrome::VersionInfo version_info; |
| 44 // TODO(grt): Move this logic into VersionInfo (it also appears in | 43 // TODO(grt): Move this logic into VersionInfo (it also appears in |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 82 |
| 84 #if !defined(OS_WIN) | 83 #if !defined(OS_WIN) |
| 85 void CollectPlatformProcessData( | 84 void CollectPlatformProcessData( |
| 86 ClientIncidentReport_EnvironmentData_Process* process) { | 85 ClientIncidentReport_EnvironmentData_Process* process) { |
| 87 // Empty implementation for platforms that do not (yet) have their own | 86 // Empty implementation for platforms that do not (yet) have their own |
| 88 // implementations. | 87 // implementations. |
| 89 } | 88 } |
| 90 #endif | 89 #endif |
| 91 | 90 |
| 92 } // namespace safe_browsing | 91 } // namespace safe_browsing |
| OLD | NEW |