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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 system_profile->set_uma_enabled_date(RoundSecondsToHour(enabled_date)); | 329 system_profile->set_uma_enabled_date(RoundSecondsToHour(enabled_date)); |
330 | 330 |
331 int64 install_date = local_state_->GetInt64(prefs::kInstallDate); | 331 int64 install_date = local_state_->GetInt64(prefs::kInstallDate); |
332 | 332 |
333 // Reduce granularity of the install_date field to nearest hour. | 333 // Reduce granularity of the install_date field to nearest hour. |
334 system_profile->set_install_date(RoundSecondsToHour(install_date)); | 334 system_profile->set_install_date(RoundSecondsToHour(install_date)); |
335 | 335 |
336 system_profile->set_application_locale(client_->GetApplicationLocale()); | 336 system_profile->set_application_locale(client_->GetApplicationLocale()); |
337 | 337 |
338 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); | 338 SystemProfileProto::Hardware* hardware = system_profile->mutable_hardware(); |
| 339 |
| 340 // By default, the hardware class is empty (i.e., unknown). |
| 341 hardware->set_hardware_class(std::string()); |
| 342 |
339 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); | 343 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); |
340 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); | 344 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); |
341 #if defined(OS_WIN) | 345 #if defined(OS_WIN) |
342 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); | 346 hardware->set_dll_base(reinterpret_cast<uint64>(&__ImageBase)); |
343 #endif | 347 #endif |
344 | 348 |
345 SystemProfileProto::OS* os = system_profile->mutable_os(); | 349 SystemProfileProto::OS* os = system_profile->mutable_os(); |
346 std::string os_name = base::SysInfo::OperatingSystemName(); | 350 std::string os_name = base::SysInfo::OperatingSystemName(); |
347 #if defined(OS_WIN) | 351 #if defined(OS_WIN) |
348 // TODO(mad): This only checks whether the main process is a Metro process at | 352 // TODO(mad): This only checks whether the main process is a Metro process at |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 profile = uma_proto()->add_profiler_event(); | 425 profile = uma_proto()->add_profiler_event(); |
422 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); | 426 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); |
423 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); | 427 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); |
424 } else { | 428 } else { |
425 // For the remaining calls, re-use the existing field. | 429 // For the remaining calls, re-use the existing field. |
426 profile = uma_proto()->mutable_profiler_event(0); | 430 profile = uma_proto()->mutable_profiler_event(0); |
427 } | 431 } |
428 | 432 |
429 WriteProfilerData(process_data, process_type, profile); | 433 WriteProfilerData(process_data, process_type, profile); |
430 } | 434 } |
OLD | NEW |