OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "content/renderer/p2p/socket_client.h" | 10 #include "content/renderer/p2p/socket_client.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 if (!jingle_glue::SocketAddressToIPEndPoint(local_address, &local_endpoint)) { | 117 if (!jingle_glue::SocketAddressToIPEndPoint(local_address, &local_endpoint)) { |
118 return false; | 118 return false; |
119 } | 119 } |
120 | 120 |
121 net::IPEndPoint remote_endpoint; | 121 net::IPEndPoint remote_endpoint; |
122 if (!jingle_glue::SocketAddressToIPEndPoint( | 122 if (!jingle_glue::SocketAddressToIPEndPoint( |
123 remote_address, &remote_endpoint)) { | 123 remote_address, &remote_endpoint)) { |
124 return false; | 124 return false; |
125 } | 125 } |
126 | 126 |
127 client_->Init(type, local_endpoint, remote_endpoint, this, | 127 client_->Init(type, local_endpoint, remote_endpoint, this); |
128 base::MessageLoopProxy::CreateForCurrentThread()); | |
129 | 128 |
130 return true; | 129 return true; |
131 } | 130 } |
132 | 131 |
133 void IpcPacketSocket::InitAcceptedTcp( | 132 void IpcPacketSocket::InitAcceptedTcp( |
134 P2PSocketClient* client, | 133 P2PSocketClient* client, |
135 const talk_base::SocketAddress& local_address, | 134 const talk_base::SocketAddress& local_address, |
136 const talk_base::SocketAddress& remote_address) { | 135 const talk_base::SocketAddress& remote_address) { |
137 DCHECK_EQ(MessageLoop::current(), message_loop_); | 136 DCHECK_EQ(MessageLoop::current(), message_loop_); |
138 DCHECK_EQ(state_, IS_UNINITIALIZED); | 137 DCHECK_EQ(state_, IS_UNINITIALIZED); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 return NULL; | 355 return NULL; |
357 | 356 |
358 talk_base::SocketAddress crome_address; | 357 talk_base::SocketAddress crome_address; |
359 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_); | 358 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_); |
360 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); | 359 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); |
361 if (!socket->Init(P2P_SOCKET_TCP_CLIENT, socket_client, local_address, | 360 if (!socket->Init(P2P_SOCKET_TCP_CLIENT, socket_client, local_address, |
362 remote_address)) | 361 remote_address)) |
363 return NULL; | 362 return NULL; |
364 return socket.release(); | 363 return socket.release(); |
365 } | 364 } |
OLD | NEW |