network_hints_handler_impl.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2019 Slack Technologies, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_
  5. #define ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/network_hints/browser/simple_network_hints_handler_impl.h"
  8. namespace content {
  9. class RenderFrameHost;
  10. class BrowserContext;
  11. } // namespace content
  12. class NetworkHintsHandlerImpl
  13. : public network_hints::SimpleNetworkHintsHandlerImpl {
  14. public:
  15. ~NetworkHintsHandlerImpl() override;
  16. static void Create(
  17. content::RenderFrameHost* frame_host,
  18. mojo::PendingReceiver<network_hints::mojom::NetworkHintsHandler>
  19. receiver);
  20. // network_hints::mojom::NetworkHintsHandler:
  21. void Preconnect(const url::SchemeHostPort& url,
  22. bool allow_credentials) override;
  23. private:
  24. explicit NetworkHintsHandlerImpl(content::RenderFrameHost*);
  25. raw_ptr<content::BrowserContext> browser_context_ = nullptr;
  26. };
  27. #endif // ELECTRON_SHELL_BROWSER_NETWORK_HINTS_HANDLER_IMPL_H_