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 <string> | 10 #include <string> |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // HardwareModelName() will return an empty string on platforms where it's | 318 // HardwareModelName() will return an empty string on platforms where it's |
319 // not implemented or if an error occured. | 319 // not implemented or if an error occured. |
320 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); | 320 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); |
321 | 321 |
322 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 322 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
323 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 323 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
324 #if defined(OS_WIN) | 324 #if defined(OS_WIN) |
325 hardware->set_dll_base(reinterpret_cast<uint64_t>(&__ImageBase)); | 325 hardware->set_dll_base(reinterpret_cast<uint64_t>(&__ImageBase)); |
326 #endif | 326 #endif |
327 | 327 |
| 328 #if defined(OVERRIDE_OS_NAME_TO_BLIMP) |
| 329 os->set_name("Blimp"); |
| 330 #else |
328 SystemProfileProto::OS* os = system_profile->mutable_os(); | 331 SystemProfileProto::OS* os = system_profile->mutable_os(); |
329 std::string os_name = base::SysInfo::OperatingSystemName(); | 332 std::string os_name = base::SysInfo::OperatingSystemName(); |
330 os->set_name(os_name); | 333 os->set_name(os_name); |
| 334 #endif |
| 335 |
331 os->set_version(base::SysInfo::OperatingSystemVersion()); | 336 os->set_version(base::SysInfo::OperatingSystemVersion()); |
332 #if defined(OS_ANDROID) | 337 #if defined(OS_ANDROID) |
333 os->set_fingerprint( | 338 os->set_fingerprint( |
334 base::android::BuildInfo::GetInstance()->android_build_fp()); | 339 base::android::BuildInfo::GetInstance()->android_build_fp()); |
335 #endif | 340 #endif |
336 | 341 |
337 base::CPU cpu_info; | 342 base::CPU cpu_info; |
338 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); | 343 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); |
339 cpu->set_vendor_name(cpu_info.vendor_name()); | 344 cpu->set_vendor_name(cpu_info.vendor_name()); |
340 cpu->set_signature(cpu_info.signature()); | 345 cpu->set_signature(cpu_info.signature()); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 DCHECK(!closed_); | 388 DCHECK(!closed_); |
384 closed_ = true; | 389 closed_ = true; |
385 } | 390 } |
386 | 391 |
387 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 392 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
388 DCHECK(closed_); | 393 DCHECK(closed_); |
389 uma_proto_.SerializeToString(encoded_log); | 394 uma_proto_.SerializeToString(encoded_log); |
390 } | 395 } |
391 | 396 |
392 } // namespace metrics | 397 } // namespace metrics |
OLD | NEW |