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

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 compile failure Created 4 years, 4 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
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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 #if defined(OS_WIN) 404 #if defined(OS_WIN)
405 // Don't show the update bubbles to enterprise users (i.e., on a domain). 405 // Don't show the update bubbles to enterprise users (i.e., on a domain).
406 if (base::win::IsEnrolledToDomain()) 406 if (base::win::IsEnrolledToDomain())
407 return false; 407 return false;
408 #endif 408 #endif
409 } 409 }
410 410
411 base::Time network_time; 411 base::Time network_time;
412 base::TimeDelta uncertainty; 412 base::TimeDelta uncertainty;
413 if (!g_browser_process->network_time_tracker()->GetNetworkTime( 413 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time,
414 &network_time, &uncertainty)) { 414 &uncertainty) !=
415 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) {
Lei Zhang 2016/08/18 16:51:19 network time, network time, network time!
415 // When network time has not been initialized yet, simply rely on the 416 // When network time has not been initialized yet, simply rely on the
416 // machine's current time. 417 // machine's current time.
417 network_time = base::Time::Now(); 418 network_time = base::Time::Now();
418 } 419 }
419 420
420 if (network_time.is_null() || build_date_.is_null() || 421 if (network_time.is_null() || build_date_.is_null() ||
421 build_date_ > network_time) { 422 build_date_ > network_time) {
422 NOTREACHED(); 423 NOTREACHED();
423 return false; 424 return false;
424 } 425 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 515
515 // static 516 // static
516 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 517 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
517 return base::Singleton<UpgradeDetectorImpl>::get(); 518 return base::Singleton<UpgradeDetectorImpl>::get();
518 } 519 }
519 520
520 // static 521 // static
521 UpgradeDetector* UpgradeDetector::GetInstance() { 522 UpgradeDetector* UpgradeDetector::GetInstance() {
522 return UpgradeDetectorImpl::GetInstance(); 523 return UpgradeDetectorImpl::GetInstance();
523 } 524 }
OLDNEW
« no previous file with comments | « no previous file | components/network_time/network_time_tracker.h » ('j') | components/network_time/network_time_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698