chrome_content_utility_client.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright (c) 2012 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 CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_
  5. #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_
  6. #include "build/build_config.h"
  7. #include "content/public/utility/content_utility_client.h"
  8. class ChromeContentUtilityClient : public content::ContentUtilityClient {
  9. public:
  10. using NetworkBinderCreationCallback =
  11. base::OnceCallback<void(service_manager::BinderRegistry*)>;
  12. ChromeContentUtilityClient();
  13. ChromeContentUtilityClient(const ChromeContentUtilityClient&) = delete;
  14. ChromeContentUtilityClient& operator=(const ChromeContentUtilityClient&) =
  15. delete;
  16. ~ChromeContentUtilityClient() override;
  17. // content::ContentUtilityClient:
  18. void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
  19. void PostIOThreadCreated(
  20. base::SingleThreadTaskRunner* io_thread_task_runner) override;
  21. void RegisterNetworkBinders(
  22. service_manager::BinderRegistry* registry) override;
  23. void UtilityThreadStarted() override;
  24. void RegisterMainThreadServices(mojo::ServiceFactory& services) override;
  25. void RegisterIOThreadServices(mojo::ServiceFactory& services) override;
  26. // See NetworkBinderProvider above.
  27. static void SetNetworkBinderCreationCallback(
  28. NetworkBinderCreationCallback callback);
  29. private:
  30. // True if the utility process runs with elevated privileges.
  31. bool utility_process_running_elevated_ = false;
  32. };
  33. #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_