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/renderer/p2p/socket_dispatcher.h" | 5 #include "content/renderer/p2p/socket_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); | 132 P2PAsyncAddressResolver* request = host_address_requests_.Lookup(request_id); |
133 if (!request) { | 133 if (!request) { |
134 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 134 VLOG(1) << "Received P2P message for socket that doesn't exist."; |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 request->OnResponse(addresses); | 138 request->OnResponse(addresses); |
139 } | 139 } |
140 | 140 |
141 void P2PSocketDispatcher::OnSocketCreated( | 141 void P2PSocketDispatcher::OnSocketCreated( |
142 int socket_id, const net::IPEndPoint& address) { | 142 int socket_id, const net::IPEndPoint& address, |
| 143 const net::IPEndPoint& remote_address) { |
143 P2PSocketClientImpl* client = GetClient(socket_id); | 144 P2PSocketClientImpl* client = GetClient(socket_id); |
144 if (client) { | 145 if (client) { |
145 client->OnSocketCreated(address); | 146 client->OnSocketCreated(address, remote_address); |
146 } | 147 } |
147 } | 148 } |
148 | 149 |
149 void P2PSocketDispatcher::OnIncomingTcpConnection( | 150 void P2PSocketDispatcher::OnIncomingTcpConnection( |
150 int socket_id, const net::IPEndPoint& address) { | 151 int socket_id, const net::IPEndPoint& address) { |
151 P2PSocketClientImpl* client = GetClient(socket_id); | 152 P2PSocketClientImpl* client = GetClient(socket_id); |
152 if (client) { | 153 if (client) { |
153 client->OnIncomingTcpConnection(address); | 154 client->OnIncomingTcpConnection(address); |
154 } | 155 } |
155 } | 156 } |
(...skipping 29 matching lines...) Expand all Loading... |
185 // hasn't processed the close message by the time it sends the | 186 // hasn't processed the close message by the time it sends the |
186 // message to the renderer. | 187 // message to the renderer. |
187 VLOG(1) << "Received P2P message for socket that doesn't exist."; | 188 VLOG(1) << "Received P2P message for socket that doesn't exist."; |
188 return NULL; | 189 return NULL; |
189 } | 190 } |
190 | 191 |
191 return client; | 192 return client; |
192 } | 193 } |
193 | 194 |
194 } // namespace content | 195 } // namespace content |
OLD | NEW |