#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/test/url_request/url_request_failed_job.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_interceptor.h"
namespace net {
namespace {
const char kMockHostname[] = …;
const char* kFailurePhase[]{ … };
static_assert …;
class MockJobInterceptor : public URLRequestInterceptor { … };
GURL GetMockUrl(const std::string& scheme,
const std::string& hostname,
URLRequestFailedJob::FailurePhase phase,
int net_error) { … }
}
URLRequestFailedJob::URLRequestFailedJob(URLRequest* request,
FailurePhase phase,
int net_error)
: … { … }
URLRequestFailedJob::URLRequestFailedJob(URLRequest* request, int net_error)
: … { … }
URLRequestFailedJob::~URLRequestFailedJob() = default;
void URLRequestFailedJob::Start() { … }
int URLRequestFailedJob::ReadRawData(IOBuffer* buf, int buf_size) { … }
void URLRequestFailedJob::GetResponseInfo(HttpResponseInfo* info) { … }
void URLRequestFailedJob::PopulateNetErrorDetails(
NetErrorDetails* details) const { … }
int64_t URLRequestFailedJob::GetTotalReceivedBytes() const { … }
void URLRequestFailedJob::AddUrlHandler() { … }
void URLRequestFailedJob::AddUrlHandlerForHostname(
const std::string& hostname) { … }
GURL URLRequestFailedJob::GetMockHttpUrl(int net_error) { … }
GURL URLRequestFailedJob::GetMockHttpsUrl(int net_error) { … }
GURL URLRequestFailedJob::GetMockHttpUrlWithFailurePhase(FailurePhase phase,
int net_error) { … }
GURL URLRequestFailedJob::GetMockHttpUrlForHostname(
int net_error,
const std::string& hostname) { … }
GURL URLRequestFailedJob::GetMockHttpsUrlForHostname(
int net_error,
const std::string& hostname) { … }
void URLRequestFailedJob::StartAsync() { … }
}