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

Side by Side Diff: chrome/test/chromedriver/net/net_util.cc

Issue 1879863002: Reland of [chromedriver] Listen on IPv6 on IPv6-only hosts (part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better logging Created 4 years, 8 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 | « chrome/test/chromedriver/net/net_util.h ('k') | chrome/test/chromedriver/net/websocket.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 "chrome/test/chromedriver/net/net_util.h" 5 #include "chrome/test/chromedriver/net/net_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 std::string* response_; 56 std::string* response_;
57 base::WaitableEvent event_; 57 base::WaitableEvent event_;
58 std::unique_ptr<net::URLFetcher> fetcher_; 58 std::unique_ptr<net::URLFetcher> fetcher_;
59 bool success_; 59 bool success_;
60 }; 60 };
61 61
62 } // namespace 62 } // namespace
63 63
64 NetAddress::NetAddress() : port_(-1) {} 64 NetAddress::NetAddress() : port_(-1) {}
65 65
66 NetAddress::NetAddress(int port) : host_("127.0.0.1"), port_(port) {} 66 NetAddress::NetAddress(int port) : host_("localhost"), port_(port) {}
67 67
68 NetAddress::NetAddress(const std::string& host, int port) 68 NetAddress::NetAddress(const std::string& host, int port)
69 : host_(host), port_(port) {} 69 : host_(host), port_(port) {}
70 70
71 NetAddress::~NetAddress() {} 71 NetAddress::~NetAddress() {}
72 72
73 bool NetAddress::IsValid() const { 73 bool NetAddress::IsValid() const {
74 return port_ >= 0 && port_ < (1 << 16); 74 return port_ >= 0 && port_ < (1 << 16);
75 } 75 }
76 76
77 std::string NetAddress::ToString() const { 77 std::string NetAddress::ToString() const {
78 return host_ + base::StringPrintf(":%d", port_); 78 return host_ + base::StringPrintf(":%d", port_);
79 } 79 }
80 80
81 const std::string& NetAddress::host() const { 81 const std::string& NetAddress::host() const {
82 return host_; 82 return host_;
83 } 83 }
84 84
85 int NetAddress::port() const { 85 int NetAddress::port() const {
86 return port_; 86 return port_;
87 } 87 }
88 88
89 bool FetchUrl(const std::string& url, 89 bool FetchUrl(const std::string& url,
90 URLRequestContextGetter* getter, 90 URLRequestContextGetter* getter,
91 std::string* response) { 91 std::string* response) {
92 return SyncUrlFetcher(GURL(url), getter, response).Fetch(); 92 return SyncUrlFetcher(GURL(url), getter, response).Fetch();
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/net/net_util.h ('k') | chrome/test/chromedriver/net/websocket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698