chromium/pdf/loader/url_loader_wrapper_impl.cc

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

#if defined(UNSAFE_BUFFERS_BUILD)
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

#include "pdf/loader/url_loader_wrapper_impl.h"

#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include <memory>
#include <string>
#include <string_view>
#include <utility>

#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/http/http_util.h"
#include "pdf/loader/url_loader.h"
#include "ui/gfx/range/range.h"

namespace chrome_pdf {

namespace {

// We should read with delay to prevent block UI thread, and reduce CPU usage.
constexpr base::TimeDelta kReadDelayMs =;

UrlRequest MakeRangeRequest(const std::string& url,
                            const std::string& referrer_url,
                            uint32_t position,
                            uint32_t size) {}

bool GetByteRangeFromStr(const std::string& content_range_str,
                         int* start,
                         int* end) {}

// If the headers have a byte-range response, writes the start and end
// positions and returns true if at least the start position was parsed.
// The end position will be set to 0 if it was not found or parsed from the
// response.
// Returns false if not even a start position could be parsed.
bool GetByteRangeFromHeaders(const std::string& headers, int* start, int* end) {}

bool IsDoubleEndLineAtEnd(const char* buffer, int size) {}

}  // namespace

URLLoaderWrapperImpl::URLLoaderWrapperImpl(
    std::unique_ptr<UrlLoader> url_loader)
    :{}

URLLoaderWrapperImpl::~URLLoaderWrapperImpl() {}

int URLLoaderWrapperImpl::GetContentLength() const {}

bool URLLoaderWrapperImpl::IsAcceptRangesBytes() const {}

bool URLLoaderWrapperImpl::IsContentEncoded() const {}

std::string URLLoaderWrapperImpl::GetContentType() const {}
std::string URLLoaderWrapperImpl::GetContentDisposition() const {}

int URLLoaderWrapperImpl::GetStatusCode() const {}

bool URLLoaderWrapperImpl::IsMultipart() const {}

bool URLLoaderWrapperImpl::GetByteRangeStart(int* start) const {}

void URLLoaderWrapperImpl::Close() {}

void URLLoaderWrapperImpl::OpenRange(const std::string& url,
                                     const std::string& referrer_url,
                                     uint32_t position,
                                     uint32_t size,
                                     base::OnceCallback<void(int)> callback) {}

void URLLoaderWrapperImpl::ReadResponseBody(
    base::span<char> buffer,
    base::OnceCallback<void(int)> callback) {}

void URLLoaderWrapperImpl::ReadResponseBodyImpl(
    base::OnceCallback<void(int)> callback) {}

void URLLoaderWrapperImpl::ParseHeaders(const std::string& response_headers) {}

void URLLoaderWrapperImpl::DidOpen(base::OnceCallback<void(int)> callback,
                                   int32_t result) {}

void URLLoaderWrapperImpl::DidRead(base::OnceCallback<void(int)> callback,
                                   int32_t result) {}

void URLLoaderWrapperImpl::SetHeadersFromLoader() {}

}  // namespace chrome_pdf