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>
|
|
|
|
|
|
|
|
#include "base/threading/thread_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
|
|
|
|
|
|
|
// 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:
|
|
|
|
explicit CefURLLoaderThrottleProviderImpl(
|
2021-04-21 00:52:34 +02:00
|
|
|
blink::URLLoaderThrottleProviderType type);
|
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(
|
2019-07-24 23:12:00 +02:00
|
|
|
int render_frame_id,
|
2020-03-30 22:13:42 +02:00
|
|
|
const blink::WebURLRequest& 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_;
|
2019-07-24 23:12:00 +02:00
|
|
|
|
|
|
|
THREAD_CHECKER(thread_checker_);
|
|
|
|
};
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
#endif // CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_
|