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

Side by Side Diff: chrome/browser/upgrade_detector_impl.cc

Issue 2254433003: When network time is unavailable, record the reason in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix maximums to not overflow, and fix unit tests Created 4 years, 3 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 | « no previous file | components/network_time/network_time_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/upgrade_detector_impl.h" 5 #include "chrome/browser/upgrade_detector_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 #if defined(OS_WIN) 411 #if defined(OS_WIN)
412 // Don't show the update bubbles to enterprise users (i.e., on a domain). 412 // Don't show the update bubbles to enterprise users (i.e., on a domain).
413 if (base::win::IsEnrolledToDomain()) 413 if (base::win::IsEnrolledToDomain())
414 return false; 414 return false;
415 #endif 415 #endif
416 } 416 }
417 417
418 base::Time network_time; 418 base::Time network_time;
419 base::TimeDelta uncertainty; 419 base::TimeDelta uncertainty;
420 if (!g_browser_process->network_time_tracker()->GetNetworkTime( 420 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time,
421 &network_time, &uncertainty)) { 421 &uncertainty) !=
422 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) {
422 // When network time has not been initialized yet, simply rely on the 423 // When network time has not been initialized yet, simply rely on the
423 // machine's current time. 424 // machine's current time.
424 network_time = base::Time::Now(); 425 network_time = base::Time::Now();
425 } 426 }
426 427
427 if (network_time.is_null() || build_date_.is_null() || 428 if (network_time.is_null() || build_date_.is_null() ||
428 build_date_ > network_time) { 429 build_date_ > network_time) {
429 NOTREACHED(); 430 NOTREACHED();
430 return false; 431 return false;
431 } 432 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 522
522 // static 523 // static
523 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 524 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
524 return base::Singleton<UpgradeDetectorImpl>::get(); 525 return base::Singleton<UpgradeDetectorImpl>::get();
525 } 526 }
526 527
527 // static 528 // static
528 UpgradeDetector* UpgradeDetector::GetInstance() { 529 UpgradeDetector* UpgradeDetector::GetInstance() {
529 return UpgradeDetectorImpl::GetInstance(); 530 return UpgradeDetectorImpl::GetInstance();
530 } 531 }
OLDNEW
« no previous file with comments | « no previous file | components/network_time/network_time_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698