OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
334 // Reduce granularity of the enabled_date field to nearest hour. | 334 // Reduce granularity of the enabled_date field to nearest hour. |
335 system_profile->set_uma_enabled_date(RoundSecondsToHour(enabled_date)); | 335 system_profile->set_uma_enabled_date(RoundSecondsToHour(enabled_date)); |
336 | 336 |
337 int64 install_date = local_state_->GetInt64(prefs::kInstallDate); | 337 int64 install_date = local_state_->GetInt64(prefs::kInstallDate); |
338 | 338 |
339 // Reduce granularity of the install_date field to nearest hour. | 339 // Reduce granularity of the install_date field to nearest hour. |
340 system_profile->set_install_date(RoundSecondsToHour(install_date)); | 340 system_profile->set_install_date(RoundSecondsToHour(install_date)); |
341 | 341 |
342 system_profile->set_application_locale(client_->GetApplicationLocale()); | 342 system_profile->set_application_locale(client_->GetApplicationLocale()); |
343 | 343 |
344 // By default, the hardware class is empty (i.e., unknown). | |
345 set_hardware_class(""); | |
Alexei Svitkine (slow)
2014/05/28 15:50:10
Nit: Inline set_hardware_class() and remove that m
blundell
2014/05/28 18:39:35
Done.
| |
344 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); | 346 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); |
345 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 347 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
346 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 348 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
347 #if defined(OS_WIN) | 349 #if defined(OS_WIN) |
348 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); | 350 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); |
349 #endif | 351 #endif |
350 | 352 |
351 SystemProfileProto::OS* os = system_profile->mutable_os(); | 353 SystemProfileProto::OS* os = system_profile->mutable_os(); |
352 std::string os_name = base::SysInfo::OperatingSystemName(); | 354 std::string os_name = base::SysInfo::OperatingSystemName(); |
353 #if defined(OS_WIN) | 355 #if defined(OS_WIN) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
427 profile = uma_proto()->add_profiler_event(); | 429 profile = uma_proto()->add_profiler_event(); |
428 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); | 430 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); |
429 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); | 431 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); |
430 } else { | 432 } else { |
431 // For the remaining calls, re-use the existing field. | 433 // For the remaining calls, re-use the existing field. |
432 profile = uma_proto()->mutable_profiler_event(0); | 434 profile = uma_proto()->mutable_profiler_event(0); |
433 } | 435 } |
434 | 436 |
435 WriteProfilerData(process_data, process_type, profile); | 437 WriteProfilerData(process_data, process_type, profile); |
436 } | 438 } |
OLD | NEW |