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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // upload time; not whether the collected metrics were all gathered from | 332 // upload time; not whether the collected metrics were all gathered from |
333 // Metro. This is ok as an approximation for now, since users will rarely be | 333 // Metro. This is ok as an approximation for now, since users will rarely be |
334 // switching from Metro to Desktop mode; but we should re-evaluate whether we | 334 // switching from Metro to Desktop mode; but we should re-evaluate whether we |
335 // can distinguish metrics more cleanly in the future: http://crbug.com/140568 | 335 // can distinguish metrics more cleanly in the future: http://crbug.com/140568 |
336 if (base::win::IsMetroProcess()) | 336 if (base::win::IsMetroProcess()) |
337 os_name += " (Metro)"; | 337 os_name += " (Metro)"; |
338 #endif | 338 #endif |
339 os->set_name(os_name); | 339 os->set_name(os_name); |
340 os->set_version(base::SysInfo::OperatingSystemVersion()); | 340 os->set_version(base::SysInfo::OperatingSystemVersion()); |
341 #if defined(OS_ANDROID) | 341 #if defined(OS_ANDROID) |
342 os->set_fingerprint( | 342 os->set_fingerprint(base::android::BuildInfo::GetInstance()->build_fp()); |
343 base::android::BuildInfo::GetInstance()->android_build_fp()); | |
344 #endif | 343 #endif |
345 | 344 |
346 base::CPU cpu_info; | 345 base::CPU cpu_info; |
347 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); | 346 SystemProfileProto::Hardware::CPU* cpu = hardware->mutable_cpu(); |
348 cpu->set_vendor_name(cpu_info.vendor_name()); | 347 cpu->set_vendor_name(cpu_info.vendor_name()); |
349 cpu->set_signature(cpu_info.signature()); | 348 cpu->set_signature(cpu_info.signature()); |
350 cpu->set_num_cores(base::SysInfo::NumberOfProcessors()); | 349 cpu->set_num_cores(base::SysInfo::NumberOfProcessors()); |
351 | 350 |
352 std::vector<ActiveGroupId> field_trial_ids; | 351 std::vector<ActiveGroupId> field_trial_ids; |
353 GetFieldTrialIds(&field_trial_ids); | 352 GetFieldTrialIds(&field_trial_ids); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 DCHECK(!closed_); | 391 DCHECK(!closed_); |
393 closed_ = true; | 392 closed_ = true; |
394 } | 393 } |
395 | 394 |
396 void MetricsLog::GetEncodedLog(std::string* encoded_log) { | 395 void MetricsLog::GetEncodedLog(std::string* encoded_log) { |
397 DCHECK(closed_); | 396 DCHECK(closed_); |
398 uma_proto_.SerializeToString(encoded_log); | 397 uma_proto_.SerializeToString(encoded_log); |
399 } | 398 } |
400 | 399 |
401 } // namespace metrics | 400 } // namespace metrics |
OLD | NEW |