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/media/media_stream_impl.h" | 5 #include "content/renderer/media/media_stream_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 363 } |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 void MediaStreamImpl::OnSocketDispatcherDestroyed() { | 367 void MediaStreamImpl::OnSocketDispatcherDestroyed() { |
368 CleanupPeerConnectionFactory(); | 368 CleanupPeerConnectionFactory(); |
369 } | 369 } |
370 | 370 |
371 void MediaStreamImpl::InitializeWorkerThread(talk_base::Thread** thread, | 371 void MediaStreamImpl::InitializeWorkerThread(talk_base::Thread** thread, |
372 base::WaitableEvent* event) { | 372 base::WaitableEvent* event) { |
373 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); | 373 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
374 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); | 374 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); |
375 *thread = jingle_glue::JingleThreadWrapper::current(); | 375 *thread = jingle_glue::JingleThreadWrapper::current(); |
376 event->Signal(); | 376 event->Signal(); |
377 } | 377 } |
378 | 378 |
379 void MediaStreamImpl::CreateIpcNetworkManagerOnWorkerThread( | 379 void MediaStreamImpl::CreateIpcNetworkManagerOnWorkerThread( |
380 base::WaitableEvent* event) { | 380 base::WaitableEvent* event) { |
381 DCHECK_EQ(MessageLoop::current(), chrome_worker_thread_.message_loop()); | 381 DCHECK_EQ(MessageLoop::current(), chrome_worker_thread_.message_loop()); |
382 network_manager_ = new content::IpcNetworkManager(p2p_socket_dispatcher_); | 382 network_manager_ = new content::IpcNetworkManager(p2p_socket_dispatcher_); |
383 event->Signal(); | 383 event->Signal(); |
384 } | 384 } |
385 | 385 |
386 void MediaStreamImpl::DeleteIpcNetworkManager() { | 386 void MediaStreamImpl::DeleteIpcNetworkManager() { |
387 DCHECK_EQ(MessageLoop::current(), chrome_worker_thread_.message_loop()); | 387 DCHECK_EQ(MessageLoop::current(), chrome_worker_thread_.message_loop()); |
388 delete network_manager_; | 388 delete network_manager_; |
389 network_manager_ = NULL; | 389 network_manager_ = NULL; |
390 } | 390 } |
391 | 391 |
392 bool MediaStreamImpl::EnsurePeerConnectionFactory() { | 392 bool MediaStreamImpl::EnsurePeerConnectionFactory() { |
393 DCHECK(CalledOnValidThread()); | 393 DCHECK(CalledOnValidThread()); |
394 if (!signaling_thread_) { | 394 if (!signaling_thread_) { |
395 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); | 395 jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
396 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); | 396 jingle_glue::JingleThreadWrapper::current()->set_send_allowed(true); |
397 signaling_thread_ = jingle_glue::JingleThreadWrapper::current(); | 397 signaling_thread_ = jingle_glue::JingleThreadWrapper::current(); |
398 } | 398 } |
399 | 399 |
400 if (!worker_thread_) { | 400 if (!worker_thread_) { |
401 if (!chrome_worker_thread_.IsRunning()) { | 401 if (!chrome_worker_thread_.IsRunning()) { |
402 if (!chrome_worker_thread_.Start()) { | 402 if (!chrome_worker_thread_.Start()) { |
403 LOG(ERROR) << "Could not start worker thread"; | 403 LOG(ERROR) << "Could not start worker thread"; |
404 signaling_thread_ = NULL; | 404 signaling_thread_ = NULL; |
405 return false; | 405 return false; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 MediaStreamExtraData::MediaStreamExtraData( | 555 MediaStreamExtraData::MediaStreamExtraData( |
556 webrtc::MediaStreamInterface* remote_stream) | 556 webrtc::MediaStreamInterface* remote_stream) |
557 : remote_stream_(remote_stream) { | 557 : remote_stream_(remote_stream) { |
558 } | 558 } |
559 MediaStreamExtraData::MediaStreamExtraData( | 559 MediaStreamExtraData::MediaStreamExtraData( |
560 webrtc::LocalMediaStreamInterface* local_stream) | 560 webrtc::LocalMediaStreamInterface* local_stream) |
561 : local_stream_(local_stream) { | 561 : local_stream_(local_stream) { |
562 } | 562 } |
563 MediaStreamExtraData::~MediaStreamExtraData() { | 563 MediaStreamExtraData::~MediaStreamExtraData() { |
564 } | 564 } |
OLD | NEW |