| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/p2p_messages.h" | 7 #include "content/common/p2p_messages.h" |
| 8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| 11 #include "net/base/sys_byteorder.h" | 11 #include "net/base/sys_byteorder.h" |
| 12 #include "net/socket/tcp_client_socket.h" | 12 #include "net/socket/tcp_client_socket.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | |
| 16 const int kReadBufferSize = 4096; | 15 const int kReadBufferSize = 4096; |
| 17 const int kPacketHeaderSize = sizeof(uint16); | 16 const int kPacketHeaderSize = sizeof(uint16); |
| 17 } // namespace |
| 18 | 18 |
| 19 } // namespace | 19 namespace content { |
| 20 | 20 |
| 21 P2PSocketHostTcp::P2PSocketHostTcp(IPC::Message::Sender* message_sender, | 21 P2PSocketHostTcp::P2PSocketHostTcp(IPC::Message::Sender* message_sender, |
| 22 int routing_id, int id) | 22 int routing_id, int id) |
| 23 : P2PSocketHost(message_sender, routing_id, id), | 23 : P2PSocketHost(message_sender, routing_id, id), |
| 24 connected_(false), | 24 connected_(false), |
| 25 ALLOW_THIS_IN_INITIALIZER_LIST( | 25 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 26 connect_callback_(this, &P2PSocketHostTcp::OnConnected)), | 26 connect_callback_(this, &P2PSocketHostTcp::OnConnected)), |
| 27 ALLOW_THIS_IN_INITIALIZER_LIST( | 27 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 28 read_callback_(this, &P2PSocketHostTcp::OnRead)), | 28 read_callback_(this, &P2PSocketHostTcp::OnRead)), |
| 29 ALLOW_THIS_IN_INITIALIZER_LIST( | 29 ALLOW_THIS_IN_INITIALIZER_LIST( |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 DoWrite(); | 264 DoWrite(); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 P2PSocketHost* P2PSocketHostTcp::AcceptIncomingTcpConnection( | 268 P2PSocketHost* P2PSocketHostTcp::AcceptIncomingTcpConnection( |
| 269 const net::IPEndPoint& remote_address, int id) { | 269 const net::IPEndPoint& remote_address, int id) { |
| 270 NOTREACHED(); | 270 NOTREACHED(); |
| 271 OnError(); | 271 OnError(); |
| 272 return NULL; | 272 return NULL; |
| 273 } | 273 } |
| 274 |
| 275 } // namespace content |
| OLD | NEW |