chromium/media/audio/scoped_task_runner_observer.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_AUDIO_SCOPED_TASK_RUNNER_OBSERVER_H_
#define MEDIA_AUDIO_SCOPED_TASK_RUNNER_OBSERVER_H_

#include "base/memory/scoped_refptr.h"
#include "base/task/current_thread.h"

namespace base {
class SingleThreadTaskRunner;
class WaitableEvent;
}

namespace media {

// A common base class for AudioOutputDevice and AudioInputDevice that manages
// a task runner and monitors it for destruction. If the object goes out of
// scope before the task runner, the object will automatically remove itself
// from the task runner's list of destruction observers.
// NOTE: The class that inherits from this class must implement the
// WillDestroyCurrentMessageLoop virtual method from DestructionObserver.
class ScopedTaskRunnerObserver
    : public base::CurrentThread::DestructionObserver {};

}  // namespace media.

#endif  // MEDIA_AUDIO_SCOPED_TASK_RUNNER_OBSERVER_H_