remoting_service.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2021 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 REMOTING_HOST_CHROMEOS_REMOTING_SERVICE_H_
  5. #define REMOTING_HOST_CHROMEOS_REMOTING_SERVICE_H_
  6. #include <memory>
  7. namespace remoting {
  8. class ChromotingHostContext;
  9. class PolicyWatcher;
  10. class RemoteSupportHostAsh;
  11. // The RemotingService is a singleton which provides access to remoting
  12. // functionality to external callers in Chrome OS. This service also manages
  13. // state and lifetime of the instances which implement that functionality.
  14. // This service expects to be called on the sequence it was first called on
  15. // which is bound to the Main/UI sequence in production code.
  16. class RemotingService {
  17. public:
  18. static RemotingService& Get();
  19. virtual ~RemotingService() = default;
  20. // Must be called on the sequence the service was created on.
  21. virtual RemoteSupportHostAsh& GetSupportHost() = 0;
  22. // Can be called on any sequence.
  23. virtual std::unique_ptr<ChromotingHostContext> CreateHostContext() = 0;
  24. // Can be called on any sequence.
  25. virtual std::unique_ptr<PolicyWatcher> CreatePolicyWatcher() = 0;
  26. };
  27. } // namespace remoting
  28. #endif // REMOTING_HOST_CHROMEOS_REMOTING_SERVICE_H_