| Index: media/audio/fake_audio_worker.h
|
| diff --git a/media/audio/fake_audio_consumer.h b/media/audio/fake_audio_worker.h
|
| similarity index 53%
|
| rename from media/audio/fake_audio_consumer.h
|
| rename to media/audio/fake_audio_worker.h
|
| index 18c552ad97be9593dcdd370dd4bf20f50943df97..d3511a3a48cc9e8359e7c33f74eea2ba0fcd318b 100644
|
| --- a/media/audio/fake_audio_consumer.h
|
| +++ b/media/audio/fake_audio_worker.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_
|
| -#define MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_
|
| +#ifndef MEDIA_AUDIO_FAKE_AUDIO_WORKER_H_
|
| +#define MEDIA_AUDIO_FAKE_AUDIO_WORKER_H_
|
|
|
| #include "base/callback_forward.h"
|
| #include "base/memory/ref_counted.h"
|
| @@ -17,27 +17,26 @@ namespace media {
|
| class AudioBus;
|
| class AudioParameters;
|
|
|
| -// A fake audio consumer. Using a provided message loop, FakeAudioConsumer will
|
| -// simulate a real time consumer of audio data.
|
| -class MEDIA_EXPORT FakeAudioConsumer {
|
| +// A fake audio worker. Using a provided message loop, FakeAudioWorker will
|
| +// call back the provided callback like a real audio consumer or producer would.
|
| +class MEDIA_EXPORT FakeAudioWorker {
|
| public:
|
| - // |worker_task_runner| is the task runner on which the ReadCB provided to
|
| + // |worker_task_runner| is the task runner on which the closure provided to
|
| // Start() will be executed on. This may or may not be the be for the same
|
| // thread that invokes the Start/Stop methods.
|
| // |params| is used to determine the frequency of callbacks.
|
| - FakeAudioConsumer(
|
| + FakeAudioWorker(
|
| const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner,
|
| const AudioParameters& params);
|
| - ~FakeAudioConsumer();
|
| + ~FakeAudioWorker();
|
|
|
| - // Start executing |read_cb| at a regular intervals. Stop() must be called by
|
| - // the same thread before destroying FakeAudioConsumer.
|
| - typedef base::Callback<void(AudioBus* audio_bus)> ReadCB;
|
| - void Start(const ReadCB& read_cb);
|
| + // Start executing |worker_cb| at a regular intervals. Stop() must be called
|
| + // by the same thread before destroying FakeAudioWorker.
|
| + void Start(const base::Closure& worker_cb);
|
|
|
| - // Stop executing the ReadCB provided to Start(). Blocks until the worker
|
| - // loop is not inside a ReadCB invocation. Safe to call multiple times. Must
|
| - // be called on the same thread that called Start().
|
| + // Stop executing the closure provided to Start(). Blocks until the worker
|
| + // loop is not inside a closure invocation. Safe to call multiple times.
|
| + // Must be called on the same thread that called Start().
|
| void Stop();
|
|
|
| private:
|
| @@ -47,9 +46,9 @@ class MEDIA_EXPORT FakeAudioConsumer {
|
| class Worker;
|
| const scoped_refptr<Worker> worker_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(FakeAudioConsumer);
|
| + DISALLOW_COPY_AND_ASSIGN(FakeAudioWorker);
|
| };
|
|
|
| } // namespace media
|
|
|
| -#endif // MEDIA_AUDIO_FAKE_AUDIO_CONSUMER_H_
|
| +#endif // MEDIA_AUDIO_FAKE_AUDIO_WORKER_H_
|
|
|