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

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

Issue 10823224: Update JingleThreadWrapper to allow it to be created using task runner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/client/plugin/chromoting_instance.cc ('k') | no next file » | 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/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "jingle/glue/channel_socket_adapter.h" 9 #include "jingle/glue/channel_socket_adapter.h"
10 #include "jingle/glue/pseudotcp_adapter.h" 10 #include "jingle/glue/pseudotcp_adapter.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } 305 }
306 306
307 } // namespace 307 } // namespace
308 308
309 LibjingleTransportFactory::LibjingleTransportFactory( 309 LibjingleTransportFactory::LibjingleTransportFactory(
310 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, 310 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator,
311 bool incoming_only) 311 bool incoming_only)
312 : http_port_allocator_(port_allocator.get()), 312 : http_port_allocator_(port_allocator.get()),
313 port_allocator_(port_allocator.Pass()), 313 port_allocator_(port_allocator.Pass()),
314 incoming_only_(incoming_only) { 314 incoming_only_(incoming_only) {
315 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); 315 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
316 } 316 }
317 317
318 LibjingleTransportFactory::LibjingleTransportFactory() 318 LibjingleTransportFactory::LibjingleTransportFactory()
319 : network_manager_(new talk_base::BasicNetworkManager()), 319 : network_manager_(new talk_base::BasicNetworkManager()),
320 socket_factory_(new remoting::ChromiumPacketSocketFactory()), 320 socket_factory_(new remoting::ChromiumPacketSocketFactory()),
321 http_port_allocator_(NULL), 321 http_port_allocator_(NULL),
322 port_allocator_(new cricket::BasicPortAllocator( 322 port_allocator_(new cricket::BasicPortAllocator(
323 network_manager_.get(), socket_factory_.get())), 323 network_manager_.get(), socket_factory_.get())),
324 incoming_only_(false) { 324 incoming_only_(false) {
325 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); 325 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop();
326 port_allocator_->set_flags( 326 port_allocator_->set_flags(
327 cricket::PORTALLOCATOR_DISABLE_TCP | 327 cricket::PORTALLOCATOR_DISABLE_TCP |
328 cricket::PORTALLOCATOR_DISABLE_STUN | 328 cricket::PORTALLOCATOR_DISABLE_STUN |
329 cricket::PORTALLOCATOR_DISABLE_RELAY | 329 cricket::PORTALLOCATOR_DISABLE_RELAY |
330 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG); 330 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG);
331 } 331 }
332 332
333 LibjingleTransportFactory::~LibjingleTransportFactory() { 333 LibjingleTransportFactory::~LibjingleTransportFactory() {
334 // This method may be called in response to a libjingle signal, so 334 // This method may be called in response to a libjingle signal, so
335 // libjingle objects must be deleted asynchronously. 335 // libjingle objects must be deleted asynchronously.
(...skipping 30 matching lines...) Expand all
366 } 366 }
367 367
368 scoped_ptr<DatagramTransport> 368 scoped_ptr<DatagramTransport>
369 LibjingleTransportFactory::CreateDatagramTransport() { 369 LibjingleTransportFactory::CreateDatagramTransport() {
370 NOTIMPLEMENTED(); 370 NOTIMPLEMENTED();
371 return scoped_ptr<DatagramTransport>(NULL); 371 return scoped_ptr<DatagramTransport>(NULL);
372 } 372 }
373 373
374 } // namespace protocol 374 } // namespace protocol
375 } // namespace remoting 375 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698