chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/background_url_loader.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_BACKGROUND_URL_LOADER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_BACKGROUND_URL_LOADER_H_

#include "base/memory/scoped_refptr.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader.h"

namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace network {
struct ResourceRequest;
}  // namespace network

namespace blink {

class BackForwardCacheLoaderHelper;
class BackgroundCodeCacheHost;
class URLLoaderClient;
struct ResourceLoaderOptions;
class WebBackgroundResourceFetchAssets;

// BackgroundURLLoader is used to fetch a resource request on a background
// thread. Used only when BackgroundResourceFetch feature is enabled.
//
// This class has a Context object which is a subclass of ThreadSafeRefCounted.
// This Context receives the response on the background thread and passes the
// response to the URLLoaderClient on the main thread.
//
// Design doc of BackgroundResourceFetch feature:
// https://docs.google.com/document/d/11cEc3KFpM7NwMMY9OkIUkIg5vGisNTXvzLZMgwBM-BM/edit?usp=sharing
// This feature is an internal optimization and doesn't change the exposed JS
// API surfaces.
class BLINK_PLATFORM_EXPORT BackgroundURLLoader : public URLLoader {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_BACKGROUND_URL_LOADER_H_