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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // not implemented or if an error occured. | 383 // not implemented or if an error occured. |
384 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); | 384 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); |
385 | 385 |
386 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 386 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
387 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 387 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
388 #if defined(OS_WIN) | 388 #if defined(OS_WIN) |
389 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); | 389 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); |
390 #endif | 390 #endif |
391 | 391 |
392 SystemProfileProto::OS* os = system_profile->mutable_os(); | 392 SystemProfileProto::OS* os = system_profile->mutable_os(); |
393 #if defined(OVERRIDE_OS_NAME_TO_BLIMP) | |
394 os->set_name("Blimp"); | |
395 #else | |
396 std::string os_name = base::SysInfo::OperatingSystemName(); | 393 std::string os_name = base::SysInfo::OperatingSystemName(); |
397 os->set_name(os_name); | 394 os->set_name(os_name); |
398 #endif | |
399 | 395 |
400 os->set_version(base::SysInfo::OperatingSystemVersion()); | 396 os->set_version(base::SysInfo::OperatingSystemVersion()); |
401 #if defined(OS_ANDROID) | 397 #if defined(OS_ANDROID) |
402 os->set_fingerprint( | 398 os->set_fingerprint( |
403 base::android::BuildInfo::GetInstance()->android_build_fp()); | 399 base::android::BuildInfo::GetInstance()->android_build_fp()); |
404 #endif | 400 #endif |
405 | 401 |
406 base::CPU cpu_info; | 402 base::CPU cpu_info; |
407 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); | 403 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); |
408 cpu->set_vendor_name(cpu_info.vendor_name()); | 404 cpu->set_vendor_name(cpu_info.vendor_name()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 DCHECK(!closed_); | 457 DCHECK(!closed_); |
462 closed_ = true; | 458 closed_ = true; |
463 } | 459 } |
464 | 460 |
465 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 461 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
466 DCHECK(closed_); | 462 DCHECK(closed_); |
467 uma_proto_.SerializeToString(encoded_log); | 463 uma_proto_.SerializeToString(encoded_log); |
468 } | 464 } |
469 | 465 |
470 } // namespace metrics | 466 } // namespace metrics |
OLD | NEW |