| OLD | NEW |
| 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 // This is a small utility that snarfs the server time from the | 5 // This is a small utility that snarfs the server time from the |
| 6 // response headers of an http/https HEAD request and compares it to | 6 // response headers of an http/https HEAD request and compares it to |
| 7 // the local time. | 7 // the local time. |
| 8 // | 8 // |
| 9 // TODO(akalin): Also snarf the server time from the TLS handshake, if | 9 // TODO(akalin): Also snarf the server time from the TLS handshake, if |
| 10 // any (http://crbug.com/146090). | 10 // any (http://crbug.com/146090). |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { | 76 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { |
| 77 base::MessageLoop::current()->Quit(); | 77 base::MessageLoop::current()->Quit(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 virtual void OnURLFetchDownloadProgress( | 80 virtual void OnURLFetchDownloadProgress( |
| 81 const net::URLFetcher* source, | 81 const net::URLFetcher* source, |
| 82 int64 current, int64 total) OVERRIDE { | 82 int64 current, int64 total) OVERRIDE { |
| 83 NOTREACHED(); | 83 NOTREACHED(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 virtual void OnURLFetchDownloadData( | |
| 87 const net::URLFetcher* source, | |
| 88 scoped_ptr<std::string> download_data) OVERRIDE{ | |
| 89 NOTREACHED(); | |
| 90 } | |
| 91 | |
| 92 virtual bool ShouldSendDownloadData() OVERRIDE { | |
| 93 NOTREACHED(); | |
| 94 return false; | |
| 95 } | |
| 96 | |
| 97 virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, | 86 virtual void OnURLFetchUploadProgress(const net::URLFetcher* source, |
| 98 int64 current, int64 total) OVERRIDE { | 87 int64 current, int64 total) OVERRIDE { |
| 99 NOTREACHED(); | 88 NOTREACHED(); |
| 100 } | 89 } |
| 101 | 90 |
| 102 private: | 91 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(QuitDelegate); | 92 DISALLOW_COPY_AND_ASSIGN(QuitDelegate); |
| 104 }; | 93 }; |
| 105 | 94 |
| 106 // NetLog::ThreadSafeObserver implementation that simply prints events | 95 // NetLog::ThreadSafeObserver implementation that simply prints events |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 &skew, &skew_uncertainty); | 334 &skew, &skew_uncertainty); |
| 346 | 335 |
| 347 std::printf( | 336 std::printf( |
| 348 "An estimate for the local clock skew is %.2f ms with " | 337 "An estimate for the local clock skew is %.2f ms with " |
| 349 "uncertainty %.2f ms\n", | 338 "uncertainty %.2f ms\n", |
| 350 skew.InMillisecondsF(), | 339 skew.InMillisecondsF(), |
| 351 skew_uncertainty.InMillisecondsF()); | 340 skew_uncertainty.InMillisecondsF()); |
| 352 | 341 |
| 353 return EXIT_SUCCESS; | 342 return EXIT_SUCCESS; |
| 354 } | 343 } |
| OLD | NEW |