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 "components/metrics/metrics_log.h" | 5 #include "components/metrics/metrics_log.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 system_profile->set_app_version(client->GetVersionString()); | 170 system_profile->set_app_version(client->GetVersionString()); |
171 system_profile->set_channel(client->GetChannel()); | 171 system_profile->set_channel(client->GetChannel()); |
172 system_profile->set_application_locale(client->GetApplicationLocale()); | 172 system_profile->set_application_locale(client->GetApplicationLocale()); |
173 | 173 |
174 #if defined(SYZYASAN) | 174 #if defined(SYZYASAN) |
175 system_profile->set_is_asan_build(true); | 175 system_profile->set_is_asan_build(true); |
176 #endif | 176 #endif |
177 | 177 |
178 metrics::SystemProfileProto::Hardware* hardware = | 178 metrics::SystemProfileProto::Hardware* hardware = |
179 system_profile->mutable_hardware(); | 179 system_profile->mutable_hardware(); |
| 180 #if !defined(OS_IOS) |
| 181 // On iOS, OperatingSystemArchitecture() returns values like iPad4,4 which is |
| 182 // not the actual CPU architecture. Don't set it until the API is fixed. See |
| 183 // crbug.com/370104 for details. |
180 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 184 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
| 185 #endif |
181 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 186 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
182 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); | 187 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); |
183 #if defined(OS_WIN) | 188 #if defined(OS_WIN) |
184 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); | 189 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); |
185 #endif | 190 #endif |
186 | 191 |
187 metrics::SystemProfileProto::OS* os = system_profile->mutable_os(); | 192 metrics::SystemProfileProto::OS* os = system_profile->mutable_os(); |
188 os->set_name(base::SysInfo::OperatingSystemName()); | 193 os->set_name(base::SysInfo::OperatingSystemName()); |
189 os->set_version(base::SysInfo::OperatingSystemVersion()); | 194 os->set_version(base::SysInfo::OperatingSystemVersion()); |
190 #if defined(OS_ANDROID) | 195 #if defined(OS_ANDROID) |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 DCHECK(!closed_); | 462 DCHECK(!closed_); |
458 closed_ = true; | 463 closed_ = true; |
459 } | 464 } |
460 | 465 |
461 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 466 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
462 DCHECK(closed_); | 467 DCHECK(closed_); |
463 uma_proto_.SerializeToString(encoded_log); | 468 uma_proto_.SerializeToString(encoded_log); |
464 } | 469 } |
465 | 470 |
466 } // namespace metrics | 471 } // namespace metrics |
OLD | NEW |