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

Side by Side Diff: webrtc/voice_engine/test/android/android_test/jni/android_test.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 { 170 {
171 public: 171 public:
172 ThreadTest(); 172 ThreadTest();
173 ~ThreadTest(); 173 ~ThreadTest();
174 int RunTest(); 174 int RunTest();
175 int CloseTest(); 175 int CloseTest();
176 private: 176 private:
177 static bool Run(void* ptr); 177 static bool Run(void* ptr);
178 bool Process(); 178 bool Process();
179 private: 179 private:
180 rtc::scoped_ptr<PlatformThread> _thread; 180 rtc::PlatformThread _thread;
181 }; 181 };
182 182
183 ThreadTest::~ThreadTest() 183 ThreadTest::~ThreadTest()
184 { 184 {
185 if (_thread) 185 if (_thread)
186 _thread->Stop(); 186 _thread->Stop();
187 } 187 }
188 188
189 ThreadTest::ThreadTest() 189 ThreadTest::ThreadTest()
190 { 190 {
191 _thread = PlatformThread::CreateThread(Run, this, "ThreadTest thread"); 191 _thread(Run, this, "ThreadTest thread");
192 } 192 }
193 193
194 bool ThreadTest::Run(void* ptr) 194 bool ThreadTest::Run(void* ptr)
195 { 195 {
196 return static_cast<ThreadTest*> (ptr)->Process(); 196 return static_cast<ThreadTest*> (ptr)->Process();
197 } 197 }
198 198
199 bool ThreadTest::Process() 199 bool ThreadTest::Process()
200 { 200 {
201 // Attach this thread to JVM 201 // Attach this thread to JVM
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 releaseOK = false; 1322 releaseOK = false;
1323 } 1323 }
1324 else 1324 else
1325 { 1325 {
1326 veData.rtp_rtcp = NULL; 1326 veData.rtp_rtcp = NULL;
1327 } 1327 }
1328 } 1328 }
1329 1329
1330 return releaseOK; 1330 return releaseOK;
1331 } 1331 }
OLDNEW
« no previous file with comments | « webrtc/video_engine/vie_channel.cc ('k') | webrtc/voice_engine/test/auto_test/fakes/conference_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698