OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SPDY_SPDY_FRAME_BUILDER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_ |
6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_ | 6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // A buffer to be created whenever a new frame needs to be written. Used only | 131 // A buffer to be created whenever a new frame needs to be written. Used only |
132 // if |output_| is nullptr. | 132 // if |output_| is nullptr. |
133 std::unique_ptr<char[]> buffer_; | 133 std::unique_ptr<char[]> buffer_; |
134 // A pre-allocated buffer. If not-null, serialized frame data is written to | 134 // A pre-allocated buffer. If not-null, serialized frame data is written to |
135 // this buffer. | 135 // this buffer. |
136 ZeroCopyOutputBuffer* output_ = nullptr; // Does not own. | 136 ZeroCopyOutputBuffer* output_ = nullptr; // Does not own. |
137 | 137 |
138 size_t capacity_; // Allocation size of payload, set by constructor. | 138 size_t capacity_; // Allocation size of payload, set by constructor. |
139 size_t length_; // Length of the latest frame in the buffer. | 139 size_t length_; // Length of the latest frame in the buffer. |
140 size_t offset_; // Position at which the latest frame begins. | 140 size_t offset_; // Position at which the latest frame begins. |
| 141 |
| 142 // Remove all four below after |
| 143 // FLAGS_chromium_http2_flag_remove_rewritelength deprecates. |
| 144 const size_t kLengthFieldLength = 3; |
| 145 char* start_of_current_frame_ = nullptr; |
| 146 size_t bytes_of_length_written_in_first_block_ = kLengthFieldLength; |
| 147 // In case length of a new frame is cross blocks. |
| 148 char* start_of_current_frame_in_next_block_ = nullptr; |
141 }; | 149 }; |
142 | 150 |
143 } // namespace net | 151 } // namespace net |
144 | 152 |
145 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ | 153 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
OLD | NEW |