#include "net/test/url_request/url_request_test_job_backed_by_file.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/strings/string_util.h"
#include "base/synchronization/lock.h"
#include "base/task/task_runner.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "net/base/file_stream.h"
#include "net/base/filename_util.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/mime_util.h"
#include "net/filter/gzip_source_stream.h"
#include "net/filter/source_stream.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request_error_job.h"
#include "url/gurl.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/shortcut.h"
#endif
namespace net {
URLRequestTestJobBackedByFile::FileMetaInfo::FileMetaInfo() = default;
URLRequestTestJobBackedByFile::URLRequestTestJobBackedByFile(
URLRequest* request,
const base::FilePath& file_path,
const scoped_refptr<base::TaskRunner>& file_task_runner)
: … { … }
void URLRequestTestJobBackedByFile::Start() { … }
void URLRequestTestJobBackedByFile::Kill() { … }
int URLRequestTestJobBackedByFile::ReadRawData(IOBuffer* dest, int dest_size) { … }
bool URLRequestTestJobBackedByFile::GetMimeType(std::string* mime_type) const { … }
void URLRequestTestJobBackedByFile::SetExtraRequestHeaders(
const HttpRequestHeaders& headers) { … }
void URLRequestTestJobBackedByFile::GetResponseInfo(HttpResponseInfo* info) { … }
void URLRequestTestJobBackedByFile::OnOpenComplete(int result) { … }
void URLRequestTestJobBackedByFile::OnSeekComplete(int64_t result) { … }
void URLRequestTestJobBackedByFile::OnReadComplete(IOBuffer* buf, int result) { … }
URLRequestTestJobBackedByFile::~URLRequestTestJobBackedByFile() = default;
std::unique_ptr<SourceStream>
URLRequestTestJobBackedByFile::SetUpSourceStream() { … }
std::unique_ptr<URLRequestTestJobBackedByFile::FileMetaInfo>
URLRequestTestJobBackedByFile::FetchMetaInfo(const base::FilePath& file_path) { … }
void URLRequestTestJobBackedByFile::DidFetchMetaInfo(
std::unique_ptr<FileMetaInfo> meta_info) { … }
void URLRequestTestJobBackedByFile::DidOpen(int result) { … }
void URLRequestTestJobBackedByFile::DidSeek(int64_t result) { … }
void URLRequestTestJobBackedByFile::DidRead(scoped_refptr<IOBuffer> buf,
int result) { … }
}