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

Side by Side Diff: content/browser/renderer_host/pepper_tcp_socket.cc

Issue 10491007: fixed issue 128383 - replace GetPeerAddress(AddressList* address) with GetPeerAddress(IPEndPoint* a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix according to review Created 8 years, 6 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 #include "content/browser/renderer_host/pepper_tcp_socket.h" 5 #include "content/browser/renderer_host/pepper_tcp_socket.h"
6 6
7 #include <string.h> 7 #include <string.h>
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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 StartConnect(address_list_); 310 StartConnect(address_list_);
311 } 311 }
312 312
313 void PepperTCPSocket::OnConnectCompleted(int result) { 313 void PepperTCPSocket::OnConnectCompleted(int result) {
314 DCHECK(connection_state_ == CONNECT_IN_PROGRESS && socket_.get()); 314 DCHECK(connection_state_ == CONNECT_IN_PROGRESS && socket_.get());
315 315
316 if (result != net::OK) { 316 if (result != net::OK) {
317 SendConnectACKError(); 317 SendConnectACKError();
318 connection_state_ = BEFORE_CONNECT; 318 connection_state_ = BEFORE_CONNECT;
319 } else { 319 } else {
320 net::IPEndPoint ip_end_point; 320 net::IPEndPoint ip_end_point_local;
321 net::AddressList address_list; 321 net::IPEndPoint ip_end_point_remote;
322 PP_NetAddress_Private local_addr = 322 PP_NetAddress_Private local_addr =
323 NetAddressPrivateImpl::kInvalidNetAddress; 323 NetAddressPrivateImpl::kInvalidNetAddress;
324 PP_NetAddress_Private remote_addr = 324 PP_NetAddress_Private remote_addr =
325 NetAddressPrivateImpl::kInvalidNetAddress; 325 NetAddressPrivateImpl::kInvalidNetAddress;
326 326
327 if (socket_->GetLocalAddress(&ip_end_point) != net::OK || 327 if (socket_->GetLocalAddress(&ip_end_point_local) != net::OK ||
328 !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point, 328 !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_local,
329 &local_addr) || 329 &local_addr) ||
330 socket_->GetPeerAddress(&address_list) != net::OK || 330 socket_->GetPeerAddress(&ip_end_point_remote) != net::OK ||
331 !NetAddressPrivateImpl::AddressListToNetAddress(address_list, 331 !NetAddressPrivateImpl::IPEndPointToNetAddress(ip_end_point_remote,
332 &remote_addr)) { 332 &remote_addr)) {
333 SendConnectACKError(); 333 SendConnectACKError();
334 connection_state_ = BEFORE_CONNECT; 334 connection_state_ = BEFORE_CONNECT;
335 } else { 335 } else {
336 manager_->Send(new PpapiMsg_PPBTCPSocket_ConnectACK( 336 manager_->Send(new PpapiMsg_PPBTCPSocket_ConnectACK(
337 routing_id_, plugin_dispatcher_id_, socket_id_, true, 337 routing_id_, plugin_dispatcher_id_, socket_id_, true,
338 local_addr, remote_addr)); 338 local_addr, remote_addr));
339 connection_state_ = CONNECTED; 339 connection_state_ = CONNECTED;
340 } 340 }
341 } 341 }
342 } 342 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 routing_id_, plugin_dispatcher_id_, socket_id_, true, result)); 374 routing_id_, plugin_dispatcher_id_, socket_id_, true, result));
375 } else { 375 } else {
376 SendWriteACKError(); 376 SendWriteACKError();
377 } 377 }
378 write_buffer_ = NULL; 378 write_buffer_ = NULL;
379 } 379 }
380 380
381 bool PepperTCPSocket::IsConnected() const { 381 bool PepperTCPSocket::IsConnected() const {
382 return connection_state_ == CONNECTED || connection_state_ == SSL_CONNECTED; 382 return connection_state_ == CONNECTED || connection_state_ == SSL_CONNECTED;
383 } 383 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/pepper_tcp_server_socket.cc ('k') | jingle/glue/pseudotcp_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698