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

// Copyright 2017 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_SYNC_LOAD_CONTEXT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_SYNC_LOAD_CONTEXT_H_

#include "base/memory/raw_ptr.h"
#include "base/synchronization/waitable_event_watcher.h"
#include "base/task/single_thread_task_runner.h"
#include "base/timer/timer.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "mojo/public/cpp/system/simple_watcher.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "third_party/blink/public/mojom/blob/blob_registry.mojom-blink.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/resource_request_client.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/resource_request_sender.h"

namespace base {
class WaitableEvent;
}

namespace network {
struct ResourceRequest;
}

namespace blink {
class ResourceLoadInfoNotifierWrapper;
class URLLoaderThrottle;
struct SyncLoadResponse;

// This class owns the context necessary to perform an asynchronous request
// while the main thread is blocked so that it appears to be synchronous.
// There are a couple of modes to load a request:
//   1) kDataPipe; body is received on a data pipe passed on
//      OnStartLoadingResponseBody(), and the body is set to response_.data.
//   2) kBlob: body is received on a data pipe passed on
//      OnStartLoadingResponseBody(), and wraps the data pipe with a
//      SerializedBlobPtr.
class BLINK_PLATFORM_EXPORT SyncLoadContext : public ResourceRequestClient {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_URL_LOADER_SYNC_LOAD_CONTEXT_H_