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

Side by Side Diff: components/network_time/network_time_tracker.cc

Issue 2915273002: Update NetworkTimeQueries policy name in annotation (Closed)
Patch Set: Created 3 years, 6 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 | 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/network_time/network_time_tracker.h" 5 #include "components/network_time/network_time_tracker.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 "A request can be sent to retrieve the current time when the user " 473 "A request can be sent to retrieve the current time when the user "
474 "encounters an SSL date error, or in the background if Chromium " 474 "encounters an SSL date error, or in the background if Chromium "
475 "determines that it doesn't have an accurate timestamp." 475 "determines that it doesn't have an accurate timestamp."
476 data: "None" 476 data: "None"
477 destination: GOOGLE_OWNED_SERVICE 477 destination: GOOGLE_OWNED_SERVICE
478 } 478 }
479 policy { 479 policy {
480 cookies_allowed: false 480 cookies_allowed: false
481 setting: "This feature cannot be disabled by settings." 481 setting: "This feature cannot be disabled by settings."
482 chrome_policy { 482 chrome_policy {
483 NetworkTimeQueriesEnabled { 483 BrowserNetworkTimeQueriesEnabled {
484 NetworkTimeQueriesEnabled: false 484 BrowserNetworkTimeQueriesEnabled: false
485 } 485 }
486 } 486 }
487 })"); 487 })");
488 // This cancels any outstanding fetch. 488 // This cancels any outstanding fetch.
489 time_fetcher_ = net::URLFetcher::Create(url, net::URLFetcher::GET, this, 489 time_fetcher_ = net::URLFetcher::Create(url, net::URLFetcher::GET, this,
490 traffic_annotation); 490 traffic_annotation);
491 if (!time_fetcher_) { 491 if (!time_fetcher_) {
492 DVLOG(1) << "tried to make fetch happen; failed"; 492 DVLOG(1) << "tried to make fetch happen; failed";
493 return; 493 return;
494 } 494 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 base::Time network_time; 636 base::Time network_time;
637 if (GetNetworkTime(&network_time, nullptr) != NETWORK_TIME_AVAILABLE) { 637 if (GetNetworkTime(&network_time, nullptr) != NETWORK_TIME_AVAILABLE) {
638 return true; 638 return true;
639 } 639 }
640 640
641 // Otherwise, make the decision at random. 641 // Otherwise, make the decision at random.
642 return base::RandDouble() < RandomQueryProbability(); 642 return base::RandDouble() < RandomQueryProbability();
643 } 643 }
644 644
645 } // namespace network_time 645 } // namespace network_time
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698