OLD | NEW |
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_server.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" | 10 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 | 113 |
114 void P2PSocketHostTcpServer::OnAccepted(int result) { | 114 void P2PSocketHostTcpServer::OnAccepted(int result) { |
115 HandleAcceptResult(result); | 115 HandleAcceptResult(result); |
116 if (result == net::OK) | 116 if (result == net::OK) |
117 DoAccept(); | 117 DoAccept(); |
118 } | 118 } |
119 | 119 |
120 void P2PSocketHostTcpServer::Send(const net::IPEndPoint& to, | 120 void P2PSocketHostTcpServer::Send(const net::IPEndPoint& to, |
121 const std::vector<char>& data, | 121 const std::vector<char>& data, |
122 const talk_base::PacketOptions& options, | 122 const rtc::PacketOptions& options, |
123 uint64 packet_id) { | 123 uint64 packet_id) { |
124 NOTREACHED(); | 124 NOTREACHED(); |
125 OnError(); | 125 OnError(); |
126 } | 126 } |
127 | 127 |
128 P2PSocketHost* P2PSocketHostTcpServer::AcceptIncomingTcpConnection( | 128 P2PSocketHost* P2PSocketHostTcpServer::AcceptIncomingTcpConnection( |
129 const net::IPEndPoint& remote_address, int id) { | 129 const net::IPEndPoint& remote_address, int id) { |
130 AcceptedSocketsMap::iterator it = accepted_sockets_.find(remote_address); | 130 AcceptedSocketsMap::iterator it = accepted_sockets_.find(remote_address); |
131 if (it == accepted_sockets_.end()) | 131 if (it == accepted_sockets_.end()) |
132 return NULL; | 132 return NULL; |
(...skipping 13 matching lines...) Expand all Loading... |
146 return result.release(); | 146 return result.release(); |
147 } | 147 } |
148 | 148 |
149 bool P2PSocketHostTcpServer::SetOption(P2PSocketOption option, | 149 bool P2PSocketHostTcpServer::SetOption(P2PSocketOption option, |
150 int value) { | 150 int value) { |
151 // Currently we don't have use case tcp server sockets are used for p2p. | 151 // Currently we don't have use case tcp server sockets are used for p2p. |
152 return false; | 152 return false; |
153 } | 153 } |
154 | 154 |
155 } // namespace content | 155 } // namespace content |
OLD | NEW |