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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |