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

Unified Diff: webrtc/test/fake_audio_device.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/fake_audio_device.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_audio_device.cc
diff --git a/webrtc/test/fake_audio_device.cc b/webrtc/test/fake_audio_device.cc
index 4eee6606a3e00ddb82769064c09697eb383ea8ce..31cebda6521a01455fbe17f5b789423d296aa82e 100644
--- a/webrtc/test/fake_audio_device.cc
+++ b/webrtc/test/fake_audio_device.cc
@@ -30,6 +30,7 @@ FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename)
last_playout_ms_(-1),
clock_(clock),
tick_(EventTimerWrapper::Create()),
+ thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"),
file_utility_(new ModuleFileUtility(0)),
input_stream_(FileWrapper::Create()) {
memset(captured_audio_, 0, sizeof(captured_audio_));
@@ -42,8 +43,7 @@ FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename)
FakeAudioDevice::~FakeAudioDevice() {
Stop();
- if (thread_.get() != NULL)
- thread_->Stop();
+ thread_.Stop();
}
int32_t FakeAudioDevice::Init() {
@@ -53,15 +53,8 @@ int32_t FakeAudioDevice::Init() {
if (!tick_->StartTimer(true, 10))
return -1;
- thread_ = PlatformThread::CreateThread(FakeAudioDevice::Run, this,
- "FakeAudioDevice");
- if (thread_.get() == NULL)
- return -1;
- if (!thread_->Start()) {
- thread_.reset();
- return -1;
- }
- thread_->SetPriority(webrtc::kHighPriority);
+ thread_.Start();
+ thread_.SetPriority(rtc::kHighPriority);
return 0;
}
« no previous file with comments | « webrtc/test/fake_audio_device.h ('k') | webrtc/test/frame_generator_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698