chromium/net/test/url_request/url_request_mock_data_job.cc

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

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

#include "net/test/url_request/url_request_mock_data_job.h"

#include <memory>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/io_buffer.h"
#include "net/base/url_util.h"
#include "net/cert/x509_certificate.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_private_key.h"
#include "net/url_request/url_request_filter.h"

namespace net {
namespace {

const char kMockHostname[] =;

// Gets the data from URL of the form:
// scheme://kMockHostname/?data=abc&repeat_count=nnn.
std::string GetDataFromRequest(const URLRequest& request) {}

// Gets the numeric repeat count from URL of the form:
// scheme://kMockHostname/?data=abc&repeat_count=nnn.
int GetRepeatCountFromRequest(const URLRequest& request) {}

// Gets the requestcert flag from URL.
bool GetRequestClientCertificate(const URLRequest& request) {}

GURL GetMockUrl(const std::string& scheme,
                const std::string& hostname,
                const std::string& data,
                int data_repeat_count,
                bool request_client_certificate) {}

class MockJobInterceptor : public URLRequestInterceptor {};

}  // namespace

URLRequestMockDataJob::URLRequestMockDataJob(URLRequest* request,
                                             const std::string& data,
                                             int data_repeat_count,
                                             bool request_client_certificate)
    :{}

URLRequestMockDataJob::~URLRequestMockDataJob() = default;

void URLRequestMockDataJob::OverrideResponseHeaders(
    const std::string& headers) {}

void URLRequestMockDataJob::Start() {}

int URLRequestMockDataJob::ReadRawData(IOBuffer* buf, int buf_size) {}

void URLRequestMockDataJob::ContinueWithCertificate(
    scoped_refptr<X509Certificate> client_cert,
    scoped_refptr<SSLPrivateKey> client_private_key) {}

// Public virtual version.
void URLRequestMockDataJob::GetResponseInfo(HttpResponseInfo* info) {}

// Private const version.
void URLRequestMockDataJob::GetResponseInfoConst(HttpResponseInfo* info) const {}

void URLRequestMockDataJob::StartAsync() {}

// static
void URLRequestMockDataJob::AddUrlHandler() {}

// static
void URLRequestMockDataJob::AddUrlHandlerForHostname(
    const std::string& hostname) {}

// static
GURL URLRequestMockDataJob::GetMockHttpUrl(const std::string& data,
                                           int repeat_count) {}

// static
GURL URLRequestMockDataJob::GetMockHttpsUrl(const std::string& data,
                                            int repeat_count) {}

GURL URLRequestMockDataJob::GetMockUrlForClientCertificateRequest() {}

// static
GURL URLRequestMockDataJob::GetMockHttpUrlForHostname(
    const std::string& hostname,
    const std::string& data,
    int repeat_count) {}

// static
GURL URLRequestMockDataJob::GetMockHttpsUrlForHostname(
    const std::string& hostname,
    const std::string& data,
    int repeat_count) {}

}  // namespace net