#include "net/websockets/websocket_deflate_stream.h"
#include <stdint.h>
#include <algorithm>
#include <ostream>
#include <string>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/websockets/websocket_deflate_parameters.h"
#include "net/websockets/websocket_deflate_predictor.h"
#include "net/websockets/websocket_deflater.h"
#include "net/websockets/websocket_frame.h"
#include "net/websockets/websocket_inflater.h"
#include "net/websockets/websocket_stream.h"
namespace net {
class NetLogWithSource;
namespace {
constexpr int kWindowBits = …;
constexpr size_t kChunkSize = …;
}
WebSocketDeflateStream::WebSocketDeflateStream(
std::unique_ptr<WebSocketStream> stream,
const WebSocketDeflateParameters& params,
std::unique_ptr<WebSocketDeflatePredictor> predictor)
: … { … }
WebSocketDeflateStream::~WebSocketDeflateStream() = default;
int WebSocketDeflateStream::ReadFrames(
std::vector<std::unique_ptr<WebSocketFrame>>* frames,
CompletionOnceCallback callback) { … }
int WebSocketDeflateStream::WriteFrames(
std::vector<std::unique_ptr<WebSocketFrame>>* frames,
CompletionOnceCallback callback) { … }
void WebSocketDeflateStream::Close() { … }
std::string WebSocketDeflateStream::GetSubProtocol() const { … }
std::string WebSocketDeflateStream::GetExtensions() const { … }
const NetLogWithSource& WebSocketDeflateStream::GetNetLogWithSource() const { … }
void WebSocketDeflateStream::OnReadComplete(
std::vector<std::unique_ptr<WebSocketFrame>>* frames,
int result) { … }
int WebSocketDeflateStream::Deflate(
std::vector<std::unique_ptr<WebSocketFrame>>* frames) { … }
void WebSocketDeflateStream::OnMessageStart(
const std::vector<std::unique_ptr<WebSocketFrame>>& frames,
size_t index) { … }
int WebSocketDeflateStream::AppendCompressedFrame(
const WebSocketFrameHeader& header,
std::vector<std::unique_ptr<WebSocketFrame>>* frames_to_write) { … }
int WebSocketDeflateStream::AppendPossiblyCompressedMessage(
std::vector<std::unique_ptr<WebSocketFrame>>* frames,
std::vector<std::unique_ptr<WebSocketFrame>>* frames_to_write) { … }
int WebSocketDeflateStream::Inflate(
std::vector<std::unique_ptr<WebSocketFrame>>* frames) { … }
int WebSocketDeflateStream::InflateAndReadIfNecessary(
std::vector<std::unique_ptr<WebSocketFrame>>* frames) { … }
}