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

Side by Side Diff: content/renderer/p2p/socket_dispatcher.cc

Issue 365903007: Handle unresolved remote hostname for TCP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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/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
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
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
OLDNEW
« content/renderer/p2p/socket_dispatcher.h ('K') | « content/renderer/p2p/socket_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698