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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 9873037: P2P TCP SocketServer changes to allow accept callback object reset before calling (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "content/browser/renderer_host/p2p/socket_host_tcp.h" 5 #include "content/browser/renderer_host/p2p/socket_host_tcp.h"
6 6
7 #include "base/sys_byteorder.h" 7 #include "base/sys_byteorder.h"
8 #include "content/common/p2p_messages.h" 8 #include "content/common/p2p_messages.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 void P2PSocketHostTcp::OnConnected(int result) { 82 void P2PSocketHostTcp::OnConnected(int result) {
83 DCHECK_EQ(state_, STATE_CONNECTING); 83 DCHECK_EQ(state_, STATE_CONNECTING);
84 DCHECK_NE(result, net::ERR_IO_PENDING); 84 DCHECK_NE(result, net::ERR_IO_PENDING);
85 85
86 if (result != net::OK) { 86 if (result != net::OK) {
87 OnError(); 87 OnError();
88 return; 88 return;
89 } 89 }
90 90
91 if (socket_->SetSendBufferSize(kMaxSendBufferSize)) { 91 if (!socket_->SetSendBufferSize(kMaxSendBufferSize)) {
92 LOG(WARNING) << "Failed to set send buffer size for TCP socket."; 92 LOG(WARNING) << "Failed to set send buffer size for TCP socket.";
93 } 93 }
94 94
95 net::IPEndPoint address; 95 net::IPEndPoint address;
96 result = socket_->GetLocalAddress(&address); 96 result = socket_->GetLocalAddress(&address);
97 if (result < 0) { 97 if (result < 0) {
98 LOG(ERROR) << "P2PSocket::Init(): unable to get local address: " 98 LOG(ERROR) << "P2PSocket::Init(): unable to get local address: "
99 << result; 99 << result;
100 OnError(); 100 OnError();
101 return; 101 return;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 269
270 P2PSocketHost* P2PSocketHostTcp::AcceptIncomingTcpConnection( 270 P2PSocketHost* P2PSocketHostTcp::AcceptIncomingTcpConnection(
271 const net::IPEndPoint& remote_address, int id) { 271 const net::IPEndPoint& remote_address, int id) {
272 NOTREACHED(); 272 NOTREACHED();
273 OnError(); 273 OnError();
274 return NULL; 274 return NULL;
275 } 275 }
276 276
277 } // namespace content 277 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698