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

Side by Side Diff: content/renderer/p2p/ipc_socket_factory.cc

Issue 1833523002: Migrate content/*/p2p/* code to net::IPAddress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 (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 "content/renderer/p2p/ipc_socket_factory.h" 5 #include "content/renderer/p2p/ipc_socket_factory.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 if (type_ == P2P_SOCKET_UDP) { 311 if (type_ == P2P_SOCKET_UDP) {
312 AdjustUdpSendBufferSize(); 312 AdjustUdpSendBufferSize();
313 } 313 }
314 314
315 net::IPEndPoint remote_endpoint; 315 net::IPEndPoint remote_endpoint;
316 if (!remote_address.IsNil()) { 316 if (!remote_address.IsNil()) {
317 DCHECK(IsTcpClientSocket(type_)); 317 DCHECK(IsTcpClientSocket(type_));
318 318
319 if (remote_address.IsUnresolvedIP()) { 319 if (remote_address.IsUnresolvedIP()) {
320 remote_endpoint = 320 remote_endpoint =
321 net::IPEndPoint(net::IPAddressNumber(), remote_address.port()); 321 net::IPEndPoint(net::IPAddress(), remote_address.port());
322 } else { 322 } else {
323 if (!jingle_glue::SocketAddressToIPEndPoint(remote_address, 323 if (!jingle_glue::SocketAddressToIPEndPoint(remote_address,
324 &remote_endpoint)) { 324 &remote_endpoint)) {
325 return false; 325 return false;
326 } 326 }
327 } 327 }
328 } 328 }
329 329
330 // We need to send both resolved and unresolved address in Init. Unresolved 330 // We need to send both resolved and unresolved address in Init. Unresolved
331 // address will be used in case of TLS for certificate hostname matching. 331 // address will be used in case of TLS for certificate hostname matching.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 error_ = EWOULDBLOCK; 415 error_ = EWOULDBLOCK;
416 IncrementDiscardCounters(data_size); 416 IncrementDiscardCounters(data_size);
417 return -1; 417 return -1;
418 } else { 418 } else {
419 current_discard_bytes_sequence_ = 0; 419 current_discard_bytes_sequence_ = 0;
420 } 420 }
421 421
422 net::IPEndPoint address_chrome; 422 net::IPEndPoint address_chrome;
423 if (address.IsUnresolvedIP()) { 423 if (address.IsUnresolvedIP()) {
424 address_chrome = net::IPEndPoint(net::IPAddressNumber(), address.port()); 424 address_chrome = net::IPEndPoint(net::IPAddress(), address.port());
425 } else { 425 } else {
426 if (!jingle_glue::SocketAddressToIPEndPoint(address, &address_chrome)) { 426 if (!jingle_glue::SocketAddressToIPEndPoint(address, &address_chrome)) {
427 LOG(WARNING) << "Failed to convert remote address to IPEndPoint: address=" 427 LOG(WARNING) << "Failed to convert remote address to IPEndPoint: address="
428 << address.ipaddr().ToSensitiveString() 428 << address.ipaddr().ToSensitiveString()
429 << ", remote_address_=" 429 << ", remote_address_="
430 << remote_address_.ipaddr().ToSensitiveString(); 430 << remote_address_.ipaddr().ToSensitiveString();
431 NOTREACHED(); 431 NOTREACHED();
432 error_ = EINVAL; 432 error_ = EINVAL;
433 return -1; 433 return -1;
434 } 434 }
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 } 802 }
803 803
804 rtc::AsyncResolverInterface* 804 rtc::AsyncResolverInterface*
805 IpcPacketSocketFactory::CreateAsyncResolver() { 805 IpcPacketSocketFactory::CreateAsyncResolver() {
806 scoped_ptr<AsyncAddressResolverImpl> resolver( 806 scoped_ptr<AsyncAddressResolverImpl> resolver(
807 new AsyncAddressResolverImpl(socket_dispatcher_)); 807 new AsyncAddressResolverImpl(socket_dispatcher_));
808 return resolver.release(); 808 return resolver.release();
809 } 809 }
810 810
811 } // namespace content 811 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698