mirroring_service.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 COMPONENTS_MIRRORING_SERVICE_MIRRORING_SERVICE_H_
  5. #define COMPONENTS_MIRRORING_SERVICE_MIRRORING_SERVICE_H_
  6. #include "base/component_export.h"
  7. #include "components/mirroring/mojom/mirroring_service.mojom.h"
  8. #include "mojo/public/cpp/bindings/pending_receiver.h"
  9. #include "mojo/public/cpp/bindings/pending_remote.h"
  10. #include "mojo/public/cpp/bindings/receiver.h"
  11. namespace mirroring {
  12. class Session;
  13. class COMPONENT_EXPORT(MIRRORING_SERVICE) MirroringService final
  14. : public mojom::MirroringService {
  15. public:
  16. MirroringService(mojo::PendingReceiver<mojom::MirroringService> receiver,
  17. scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
  18. MirroringService(const MirroringService&) = delete;
  19. MirroringService& operator=(const MirroringService&) = delete;
  20. ~MirroringService() override;
  21. private:
  22. // mojom::MirroringService implementation.
  23. void Start(mojom::SessionParametersPtr params,
  24. const gfx::Size& max_resolution,
  25. mojo::PendingRemote<mojom::SessionObserver> observer,
  26. mojo::PendingRemote<mojom::ResourceProvider> resource_provider,
  27. mojo::PendingRemote<mojom::CastMessageChannel> outbound_channel,
  28. mojo::PendingReceiver<mojom::CastMessageChannel> inbound_channel)
  29. override;
  30. void OnDisconnect();
  31. mojo::Receiver<mojom::MirroringService> receiver_;
  32. const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
  33. std::unique_ptr<Session> session_; // Current mirroring session.
  34. };
  35. } // namespace mirroring
  36. #endif // COMPONENTS_MIRRORING_SERVICE_MIRRORING_SERVICE_H_