chromium/net/spdy/spdy_proxy_client_socket.cc

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

#include "net/spdy/spdy_proxy_client_socket.h"

#include <algorithm>  // min
#include <utility>

#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/values.h"
#include "net/base/auth.h"
#include "net/base/io_buffer.h"
#include "net/base/proxy_chain.h"
#include "net/base/proxy_delegate.h"
#include "net/http/http_auth_cache.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_log_util.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source_type.h"
#include "net/spdy/spdy_http_utils.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "url/gurl.h"

namespace net {

SpdyProxyClientSocket::SpdyProxyClientSocket(
    const base::WeakPtr<SpdyStream>& spdy_stream,
    const ProxyChain& proxy_chain,
    size_t proxy_chain_index,
    const std::string& user_agent,
    const HostPortPair& endpoint,
    const NetLogWithSource& source_net_log,
    scoped_refptr<HttpAuthController> auth_controller,
    ProxyDelegate* proxy_delegate)
    :{}

SpdyProxyClientSocket::~SpdyProxyClientSocket() {}

const HttpResponseInfo* SpdyProxyClientSocket::GetConnectResponseInfo() const {}

const scoped_refptr<HttpAuthController>&
SpdyProxyClientSocket::GetAuthController() const {}

int SpdyProxyClientSocket::RestartWithAuth(CompletionOnceCallback callback) {}

// Ignore priority changes, just use priority of initial request. Since multiple
// requests are pooled on the SpdyProxyClientSocket, reprioritization doesn't
// really work.
//
// TODO(mmenke):  Use a single priority value for all SpdyProxyClientSockets,
// regardless of what priority they're created with.
void SpdyProxyClientSocket::SetStreamPriority(RequestPriority priority) {}

// Sends a HEADERS frame to the proxy with a CONNECT request
// for the specified endpoint.  Waits for the server to send back
// a HEADERS frame.  OK will be returned if the status is 200.
// ERR_TUNNEL_CONNECTION_FAILED will be returned for any other status.
// In any of these cases, Read() may be called to retrieve the HTTP
// response body.  Any other return values should be considered fatal.
// TODO(rch): handle 407 proxy auth requested correctly, perhaps
// by creating a new stream for the subsequent request.
// TODO(rch): create a more appropriate error code to disambiguate
// the HTTPS Proxy tunnel failure from an HTTP Proxy tunnel failure.
int SpdyProxyClientSocket::Connect(CompletionOnceCallback callback) {}

void SpdyProxyClientSocket::Disconnect() {}

bool SpdyProxyClientSocket::IsConnected() const {}

bool SpdyProxyClientSocket::IsConnectedAndIdle() const {}

const NetLogWithSource& SpdyProxyClientSocket::NetLog() const {}

bool SpdyProxyClientSocket::WasEverUsed() const {}

NextProto SpdyProxyClientSocket::GetNegotiatedProtocol() const {}

bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) {}

int64_t SpdyProxyClientSocket::GetTotalReceivedBytes() const {}

void SpdyProxyClientSocket::ApplySocketTag(const SocketTag& tag) {}

int SpdyProxyClientSocket::Read(IOBuffer* buf,
                                int buf_len,
                                CompletionOnceCallback callback) {}

int SpdyProxyClientSocket::ReadIfReady(IOBuffer* buf,
                                       int buf_len,
                                       CompletionOnceCallback callback) {}

int SpdyProxyClientSocket::CancelReadIfReady() {}

size_t SpdyProxyClientSocket::PopulateUserReadBuffer(char* data, size_t len) {}

int SpdyProxyClientSocket::Write(
    IOBuffer* buf,
    int buf_len,
    CompletionOnceCallback callback,
    const NetworkTrafficAnnotationTag& traffic_annotation) {}

int SpdyProxyClientSocket::SetReceiveBufferSize(int32_t size) {}

int SpdyProxyClientSocket::SetSendBufferSize(int32_t size) {}

int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const {}

int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const {}

void SpdyProxyClientSocket::RunWriteCallback(int result) {}

void SpdyProxyClientSocket::OnIOComplete(int result) {}

int SpdyProxyClientSocket::DoLoop(int last_io_result) {}

int SpdyProxyClientSocket::DoGenerateAuthToken() {}

int SpdyProxyClientSocket::DoGenerateAuthTokenComplete(int result) {}

int SpdyProxyClientSocket::DoSendRequest() {}

int SpdyProxyClientSocket::DoSendRequestComplete(int result) {}

int SpdyProxyClientSocket::DoReadReplyComplete(int result) {}

// SpdyStream::Delegate methods:
// Called when SYN frame has been sent.
// Returns true if no more data to be sent after SYN frame.
void SpdyProxyClientSocket::OnHeadersSent() {}

void SpdyProxyClientSocket::OnEarlyHintsReceived(
    const quiche::HttpHeaderBlock& headers) {}

void SpdyProxyClientSocket::OnHeadersReceived(
    const quiche::HttpHeaderBlock& response_headers) {}

// Called when data is received or on EOF (if `buffer is nullptr).
void SpdyProxyClientSocket::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {}

void SpdyProxyClientSocket::OnDataSent() {}

void SpdyProxyClientSocket::OnTrailers(
    const quiche::HttpHeaderBlock& trailers) {}

void SpdyProxyClientSocket::OnClose(int status)  {}

bool SpdyProxyClientSocket::CanGreaseFrameType() const {}

NetLogSource SpdyProxyClientSocket::source_dependency() const {}

void SpdyProxyClientSocket::MaybeSendEndStream() {}

}  // namespace net