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

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

Issue 717373002: Use uint16 for port numbers, content/ edition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self-review Created 6 years, 1 month 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/browser/renderer_host/pepper/pepper_tcp_socket.h" 5 #include "content/browser/renderer_host/pepper/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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void PepperTCPSocket::ConnectWithNetAddress( 100 void PepperTCPSocket::ConnectWithNetAddress(
101 const PP_NetAddress_Private& net_addr) { 101 const PP_NetAddress_Private& net_addr) {
102 DCHECK_CURRENTLY_ON(BrowserThread::IO); 102 DCHECK_CURRENTLY_ON(BrowserThread::IO);
103 103
104 if (connection_state_ != BEFORE_CONNECT) { 104 if (connection_state_ != BEFORE_CONNECT) {
105 SendConnectACKError(PP_ERROR_FAILED); 105 SendConnectACKError(PP_ERROR_FAILED);
106 return; 106 return;
107 } 107 }
108 108
109 net::IPAddressNumber address; 109 net::IPAddressNumber address;
110 int port; 110 uint16 port;
111 if (!NetAddressPrivateImpl::NetAddressToIPEndPoint( 111 if (!NetAddressPrivateImpl::NetAddressToIPEndPoint(
112 net_addr, &address, &port)) { 112 net_addr, &address, &port)) {
113 SendConnectACKError(PP_ERROR_ADDRESS_INVALID); 113 SendConnectACKError(PP_ERROR_ADDRESS_INVALID);
114 return; 114 return;
115 } 115 }
116 116
117 // Copy the single IPEndPoint to address_list_. 117 // Copy the single IPEndPoint to address_list_.
118 address_list_.clear(); 118 address_list_.clear();
119 address_list_.push_back(net::IPEndPoint(address, port)); 119 address_list_.push_back(net::IPEndPoint(address, port));
120 connection_state_ = CONNECT_IN_PROGRESS; 120 connection_state_ = CONNECT_IN_PROGRESS;
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 int net_result = socket_->Write( 532 int net_result = socket_->Write(
533 write_buffer_.get(), 533 write_buffer_.get(),
534 write_buffer_->BytesRemaining(), 534 write_buffer_->BytesRemaining(),
535 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this))); 535 base::Bind(&PepperTCPSocket::OnWriteCompleted, base::Unretained(this)));
536 if (net_result != net::ERR_IO_PENDING) 536 if (net_result != net::ERR_IO_PENDING)
537 OnWriteCompleted(net_result); 537 OnWriteCompleted(net_result);
538 } 538 }
539 539
540 } // namespace content 540 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698