Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 15 | 15 |
| 16 extern "C" struct z_stream_s; | 16 extern "C" struct z_stream_s; |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 class IOBufferWithSize; | 20 class IOBufferWithSize; |
| 21 | 21 |
| 22 class NET_EXPORT_PRIVATE WebSocketDeflater { | 22 class NET_EXPORT_PRIVATE WebSocketDeflater { |
| 23 public: | 23 public: |
| 24 enum ContextTakeOverMode { | 24 enum ContextTakeOverMode { |
|
Alexei Svitkine (slow)
2014/04/23 13:23:18
Nit: Add a comment mentioning not to re-order or r
tyoshino (SeeGerritForStatus)
2014/04/24 10:38:15
Done.
| |
| 25 DO_NOT_TAKE_OVER_CONTEXT, | 25 DO_NOT_TAKE_OVER_CONTEXT, |
| 26 TAKE_OVER_CONTEXT, | 26 TAKE_OVER_CONTEXT, |
| 27 NUM_CONTEXT_TAKEOVER_MODE_TYPES, | |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 explicit WebSocketDeflater(ContextTakeOverMode mode); | 30 explicit WebSocketDeflater(ContextTakeOverMode mode); |
| 30 ~WebSocketDeflater(); | 31 ~WebSocketDeflater(); |
| 31 | 32 |
| 32 // Returns true if there is no error and false otherwise. | 33 // Returns true if there is no error and false otherwise. |
| 33 // This function must be called exactly once before calling any of | 34 // This function must be called exactly once before calling any of |
| 34 // following methods. | 35 // following methods. |
| 35 // |window_bits| must be between 8 and 15 (both inclusive). | 36 // |window_bits| must be between 8 and 15 (both inclusive). |
| 36 bool Initialize(int window_bits); | 37 bool Initialize(int window_bits); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 66 std::vector<char> fixed_buffer_; | 67 std::vector<char> fixed_buffer_; |
| 67 // true if bytes were added after last Finish(). | 68 // true if bytes were added after last Finish(). |
| 68 bool are_bytes_added_; | 69 bool are_bytes_added_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(WebSocketDeflater); | 71 DISALLOW_COPY_AND_ASSIGN(WebSocketDeflater); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 } // namespace net | 74 } // namespace net |
| 74 | 75 |
| 75 #endif // NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ | 76 #endif // NET_WEBSOCKETS_WEBSOCKET_DEFLATER_H_ |
| OLD | NEW |