web_engine_url_loader_throttle_provider.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 FUCHSIA_WEB_WEBENGINE_RENDERER_WEB_ENGINE_URL_LOADER_THROTTLE_PROVIDER_H_
  5. #define FUCHSIA_WEB_WEBENGINE_RENDERER_WEB_ENGINE_URL_LOADER_THROTTLE_PROVIDER_H_
  6. #include "base/sequence_checker.h"
  7. #include "third_party/blink/public/platform/url_loader_throttle_provider.h"
  8. class WebEngineContentRendererClient;
  9. // Implements a URLLoaderThrottleProvider for the WebEngine. Creates
  10. // URLLoaderThrottles, implemented as WebEngineURLLoaderThrottles for network
  11. // requests.
  12. class WebEngineURLLoaderThrottleProvider
  13. : public blink::URLLoaderThrottleProvider {
  14. public:
  15. explicit WebEngineURLLoaderThrottleProvider(
  16. WebEngineContentRendererClient* content_renderer_client);
  17. WebEngineURLLoaderThrottleProvider(
  18. const WebEngineURLLoaderThrottleProvider&) = delete;
  19. WebEngineURLLoaderThrottleProvider& operator=(
  20. const WebEngineURLLoaderThrottleProvider&) = delete;
  21. ~WebEngineURLLoaderThrottleProvider() override;
  22. // blink::URLLoaderThrottleProvider implementation.
  23. std::unique_ptr<blink::URLLoaderThrottleProvider> Clone() override;
  24. blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> CreateThrottles(
  25. int render_frame_id,
  26. const blink::WebURLRequest& request) override;
  27. void SetOnline(bool is_online) override;
  28. private:
  29. const WebEngineContentRendererClient* const content_renderer_client_;
  30. SEQUENCE_CHECKER(sequence_checker_);
  31. };
  32. #endif // FUCHSIA_WEB_WEBENGINE_RENDERER_WEB_ENGINE_URL_LOADER_THROTTLE_PROVIDER_H_