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

Side by Side Diff: net/tools/get_server_time/get_server_time.cc

Issue 1398973003: Don't use base::MessageLoop::{Quit,QuitClosure} in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « net/tools/gdig/gdig.cc ('k') | net/tools/quic/synchronous_host_resolver.cc » ('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 // 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Simply quits the current message loop when finished. Used to make 69 // Simply quits the current message loop when finished. Used to make
70 // URLFetcher synchronous. 70 // URLFetcher synchronous.
71 class QuitDelegate : public net::URLFetcherDelegate { 71 class QuitDelegate : public net::URLFetcherDelegate {
72 public: 72 public:
73 QuitDelegate() {} 73 QuitDelegate() {}
74 74
75 ~QuitDelegate() override {} 75 ~QuitDelegate() override {}
76 76
77 // net::URLFetcherDelegate implementation. 77 // net::URLFetcherDelegate implementation.
78 void OnURLFetchComplete(const net::URLFetcher* source) override { 78 void OnURLFetchComplete(const net::URLFetcher* source) override {
79 base::MessageLoop::current()->Quit(); 79 base::MessageLoop::current()->QuitWhenIdle();
80 } 80 }
81 81
82 void OnURLFetchDownloadProgress(const net::URLFetcher* source, 82 void OnURLFetchDownloadProgress(const net::URLFetcher* source,
83 int64 current, 83 int64 current,
84 int64 total) override { 84 int64 total) override {
85 NOTREACHED(); 85 NOTREACHED();
86 } 86 }
87 87
88 void OnURLFetchUploadProgress(const net::URLFetcher* source, 88 void OnURLFetchUploadProgress(const net::URLFetcher* source,
89 int64 current, 89 int64 current,
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 &skew, &skew_uncertainty); 317 &skew, &skew_uncertainty);
318 318
319 std::printf( 319 std::printf(
320 "An estimate for the local clock skew is %.2f ms with " 320 "An estimate for the local clock skew is %.2f ms with "
321 "uncertainty %.2f ms\n", 321 "uncertainty %.2f ms\n",
322 skew.InMillisecondsF(), 322 skew.InMillisecondsF(),
323 skew_uncertainty.InMillisecondsF()); 323 skew_uncertainty.InMillisecondsF());
324 324
325 return EXIT_SUCCESS; 325 return EXIT_SUCCESS;
326 } 326 }
OLDNEW
« no previous file with comments | « net/tools/gdig/gdig.cc ('k') | net/tools/quic/synchronous_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698