#include "net/proxy_resolution/pac_file_fetcher_impl.h"
#include <string_view>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/data_url.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/base/net_string_util.h"
#include "net/base/request_priority.h"
#include "net/cert/cert_status_flags.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/url_request_context.h"
namespace net {
namespace {
const int kDefaultMaxResponseBytes = …;
constexpr base::TimeDelta kDefaultMaxDuration = …;
constexpr bool IsPacMimeType(std::string_view mime_type) { … }
struct BomMapping { … };
const BomMapping kBomMappings[] = …;
void ConvertResponseToUTF16(const std::string& charset,
const std::string& bytes,
std::u16string* utf16) { … }
}
std::unique_ptr<PacFileFetcherImpl> PacFileFetcherImpl::Create(
URLRequestContext* url_request_context) { … }
PacFileFetcherImpl::~PacFileFetcherImpl() { … }
base::TimeDelta PacFileFetcherImpl::SetTimeoutConstraint(
base::TimeDelta timeout) { … }
size_t PacFileFetcherImpl::SetSizeConstraint(size_t size_bytes) { … }
void PacFileFetcherImpl::OnResponseCompleted(URLRequest* request,
int net_error) { … }
int PacFileFetcherImpl::Fetch(
const GURL& url,
std::u16string* text,
CompletionOnceCallback callback,
const NetworkTrafficAnnotationTag traffic_annotation) { … }
void PacFileFetcherImpl::Cancel() { … }
URLRequestContext* PacFileFetcherImpl::GetRequestContext() const { … }
void PacFileFetcherImpl::OnShutdown() { … }
void PacFileFetcherImpl::OnReceivedRedirect(URLRequest* request,
const RedirectInfo& redirect_info,
bool* defer_redirect) { … }
void PacFileFetcherImpl::OnAuthRequired(URLRequest* request,
const AuthChallengeInfo& auth_info) { … }
void PacFileFetcherImpl::OnSSLCertificateError(URLRequest* request,
int net_error,
const SSLInfo& ssl_info,
bool fatal) { … }
void PacFileFetcherImpl::OnResponseStarted(URLRequest* request, int net_error) { … }
void PacFileFetcherImpl::OnReadCompleted(URLRequest* request, int num_bytes) { … }
PacFileFetcherImpl::PacFileFetcherImpl(URLRequestContext* url_request_context)
: … { … }
bool PacFileFetcherImpl::IsUrlSchemeAllowed(const GURL& url) const { … }
void PacFileFetcherImpl::ReadBody(URLRequest* request) { … }
bool PacFileFetcherImpl::ConsumeBytesRead(URLRequest* request, int num_bytes) { … }
void PacFileFetcherImpl::FetchCompleted() { … }
void PacFileFetcherImpl::ResetCurRequestState() { … }
void PacFileFetcherImpl::OnTimeout(int id) { … }
}