#include "pdf/loader/url_loader.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ref.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "net/base/net_errors.h"
#include "net/cookies/site_for_cookies.h"
#include "net/http/http_util.h"
#include "pdf/loader/result_codes.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-shared.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/platform/web_http_body.h"
#include "third_party/blink/public/platform/web_http_header_visitor.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_associated_url_loader.h"
#include "third_party/blink/public/web/web_associated_url_loader_options.h"
#include "url/gurl.h"
namespace chrome_pdf {
namespace {
class HeadersToString final : public blink::WebHTTPHeaderVisitor { … };
}
UrlRequest::UrlRequest() = default;
UrlRequest::UrlRequest(const UrlRequest& other) = default;
UrlRequest::UrlRequest(UrlRequest&& other) noexcept = default;
UrlRequest& UrlRequest::operator=(const UrlRequest& other) = default;
UrlRequest& UrlRequest::operator=(UrlRequest&& other) noexcept = default;
UrlRequest::~UrlRequest() = default;
UrlResponse::UrlResponse() = default;
UrlResponse::UrlResponse(const UrlResponse& other) = default;
UrlResponse::UrlResponse(UrlResponse&& other) noexcept = default;
UrlResponse& UrlResponse::operator=(const UrlResponse& other) = default;
UrlResponse& UrlResponse::operator=(UrlResponse&& other) noexcept = default;
UrlResponse::~UrlResponse() = default;
UrlLoader::UrlLoader(base::WeakPtr<Client> client)
: … { … }
UrlLoader::~UrlLoader() = default;
void UrlLoader::Open(const UrlRequest& request,
base::OnceCallback<void(int)> callback) { … }
void UrlLoader::ReadResponseBody(base::span<char> buffer,
base::OnceCallback<void(int)> callback) { … }
void UrlLoader::Close() { … }
bool UrlLoader::WillFollowRedirect(
const blink::WebURL& new_url,
const blink::WebURLResponse& redirect_response) { … }
void UrlLoader::DidSendData(uint64_t bytes_sent,
uint64_t total_bytes_to_be_sent) { … }
void UrlLoader::DidReceiveResponse(const blink::WebURLResponse& response) { … }
void UrlLoader::DidDownloadData(uint64_t data_length) { … }
void UrlLoader::DidReceiveData(const char* data, int data_length) { … }
void UrlLoader::DidFinishLoading() { … }
void UrlLoader::DidFail(const blink::WebURLError& error) { … }
void UrlLoader::AbortLoad(int32_t result) { … }
void UrlLoader::RunReadCallback() { … }
void UrlLoader::SetLoadComplete(int32_t result) { … }
}