xref: /aosp_15_r20/external/cronet/net/websockets/websocket_deflate_predictor_impl.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2013 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PREDICTOR_IMPL_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PREDICTOR_IMPL_H_
7 
8 #include <stddef.h>
9 
10 #include <memory>
11 #include <vector>
12 
13 #include "net/base/net_export.h"
14 #include "net/websockets/websocket_deflate_predictor.h"
15 
16 namespace net {
17 
18 struct WebSocketFrame;
19 
20 class NET_EXPORT_PRIVATE WebSocketDeflatePredictorImpl
21     : public WebSocketDeflatePredictor {
22  public:
23   ~WebSocketDeflatePredictorImpl() override = default;
24 
25   Result Predict(const std::vector<std::unique_ptr<WebSocketFrame>>& frames,
26                  size_t frame_index) override;
27   void RecordInputDataFrame(const WebSocketFrame* frame) override;
28   void RecordWrittenDataFrame(const WebSocketFrame* frame) override;
29 };
30 
31 }  // namespace net
32 
33 #endif  // NET_WEBSOCKETS_WEBSOCKET_DEFLATE_PREDICTOR_IMPL_H_
34