| 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 | 76 |
| 77 ~QuitDelegate() override {} | 77 ~QuitDelegate() override {} |
| 78 | 78 |
| 79 // net::URLFetcherDelegate implementation. | 79 // net::URLFetcherDelegate implementation. |
| 80 void OnURLFetchComplete(const net::URLFetcher* source) override { | 80 void OnURLFetchComplete(const net::URLFetcher* source) override { |
| 81 base::MessageLoop::current()->QuitWhenIdle(); | 81 base::MessageLoop::current()->QuitWhenIdle(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void OnURLFetchDownloadProgress(const net::URLFetcher* source, | 84 void OnURLFetchDownloadProgress(const net::URLFetcher* source, |
| 85 int64_t current, | 85 int64_t current, |
| 86 int64_t total) override { | 86 int64_t total, |
| 87 int64_t current_network_bytes) override { |
| 87 NOTREACHED(); | 88 NOTREACHED(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 void OnURLFetchUploadProgress(const net::URLFetcher* source, | 91 void OnURLFetchUploadProgress(const net::URLFetcher* source, |
| 91 int64_t current, | 92 int64_t current, |
| 92 int64_t total) override { | 93 int64_t total) override { |
| 93 NOTREACHED(); | 94 NOTREACHED(); |
| 94 } | 95 } |
| 95 | 96 |
| 96 private: | 97 private: |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 &skew, &skew_uncertainty); | 320 &skew, &skew_uncertainty); |
| 320 | 321 |
| 321 std::printf( | 322 std::printf( |
| 322 "An estimate for the local clock skew is %.2f ms with " | 323 "An estimate for the local clock skew is %.2f ms with " |
| 323 "uncertainty %.2f ms\n", | 324 "uncertainty %.2f ms\n", |
| 324 skew.InMillisecondsF(), | 325 skew.InMillisecondsF(), |
| 325 skew_uncertainty.InMillisecondsF()); | 326 skew_uncertainty.InMillisecondsF()); |
| 326 | 327 |
| 327 return EXIT_SUCCESS; | 328 return EXIT_SUCCESS; |
| 328 } | 329 } |
| OLD | NEW |