| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 // HardwareModelName() will return an empty string on platforms where it's | 344 // HardwareModelName() will return an empty string on platforms where it's |
| 345 // not implemented or if an error occured. | 345 // not implemented or if an error occured. |
| 346 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); | 346 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); |
| 347 | 347 |
| 348 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 348 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
| 349 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 349 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
| 350 #if defined(OS_WIN) | 350 #if defined(OS_WIN) |
| 351 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); | 351 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); |
| 352 #endif | 352 #endif |
| 353 | 353 |
| 354 SystemProfileProto::OS* os = system_profile->mutable_os(); |
| 354 #if defined(OVERRIDE_OS_NAME_TO_BLIMP) | 355 #if defined(OVERRIDE_OS_NAME_TO_BLIMP) |
| 355 os->set_name("Blimp"); | 356 os->set_name("Blimp"); |
| 356 #else | 357 #else |
| 357 SystemProfileProto::OS* os = system_profile->mutable_os(); | |
| 358 std::string os_name = base::SysInfo::OperatingSystemName(); | 358 std::string os_name = base::SysInfo::OperatingSystemName(); |
| 359 os->set_name(os_name); | 359 os->set_name(os_name); |
| 360 #endif | 360 #endif |
| 361 | 361 |
| 362 os->set_version(base::SysInfo::OperatingSystemVersion()); | 362 os->set_version(base::SysInfo::OperatingSystemVersion()); |
| 363 #if defined(OS_ANDROID) | 363 #if defined(OS_ANDROID) |
| 364 os->set_fingerprint( | 364 os->set_fingerprint( |
| 365 base::android::BuildInfo::GetInstance()->android_build_fp()); | 365 base::android::BuildInfo::GetInstance()->android_build_fp()); |
| 366 #endif | 366 #endif |
| 367 | 367 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 DCHECK(!closed_); | 414 DCHECK(!closed_); |
| 415 closed_ = true; | 415 closed_ = true; |
| 416 } | 416 } |
| 417 | 417 |
| 418 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 418 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
| 419 DCHECK(closed_); | 419 DCHECK(closed_); |
| 420 uma_proto_.SerializeToString(encoded_log); | 420 uma_proto_.SerializeToString(encoded_log); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } // namespace metrics | 423 } // namespace metrics |
| OLD | NEW |