2019-07-24 23:12:00 +02:00
|
|
|
// Copyright 2018 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
#ifndef CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|
|
|
|
#define CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|
2019-07-24 23:12:00 +02:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
2024-03-19 22:11:42 +01:00
|
|
|
#include "base/sequence_checker.h"
|
2021-04-21 00:52:34 +02:00
|
|
|
#include "third_party/blink/public/platform/url_loader_throttle_provider.h"
|
2019-07-24 23:12:00 +02:00
|
|
|
|
2023-04-26 21:55:59 +02:00
|
|
|
class AlloyContentRendererClient;
|
|
|
|
|
2019-07-24 23:12:00 +02:00
|
|
|
// Instances must be constructed on the render thread, and then used and
|
|
|
|
// destructed on a single thread, which can be different from the render thread.
|
|
|
|
class CefURLLoaderThrottleProviderImpl
|
2021-04-21 00:52:34 +02:00
|
|
|
: public blink::URLLoaderThrottleProvider {
|
2019-07-24 23:12:00 +02:00
|
|
|
public:
|
2023-04-26 21:55:59 +02:00
|
|
|
CefURLLoaderThrottleProviderImpl(
|
|
|
|
blink::URLLoaderThrottleProviderType type,
|
|
|
|
AlloyContentRendererClient* alloy_content_renderer_client);
|
2019-07-24 23:12:00 +02:00
|
|
|
|
2021-12-16 23:35:54 +01:00
|
|
|
CefURLLoaderThrottleProviderImpl& operator=(
|
|
|
|
const CefURLLoaderThrottleProviderImpl&) = delete;
|
|
|
|
|
2019-07-24 23:12:00 +02:00
|
|
|
~CefURLLoaderThrottleProviderImpl() override;
|
|
|
|
|
2021-04-21 00:52:34 +02:00
|
|
|
// blink::URLLoaderThrottleProvider implementation.
|
|
|
|
std::unique_ptr<blink::URLLoaderThrottleProvider> Clone() override;
|
|
|
|
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> CreateThrottles(
|
2023-12-06 21:16:15 +01:00
|
|
|
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
|
2024-01-26 03:12:43 +01:00
|
|
|
const network::ResourceRequest& request) override;
|
2019-07-24 23:12:00 +02:00
|
|
|
void SetOnline(bool is_online) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
// This copy constructor works in conjunction with Clone(), not intended for
|
|
|
|
// general use.
|
|
|
|
CefURLLoaderThrottleProviderImpl(
|
|
|
|
const CefURLLoaderThrottleProviderImpl& other);
|
|
|
|
|
2021-04-21 00:52:34 +02:00
|
|
|
blink::URLLoaderThrottleProviderType type_;
|
2023-04-26 21:55:59 +02:00
|
|
|
AlloyContentRendererClient* const alloy_content_renderer_client_;
|
2019-07-24 23:12:00 +02:00
|
|
|
|
2024-03-19 22:11:42 +01:00
|
|
|
SEQUENCE_CHECKER(sequence_checker_);
|
2019-07-24 23:12:00 +02:00
|
|
|
};
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
#endif // CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|