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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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/file_net_log.h ('k') | net/tools/get_server_time/get_server_time.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 #include <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/basictypes.h"
10 #include "base/bind.h" 9 #include "base/bind.h"
11 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
12 #include "base/command_line.h" 11 #include "base/command_line.h"
13 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
14 #include "base/location.h" 13 #include "base/location.h"
15 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
16 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
17 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
18 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_split.h" 18 #include "base/strings/string_split.h"
(...skipping 30 matching lines...) Expand all
50 int port; 49 int port;
51 if (!ParseHostAndPort(ip_address_and_port, &ip, &port)) 50 if (!ParseHostAndPort(ip_address_and_port, &ip, &port))
52 return false; 51 return false;
53 if (port == -1) 52 if (port == -1)
54 port = dns_protocol::kDefaultPort; 53 port = dns_protocol::kDefaultPort;
55 54
56 net::IPAddressNumber ip_number; 55 net::IPAddressNumber ip_number;
57 if (!net::ParseIPLiteralToNumber(ip, &ip_number)) 56 if (!net::ParseIPLiteralToNumber(ip, &ip_number))
58 return false; 57 return false;
59 58
60 *ip_end_point = net::IPEndPoint(ip_number, static_cast<uint16>(port)); 59 *ip_end_point = net::IPEndPoint(ip_number, static_cast<uint16_t>(port));
61 return true; 60 return true;
62 } 61 }
63 62
64 // Convert DnsConfig to human readable text omitting the hosts member. 63 // Convert DnsConfig to human readable text omitting the hosts member.
65 std::string DnsConfigToString(const DnsConfig& dns_config) { 64 std::string DnsConfigToString(const DnsConfig& dns_config) {
66 std::string output; 65 std::string output;
67 output.append("search "); 66 output.append("search ");
68 for (size_t i = 0; i < dns_config.search.size(); ++i) { 67 for (size_t i = 0; i < dns_config.search.size(); ++i) {
69 output.append(dns_config.search[i] + " "); 68 output.append(dns_config.search[i] + " ");
70 } 69 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (time_and_name.size() != 2) { 144 if (time_and_name.size() != 2) {
146 fprintf( 145 fprintf(
147 stderr, 146 stderr,
148 "[%s %u] replay log should have format 'timestamp domain_name\\n'\n", 147 "[%s %u] replay log should have format 'timestamp domain_name\\n'\n",
149 file_path.MaybeAsASCII().c_str(), 148 file_path.MaybeAsASCII().c_str(),
150 i + 1); 149 i + 1);
151 bad_parse = true; 150 bad_parse = true;
152 continue; 151 continue;
153 } 152 }
154 153
155 int64 delta_in_milliseconds; 154 int64_t delta_in_milliseconds;
156 if (!base::StringToInt64(time_and_name[0], &delta_in_milliseconds)) { 155 if (!base::StringToInt64(time_and_name[0], &delta_in_milliseconds)) {
157 fprintf( 156 fprintf(
158 stderr, 157 stderr,
159 "[%s %u] replay log should have format 'timestamp domain_name\\n'\n", 158 "[%s %u] replay log should have format 'timestamp domain_name\\n'\n",
160 file_path.MaybeAsASCII().c_str(), 159 file_path.MaybeAsASCII().c_str(),
161 i + 1); 160 i + 1);
162 bad_parse = true; 161 bad_parse = true;
163 continue; 162 continue;
164 } 163 }
165 164
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 511 }
513 512
514 } // empty namespace 513 } // empty namespace
515 514
516 } // namespace net 515 } // namespace net
517 516
518 int main(int argc, const char* argv[]) { 517 int main(int argc, const char* argv[]) {
519 net::GDig dig; 518 net::GDig dig;
520 return dig.Main(argc, argv); 519 return dig.Main(argc, argv);
521 } 520 }
OLDNEW
« no previous file with comments | « net/tools/gdig/file_net_log.h ('k') | net/tools/get_server_time/get_server_time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698