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

Side by Side Diff: content/renderer/media/media_stream_impl.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 | « no previous file | content/renderer/p2p/p2p_transport_impl.cc » ('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 "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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/p2p/p2p_transport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698