#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/grpc_support/bidirectional_stream.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/http_user_agent_settings.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/request_priority.h"
#include "net/http/bidirectional_stream.h"
#include "net/http/bidirectional_stream_request_info.h"
#include "net/http/http_network_session.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
#include "net/http/http_transaction_factory.h"
#include "net/http/http_util.h"
#include "net/ssl/ssl_info.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "url/gurl.h"
namespace grpc_support {
BidirectionalStream::WriteBuffers::WriteBuffers() { … }
BidirectionalStream::WriteBuffers::~WriteBuffers() { … }
void BidirectionalStream::WriteBuffers::Clear() { … }
void BidirectionalStream::WriteBuffers::AppendBuffer(
const scoped_refptr<net::IOBuffer>& buffer,
int buffer_size) { … }
void BidirectionalStream::WriteBuffers::MoveTo(WriteBuffers* target) { … }
bool BidirectionalStream::WriteBuffers::Empty() const { … }
BidirectionalStream::BidirectionalStream(
net::URLRequestContextGetter* request_context_getter,
Delegate* delegate)
: … { … }
BidirectionalStream::~BidirectionalStream() { … }
int BidirectionalStream::Start(const char* url,
int priority,
const char* method,
const net::HttpRequestHeaders& headers,
bool end_of_stream) { … }
bool BidirectionalStream::ReadData(char* buffer, int capacity) { … }
bool BidirectionalStream::WriteData(const char* buffer,
int count,
bool end_of_stream) { … }
void BidirectionalStream::Flush() { … }
void BidirectionalStream::Cancel() { … }
void BidirectionalStream::Destroy() { … }
void BidirectionalStream::OnStreamReady(bool request_headers_sent) { … }
void BidirectionalStream::OnHeadersReceived(
const quiche::HttpHeaderBlock& response_headers) { … }
void BidirectionalStream::OnDataRead(int bytes_read) { … }
void BidirectionalStream::OnDataSent() { … }
void BidirectionalStream::OnTrailersReceived(
const quiche::HttpHeaderBlock& response_trailers) { … }
void BidirectionalStream::OnFailed(int error) { … }
void BidirectionalStream::StartOnNetworkThread(
std::unique_ptr<net::BidirectionalStreamRequestInfo> request_info) { … }
void BidirectionalStream::ReadDataOnNetworkThread(
scoped_refptr<net::WrappedIOBuffer> read_buffer,
int buffer_size) { … }
void BidirectionalStream::WriteDataOnNetworkThread(
scoped_refptr<net::WrappedIOBuffer> write_buffer,
int buffer_size,
bool end_of_stream) { … }
void BidirectionalStream::FlushOnNetworkThread() { … }
void BidirectionalStream::SendFlushingWriteData() { … }
void BidirectionalStream::CancelOnNetworkThread() { … }
void BidirectionalStream::DestroyOnNetworkThread() { … }
void BidirectionalStream::MaybeOnSucceded() { … }
bool BidirectionalStream::IsOnNetworkThread() { … }
void BidirectionalStream::PostToNetworkThread(const base::Location& from_here,
base::OnceClosure task) { … }
}