OLD | NEW |
---|---|
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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 | 221 |
222 private: | 222 private: |
223 void SyncWithAudioThread() { | 223 void SyncWithAudioThread() { |
224 base::WaitableEvent done(false, false); | 224 base::WaitableEvent done(false, false); |
225 audio_task_runner_->PostTask( | 225 audio_task_runner_->PostTask( |
226 FROM_HERE, | 226 FROM_HERE, |
227 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 227 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
228 done.Wait(); | 228 done.Wait(); |
229 } | 229 } |
230 | 230 |
231 scoped_ptr<base::Thread> audio_thread_; | 231 std::unique_ptr<base::Thread> audio_thread_; |
danakj
2016/04/22 22:47:37
include memory
dcheng
2016/04/22 23:13:21
Done.
| |
232 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 232 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
233 scoped_ptr<base::Thread> worker_thread_; | 233 std::unique_ptr<base::Thread> worker_thread_; |
234 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; | 234 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; |
235 | 235 |
236 VirtualAudioInputStream* stream_; | 236 VirtualAudioInputStream* stream_; |
237 MockInputCallback input_callback_; | 237 MockInputCallback input_callback_; |
238 base::WaitableEvent closed_stream_; | 238 base::WaitableEvent closed_stream_; |
239 | 239 |
240 std::list<AudioOutputStream*> output_streams_; | 240 std::list<AudioOutputStream*> output_streams_; |
241 std::list<AudioOutputStream*> stopped_output_streams_; | 241 std::list<AudioOutputStream*> stopped_output_streams_; |
242 TestAudioSource source_; | 242 TestAudioSource source_; |
243 | 243 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 } | 342 } |
343 RUN_ON_AUDIO_THREAD(Close); | 343 RUN_ON_AUDIO_THREAD(Close); |
344 WaitUntilClosed(); | 344 WaitUntilClosed(); |
345 } | 345 } |
346 | 346 |
347 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, | 347 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, |
348 VirtualAudioInputStreamTest, | 348 VirtualAudioInputStreamTest, |
349 ::testing::Values(false, true)); | 349 ::testing::Values(false, true)); |
350 | 350 |
351 } // namespace media | 351 } // namespace media |
OLD | NEW |