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

Side by Side Diff: remoting/protocol/chromium_socket_factory.cc

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback eroman Created 4 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/protocol/chromium_socket_factory.h" 5 #include "remoting/protocol/chromium_socket_factory.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 uint16_t min_port, 122 uint16_t min_port,
123 uint16_t max_port) { 123 uint16_t max_port) {
124 net::IPEndPoint local_endpoint; 124 net::IPEndPoint local_endpoint;
125 if (!jingle_glue::SocketAddressToIPEndPoint( 125 if (!jingle_glue::SocketAddressToIPEndPoint(
126 local_address, &local_endpoint)) { 126 local_address, &local_endpoint)) {
127 return false; 127 return false;
128 } 128 }
129 129
130 for (uint32_t port = min_port; port <= max_port; ++port) { 130 for (uint32_t port = min_port; port <= max_port; ++port) {
131 socket_.reset(new net::UDPServerSocket(nullptr, net::NetLog::Source())); 131 socket_.reset(new net::UDPServerSocket(nullptr, net::NetLog::Source()));
132 int result = socket_->Listen( 132 int result = socket_->Listen(net::IPEndPoint(
133 net::IPEndPoint(local_endpoint.address(), static_cast<uint16_t>(port))); 133 local_endpoint.address().bytes(), static_cast<uint16_t>(port)));
134 if (result == net::OK) { 134 if (result == net::OK) {
135 break; 135 break;
136 } else { 136 } else {
137 socket_.reset(); 137 socket_.reset();
138 } 138 }
139 } 139 }
140 140
141 if (!socket_.get()) { 141 if (!socket_.get()) {
142 // Failed to bind the socket. 142 // Failed to bind the socket.
143 return false; 143 return false;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 return nullptr; 396 return nullptr;
397 } 397 }
398 398
399 rtc::AsyncResolverInterface* 399 rtc::AsyncResolverInterface*
400 ChromiumPacketSocketFactory::CreateAsyncResolver() { 400 ChromiumPacketSocketFactory::CreateAsyncResolver() {
401 return new rtc::AsyncResolver(); 401 return new rtc::AsyncResolver();
402 } 402 }
403 403
404 } // namespace protocol 404 } // namespace protocol
405 } // namespace remoting 405 } // namespace remoting
OLDNEW
« net/quic/quic_socket_address_coder.h ('K') | « remoting/host/ipc_host_event_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698