Chromium Code Reviews| 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 uma_proto()->mutable_system_profile()->mutable_hardware()->set_hardware_class( | |
|
Alexei Svitkine (slow)
2014/05/28 18:45:57
Nit: you have a |hardware| section just below this
blundell
2014/05/28 18:59:49
Done.
| |
| 346 std::string()); | |
| 347 | |
| 344 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); | 348 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); |
| 345 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 349 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
| 346 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 350 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
| 347 #if defined(OS_WIN) | 351 #if defined(OS_WIN) |
| 348 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); | 352 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); |
| 349 #endif | 353 #endif |
| 350 | 354 |
| 351 SystemProfileProto::OS* os = system_profile->mutable_os(); | 355 SystemProfileProto::OS* os = system_profile->mutable_os(); |
| 352 std::string os_name = base::SysInfo::OperatingSystemName(); | 356 std::string os_name = base::SysInfo::OperatingSystemName(); |
| 353 #if defined(OS_WIN) | 357 #if defined(OS_WIN) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 profile = uma_proto()->add_profiler_event(); | 431 profile = uma_proto()->add_profiler_event(); |
| 428 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); | 432 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); |
| 429 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); | 433 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); |
| 430 } else { | 434 } else { |
| 431 // For the remaining calls, re-use the existing field. | 435 // For the remaining calls, re-use the existing field. |
| 432 profile = uma_proto()->mutable_profiler_event(0); | 436 profile = uma_proto()->mutable_profiler_event(0); |
| 433 } | 437 } |
| 434 | 438 |
| 435 WriteProfilerData(process_data, process_type, profile); | 439 WriteProfilerData(process_data, process_type, profile); |
| 436 } | 440 } |
| OLD | NEW |