system_connector.h 884 B

12345678910111213141516171819202122232425
  1. // Copyright 2019 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 CHROMECAST_BROWSER_SYSTEM_CONNECTOR_H_
  5. #define CHROMECAST_BROWSER_SYSTEM_CONNECTOR_H_
  6. #include <memory>
  7. #include "services/service_manager/public/cpp/connector.h"
  8. namespace chromecast {
  9. // Returns a Connector which can be used to connect to service interfaces from
  10. // the browser process. May return null in unit testing environments.
  11. //
  12. // This function is safe to call from any thread, but the returned pointer is
  13. // different on each thread and is NEVER safe to retain or pass across threads.
  14. service_manager::Connector* GetSystemConnector();
  15. void SetSystemConnector(std::unique_ptr<service_manager::Connector> connector);
  16. } // namespace chromecast
  17. #endif // CHROMECAST_BROWSER_SYSTEM_CONNECTOR_H_