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

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

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | Annotate | Revision Log
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 30 matching lines...) Expand all
41 #include "net/url_request/url_request_status.h" 41 #include "net/url_request/url_request_status.h"
42 #include "url/gurl.h" 42 #include "url/gurl.h"
43 43
44 #if defined(OS_MACOSX) 44 #if defined(OS_MACOSX)
45 #include "base/mac/scoped_nsautorelease_pool.h" 45 #include "base/mac/scoped_nsautorelease_pool.h"
46 #elif defined(OS_LINUX) 46 #elif defined(OS_LINUX)
47 #include "net/proxy/proxy_config.h" 47 #include "net/proxy/proxy_config.h"
48 #include "net/proxy/proxy_config_service_fixed.h" 48 #include "net/proxy/proxy_config_service_fixed.h"
49 #endif 49 #endif
50 50
51 using base::UTF16ToUTF8;
52
51 namespace { 53 namespace {
52 54
53 // base::TimeTicks::Now() is documented to have a resolution of 55 // base::TimeTicks::Now() is documented to have a resolution of
54 // ~1-15ms. 56 // ~1-15ms.
55 const int64 kTicksResolutionMs = 15; 57 const int64 kTicksResolutionMs = 15;
56 58
57 // For the sources that are supported (HTTP date headers, TLS 59 // For the sources that are supported (HTTP date headers, TLS
58 // handshake), the resolution of the server time is 1 second. 60 // handshake), the resolution of the server time is 1 second.
59 const int64 kServerTimeResolutionMs = 1000; 61 const int64 kServerTimeResolutionMs = 1000;
60 62
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 &skew, &skew_uncertainty); 336 &skew, &skew_uncertainty);
335 337
336 std::printf( 338 std::printf(
337 "An estimate for the local clock skew is %.2f ms with " 339 "An estimate for the local clock skew is %.2f ms with "
338 "uncertainty %.2f ms\n", 340 "uncertainty %.2f ms\n",
339 skew.InMillisecondsF(), 341 skew.InMillisecondsF(),
340 skew_uncertainty.InMillisecondsF()); 342 skew_uncertainty.InMillisecondsF());
341 343
342 return EXIT_SUCCESS; 344 return EXIT_SUCCESS;
343 } 345 }
OLDNEW
« no previous file with comments | « net/test/spawned_test_server/local_test_server_win.cc ('k') | net/tools/testserver/run_testserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698