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 "remoting/protocol/libjingle_transport_factory.h" | 5 #include "remoting/protocol/libjingle_transport_factory.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 } // namespace | 405 } // namespace |
406 | 406 |
407 LibjingleTransportFactory::LibjingleTransportFactory( | 407 LibjingleTransportFactory::LibjingleTransportFactory( |
408 SignalStrategy* signal_strategy, | 408 SignalStrategy* signal_strategy, |
409 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, | 409 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, |
410 const NetworkSettings& network_settings) | 410 const NetworkSettings& network_settings) |
411 : signal_strategy_(signal_strategy), | 411 : signal_strategy_(signal_strategy), |
412 port_allocator_(port_allocator.Pass()), | 412 port_allocator_(port_allocator.Pass()), |
413 network_settings_(network_settings) { | 413 network_settings_(network_settings) { |
414 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); | |
415 } | 414 } |
416 | 415 |
417 LibjingleTransportFactory::~LibjingleTransportFactory() { | 416 LibjingleTransportFactory::~LibjingleTransportFactory() { |
418 // This method may be called in response to a libjingle signal, so | 417 // This method may be called in response to a libjingle signal, so |
419 // libjingle objects must be deleted asynchronously. | 418 // libjingle objects must be deleted asynchronously. |
420 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 419 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
421 base::ThreadTaskRunnerHandle::Get(); | 420 base::ThreadTaskRunnerHandle::Get(); |
422 task_runner->DeleteSoon(FROM_HERE, port_allocator_.release()); | 421 task_runner->DeleteSoon(FROM_HERE, port_allocator_.release()); |
423 } | 422 } |
424 | 423 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 last_jingle_info_update_time_ = base::TimeTicks::Now(); | 482 last_jingle_info_update_time_ = base::TimeTicks::Now(); |
484 | 483 |
485 while (!on_jingle_info_callbacks_.empty()) { | 484 while (!on_jingle_info_callbacks_.empty()) { |
486 on_jingle_info_callbacks_.begin()->Run(); | 485 on_jingle_info_callbacks_.begin()->Run(); |
487 on_jingle_info_callbacks_.pop_front(); | 486 on_jingle_info_callbacks_.pop_front(); |
488 } | 487 } |
489 } | 488 } |
490 | 489 |
491 } // namespace protocol | 490 } // namespace protocol |
492 } // namespace remoting | 491 } // namespace remoting |
OLD | NEW |