Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: net/spdy/spdy_frame_builder.h

Issue 2753043002: Create new versions of SerializeXXX() functions that uses pre-allocated buffer in SpdyFrameBuilder. (Closed)
Patch Set: git cl format Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698