Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: components/metrics/metrics_log.cc

Issue 2005513002: Fix for setting the os listed in metrics reporting for Blimp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to resolve patch failure. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/metrics/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 10 #include <memory>
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // HardwareModelName() will return an empty string on platforms where it's 344 // HardwareModelName() will return an empty string on platforms where it's
345 // not implemented or if an error occured. 345 // not implemented or if an error occured.
346 hardware->set_hardware_class(base::SysInfo::HardwareModelName()); 346 hardware->set_hardware_class(base::SysInfo::HardwareModelName());
347 347
348 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture()); 348 hardware->set_cpu_architecture(base::SysInfo::OperatingSystemArchitecture());
349 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB()); 349 hardware->set_system_ram_mb(base::SysInfo::AmountOfPhysicalMemoryMB());
350 #if defined(OS_WIN) 350 #if defined(OS_WIN)
351 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE())); 351 hardware->set_dll_base(reinterpret_cast<uint64_t>(CURRENT_MODULE()));
352 #endif 352 #endif
353 353
354 SystemProfileProto::OS* os = system_profile->mutable_os();
354 #if defined(OVERRIDE_OS_NAME_TO_BLIMP) 355 #if defined(OVERRIDE_OS_NAME_TO_BLIMP)
355 os->set_name("Blimp"); 356 os->set_name("Blimp");
356 #else 357 #else
357 SystemProfileProto::OS* os = system_profile->mutable_os();
358 std::string os_name = base::SysInfo::OperatingSystemName(); 358 std::string os_name = base::SysInfo::OperatingSystemName();
359 os->set_name(os_name); 359 os->set_name(os_name);
360 #endif 360 #endif
361 361
362 os->set_version(base::SysInfo::OperatingSystemVersion()); 362 os->set_version(base::SysInfo::OperatingSystemVersion());
363 #if defined(OS_ANDROID) 363 #if defined(OS_ANDROID)
364 os->set_fingerprint( 364 os->set_fingerprint(
365 base::android::BuildInfo::GetInstance()->android_build_fp()); 365 base::android::BuildInfo::GetInstance()->android_build_fp());
366 #endif 366 #endif
367 367
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 DCHECK(!closed_); 414 DCHECK(!closed_);
415 closed_ = true; 415 closed_ = true;
416 } 416 }
417 417
418 void MetricsLog::GetEncodedLog(std::string* encoded_log) { 418 void MetricsLog::GetEncodedLog(std::string* encoded_log) {
419 DCHECK(closed_); 419 DCHECK(closed_);
420 uma_proto_.SerializeToString(encoded_log); 420 uma_proto_.SerializeToString(encoded_log);
421 } 421 }
422 422
423 } // namespace metrics 423 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698