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

Side by Side Diff: remoting/protocol/libjingle_transport_factory.cc

Issue 10209008: Roll libjingle 132:133 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « remoting/protocol/jingle_session.cc ('k') | third_party/libjingle/README.chromium » ('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 "remoting/protocol/libjingle_transport_factory.h" 5 #include "remoting/protocol/libjingle_transport_factory.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "jingle/glue/channel_socket_adapter.h" 8 #include "jingle/glue/channel_socket_adapter.h"
9 #include "jingle/glue/pseudotcp_adapter.h" 9 #include "jingle/glue/pseudotcp_adapter.h"
10 #include "jingle/glue/utils.h" 10 #include "jingle/glue/utils.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } else { 148 } else {
149 port_allocator_flags |= cricket::PORTALLOCATOR_DISABLE_STUN | 149 port_allocator_flags |= cricket::PORTALLOCATOR_DISABLE_STUN |
150 cricket::PORTALLOCATOR_DISABLE_RELAY; 150 cricket::PORTALLOCATOR_DISABLE_RELAY;
151 port_allocator_.reset( 151 port_allocator_.reset(
152 new cricket::BasicPortAllocator(network_manager_, socket_factory_)); 152 new cricket::BasicPortAllocator(network_manager_, socket_factory_));
153 } 153 }
154 port_allocator_->set_flags(port_allocator_flags); 154 port_allocator_->set_flags(port_allocator_flags);
155 155
156 port_allocator_->SetPortRange(config_.min_port, config_.max_port); 156 port_allocator_->SetPortRange(config_.min_port, config_.max_port);
157 157
158 DCHECK(!channel_.get());
159
158 // Create P2PTransportChannel, attach signal handlers and connect it. 160 // Create P2PTransportChannel, attach signal handlers and connect it.
159 DCHECK(!channel_.get()); 161 // TODO(sergeyu): Specify correct component ID for the channel.
160 channel_.reset(new cricket::P2PTransportChannel( 162 channel_.reset(new cricket::P2PTransportChannel(
161 name_, "", NULL, port_allocator_.get())); 163 name_, 0, NULL, port_allocator_.get()));
162 channel_->SignalRequestSignaling.connect( 164 channel_->SignalRequestSignaling.connect(
163 this, &LibjingleStreamTransport::OnRequestSignaling); 165 this, &LibjingleStreamTransport::OnRequestSignaling);
164 channel_->SignalCandidateReady.connect( 166 channel_->SignalCandidateReady.connect(
165 this, &LibjingleStreamTransport::OnCandidateReady); 167 this, &LibjingleStreamTransport::OnCandidateReady);
166 channel_->SignalRouteChange.connect( 168 channel_->SignalRouteChange.connect(
167 this, &LibjingleStreamTransport::OnRouteChange); 169 this, &LibjingleStreamTransport::OnRouteChange);
168 if (config_.nat_traversal_mode == TransportConfig::NAT_TRAVERSAL_DISABLED) 170 if (config_.nat_traversal_mode == TransportConfig::NAT_TRAVERSAL_DISABLED)
169 channel_->set_incoming_only(true); 171 channel_->set_incoming_only(true);
170 172
171 channel_->Connect(); 173 channel_->Connect();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 route.type = TransportRoute::RELAY; 242 route.type = TransportRoute::RELAY;
241 } else { 243 } else {
242 LOG(FATAL) << "Unknown candidate type: " << candidate.type(); 244 LOG(FATAL) << "Unknown candidate type: " << candidate.type();
243 } 245 }
244 246
245 if (!jingle_glue::SocketAddressToIPEndPoint( 247 if (!jingle_glue::SocketAddressToIPEndPoint(
246 candidate.address(), &route.remote_address)) { 248 candidate.address(), &route.remote_address)) {
247 LOG(FATAL) << "Failed to convert peer IP address."; 249 LOG(FATAL) << "Failed to convert peer IP address.";
248 } 250 }
249 251
250 DCHECK(channel->GetP2PChannel()); 252 DCHECK(channel_->best_connection());
251 DCHECK(channel->GetP2PChannel()->best_connection());
252 const cricket::Candidate& local_candidate = 253 const cricket::Candidate& local_candidate =
253 channel->GetP2PChannel()->best_connection()->local_candidate(); 254 channel_->best_connection()->local_candidate();
254 if (!jingle_glue::SocketAddressToIPEndPoint( 255 if (!jingle_glue::SocketAddressToIPEndPoint(
255 local_candidate.address(), &route.local_address)) { 256 local_candidate.address(), &route.local_address)) {
256 LOG(FATAL) << "Failed to convert local IP address."; 257 LOG(FATAL) << "Failed to convert local IP address.";
257 } 258 }
258 259
259 event_handler_->OnTransportRouteChange(this, route); 260 event_handler_->OnTransportRouteChange(this, route);
260 } 261 }
261 262
262 void LibjingleStreamTransport::OnTcpConnected(int result) { 263 void LibjingleStreamTransport::OnTcpConnected(int result) {
263 DCHECK(CalledOnValidThread()); 264 DCHECK(CalledOnValidThread());
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 345 }
345 346
346 scoped_ptr<DatagramTransport> 347 scoped_ptr<DatagramTransport>
347 LibjingleTransportFactory::CreateDatagramTransport() { 348 LibjingleTransportFactory::CreateDatagramTransport() {
348 NOTIMPLEMENTED(); 349 NOTIMPLEMENTED();
349 return scoped_ptr<DatagramTransport>(NULL); 350 return scoped_ptr<DatagramTransport>(NULL);
350 } 351 }
351 352
352 } // namespace protocol 353 } // namespace protocol
353 } // namespace remoting 354 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | third_party/libjingle/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698