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

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

Issue 193663003: Push remote hostname to P2P socket host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « content/common/p2p_socket_type.h ('k') | content/renderer/p2p/socket_client_impl.h » ('j') | 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/renderer/p2p/ipc_socket_factory.h" 5 #include "content/renderer/p2p/ipc_socket_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return false; 231 return false;
232 } 232 }
233 233
234 net::IPEndPoint remote_endpoint; 234 net::IPEndPoint remote_endpoint;
235 if (!remote_address.IsNil() && 235 if (!remote_address.IsNil() &&
236 !jingle_glue::SocketAddressToIPEndPoint( 236 !jingle_glue::SocketAddressToIPEndPoint(
237 remote_address, &remote_endpoint)) { 237 remote_address, &remote_endpoint)) {
238 return false; 238 return false;
239 } 239 }
240 240
241 client->Init(type, local_endpoint, remote_endpoint, this); 241 // We need to send both resolved and unresolved address in Init. Unresolved
242 // address will be used in case of TLS for certificate hostname matching.
243 // Certificate will be tied to domain name not to IP address.
244 P2PHostAndIPEndPoint remote_info(remote_address.hostname(), remote_endpoint);
245
246 client->Init(type, local_endpoint, remote_info, this);
242 247
243 return true; 248 return true;
244 } 249 }
245 250
246 void IpcPacketSocket::InitAcceptedTcp( 251 void IpcPacketSocket::InitAcceptedTcp(
247 P2PSocketClient* client, 252 P2PSocketClient* client,
248 const talk_base::SocketAddress& local_address, 253 const talk_base::SocketAddress& local_address,
249 const talk_base::SocketAddress& remote_address) { 254 const talk_base::SocketAddress& remote_address) {
250 DCHECK_EQ(base::MessageLoop::current(), message_loop_); 255 DCHECK_EQ(base::MessageLoop::current(), message_loop_);
251 DCHECK_EQ(state_, IS_UNINITIALIZED); 256 DCHECK_EQ(state_, IS_UNINITIALIZED);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 } 628 }
624 629
625 talk_base::AsyncResolverInterface* 630 talk_base::AsyncResolverInterface*
626 IpcPacketSocketFactory::CreateAsyncResolver() { 631 IpcPacketSocketFactory::CreateAsyncResolver() {
627 scoped_ptr<AsyncAddressResolverImpl> resolver( 632 scoped_ptr<AsyncAddressResolverImpl> resolver(
628 new AsyncAddressResolverImpl(socket_dispatcher_)); 633 new AsyncAddressResolverImpl(socket_dispatcher_));
629 return resolver.release(); 634 return resolver.release();
630 } 635 }
631 636
632 } // namespace content 637 } // namespace content
OLDNEW
« no previous file with comments | « content/common/p2p_socket_type.h ('k') | content/renderer/p2p/socket_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698