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

Unified Diff: webrtc/test/frame_generator_capturer.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/frame_generator_capturer.h ('k') | webrtc/video/rampup_tests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator_capturer.cc
diff --git a/webrtc/test/frame_generator_capturer.cc b/webrtc/test/frame_generator_capturer.cc
index cc0ad88f03802eb6513f4435fcf10850c69e6d47..35ce6168a2e99bffa79e2f7fd37596059d58a942 100644
--- a/webrtc/test/frame_generator_capturer.cc
+++ b/webrtc/test/frame_generator_capturer.cc
@@ -65,6 +65,7 @@ FrameGeneratorCapturer::FrameGeneratorCapturer(Clock* clock,
clock_(clock),
sending_(false),
tick_(EventTimerWrapper::Create()),
+ thread_(FrameGeneratorCapturer::Run, this, "FrameGeneratorCapturer"),
frame_generator_(frame_generator),
target_fps_(target_fps),
first_frame_capture_time_(-1) {
@@ -76,8 +77,7 @@ FrameGeneratorCapturer::FrameGeneratorCapturer(Clock* clock,
FrameGeneratorCapturer::~FrameGeneratorCapturer() {
Stop();
- if (thread_.get() != NULL)
- thread_->Stop();
+ thread_.Stop();
}
bool FrameGeneratorCapturer::Init() {
@@ -88,15 +88,8 @@ bool FrameGeneratorCapturer::Init() {
if (!tick_->StartTimer(true, 1000 / target_fps_))
return false;
- thread_ = PlatformThread::CreateThread(FrameGeneratorCapturer::Run, this,
- "FrameGeneratorCapturer");
- if (thread_.get() == NULL)
- return false;
- if (!thread_->Start()) {
- thread_.reset();
- return false;
- }
- thread_->SetPriority(webrtc::kHighPriority);
+ thread_.Start();
+ thread_.SetPriority(rtc::kHighPriority);
return true;
}
« no previous file with comments | « webrtc/test/frame_generator_capturer.h ('k') | webrtc/video/rampup_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698