summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorjiayl@webrtc.org <jiayl@webrtc.org>2014-09-24 17:14:05 +0000
committerjiayl@webrtc.org <jiayl@webrtc.org>2014-09-24 17:14:05 +0000
commit40539b82d5a2c9bcf23d078e997ce0368160f5a3 (patch)
tree532416c2f3025131e902ab655f3d404945485a6b /app
parent47740f2c26aea1b3b7830abdcba063a12a61d009 (diff)
downloadtalk-40539b82d5a2c9bcf23d078e997ce0368160f5a3.tar.gz
Fix a problem in Thread::Send.
Previously if thread A->Send is called on thread B, B->ReceiveSends will be called, which enables an arbitrary thread to invoke calls on B while B is wait for A->Send to return. This caused mutliple problems like issue 3559, 3579. The fix is to limit B->ReceiveSends to only process requests from A. Also disallow the worker thread invoking other threads. BUG=3559 R=juberti@webrtc.org Review URL: https://webrtc-codereview.appspot.com/15089004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@7290 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'app')
-rw-r--r--app/webrtc/peerconnection_unittest.cc9
-rw-r--r--app/webrtc/peerconnectionfactory.cc1
-rw-r--r--app/webrtc/test/peerconnectiontestwrapper.cc3
-rw-r--r--app/webrtc/test/peerconnectiontestwrapper.h1
4 files changed, 3 insertions, 11 deletions
diff --git a/app/webrtc/peerconnection_unittest.cc b/app/webrtc/peerconnection_unittest.cc
index 0d3e426..977fc11 100644
--- a/app/webrtc/peerconnection_unittest.cc
+++ b/app/webrtc/peerconnection_unittest.cc
@@ -481,9 +481,8 @@ class PeerConnectionTestClientBase
if (!allocator_factory_) {
return false;
}
- audio_thread_.Start();
fake_audio_capture_module_ = FakeAudioCaptureModule::Create(
- &audio_thread_);
+ rtc::Thread::Current());
if (fake_audio_capture_module_ == NULL) {
return false;
@@ -557,12 +556,6 @@ class PeerConnectionTestClientBase
}
std::string id_;
- // Separate thread for executing |fake_audio_capture_module_| tasks. Audio
- // processing must not be performed on the same thread as signaling due to
- // signaling time constraints and relative complexity of the audio pipeline.
- // This is consistent with the video pipeline that us a a separate thread for
- // encoding and decoding.
- rtc::Thread audio_thread_;
rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
allocator_factory_;
diff --git a/app/webrtc/peerconnectionfactory.cc b/app/webrtc/peerconnectionfactory.cc
index 5dccba8..862ceda 100644
--- a/app/webrtc/peerconnectionfactory.cc
+++ b/app/webrtc/peerconnectionfactory.cc
@@ -41,6 +41,7 @@
#include "talk/media/webrtc/webrtcmediaengine.h"
#include "talk/media/webrtc/webrtcvideodecoderfactory.h"
#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
+#include "webrtc/base/bind.h"
#include "webrtc/modules/audio_device/include/audio_device.h"
using rtc::scoped_refptr;
diff --git a/app/webrtc/test/peerconnectiontestwrapper.cc b/app/webrtc/test/peerconnectiontestwrapper.cc
index 8a4f45c..24932b8 100644
--- a/app/webrtc/test/peerconnectiontestwrapper.cc
+++ b/app/webrtc/test/peerconnectiontestwrapper.cc
@@ -75,9 +75,8 @@ bool PeerConnectionTestWrapper::CreatePc(
return false;
}
- audio_thread_.Start();
fake_audio_capture_module_ = FakeAudioCaptureModule::Create(
- &audio_thread_);
+ rtc::Thread::Current());
if (fake_audio_capture_module_ == NULL) {
return false;
}
diff --git a/app/webrtc/test/peerconnectiontestwrapper.h b/app/webrtc/test/peerconnectiontestwrapper.h
index f3477ce..d4a0e4e 100644
--- a/app/webrtc/test/peerconnectiontestwrapper.h
+++ b/app/webrtc/test/peerconnectiontestwrapper.h
@@ -111,7 +111,6 @@ class PeerConnectionTestWrapper
bool video, const webrtc::FakeConstraints& video_constraints);
std::string name_;
- rtc::Thread audio_thread_;
rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
allocator_factory_;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;