log_factory_manager.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SERVICES_AUDIO_LOG_FACTORY_MANAGER_H_
  5. #define SERVICES_AUDIO_LOG_FACTORY_MANAGER_H_
  6. #include "mojo/public/cpp/bindings/pending_receiver.h"
  7. #include "mojo/public/cpp/bindings/receiver_set.h"
  8. #include "services/audio/log_factory_adapter.h"
  9. #include "services/audio/public/mojom/log_factory_manager.mojom.h"
  10. namespace media {
  11. class AudioLogFactory;
  12. }
  13. namespace audio {
  14. // This class is used to provide the LogFactoryManager interface. It will
  15. // typically be instantiated when needed and remain for the lifetime of the
  16. // service.
  17. class LogFactoryManager final : public mojom::LogFactoryManager {
  18. public:
  19. LogFactoryManager();
  20. LogFactoryManager(const LogFactoryManager&) = delete;
  21. LogFactoryManager& operator=(const LogFactoryManager&) = delete;
  22. ~LogFactoryManager() final;
  23. void Bind(mojo::PendingReceiver<mojom::LogFactoryManager> receiver);
  24. // LogFactoryManager implementation.
  25. void SetLogFactory(
  26. mojo::PendingRemote<media::mojom::AudioLogFactory> log_factory) final;
  27. media::AudioLogFactory* GetLogFactory();
  28. private:
  29. mojo::ReceiverSet<mojom::LogFactoryManager> receivers_;
  30. LogFactoryAdapter log_factory_adapter_;
  31. SEQUENCE_CHECKER(owning_sequence_);
  32. };
  33. } // namespace audio
  34. #endif // SERVICES_AUDIO_LOG_FACTORY_MANAGER_H_