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

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

Issue 6314010: Even more reordering the methods in headers and implementation in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/tcp_client_socket_pool.cc ('k') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 7 #pragma once
8 8
9 #ifdef WIN32 9 #ifdef WIN32
10 #include <winsock2.h> // for htonl() functions 10 #include <winsock2.h> // for htonl() functions
(...skipping 15 matching lines...) Expand all
26 // to a frame instance. The SpdyFrameBuilder grows its internal memory buffer 26 // to a frame instance. The SpdyFrameBuilder grows its internal memory buffer
27 // dynamically to hold the sequence of primitive values. The internal memory 27 // dynamically to hold the sequence of primitive values. The internal memory
28 // buffer is exposed as the "data" of the SpdyFrameBuilder. 28 // buffer is exposed as the "data" of the SpdyFrameBuilder.
29 // 29 //
30 // When reading from a SpdyFrameBuilder the consumer must know what value types 30 // When reading from a SpdyFrameBuilder the consumer must know what value types
31 // to read and in what order to read them as the SpdyFrameBuilder does not keep 31 // to read and in what order to read them as the SpdyFrameBuilder does not keep
32 // track of the type of data written to it. 32 // track of the type of data written to it.
33 class SpdyFrameBuilder { 33 class SpdyFrameBuilder {
34 public: 34 public:
35 SpdyFrameBuilder(); 35 SpdyFrameBuilder();
36 ~SpdyFrameBuilder();
37 36
38 // Initializes a SpdyFrameBuilder from a const block of data. The data is 37 // Initializes a SpdyFrameBuilder from a const block of data. The data is
39 // not copied; instead the data is merely referenced by this 38 // not copied; instead the data is merely referenced by this
40 // SpdyFrameBuilder. Only const methods should be used when initialized 39 // SpdyFrameBuilder. Only const methods should be used when initialized
41 // this way. 40 // this way.
42 SpdyFrameBuilder(const char* data, int data_len); 41 SpdyFrameBuilder(const char* data, int data_len);
43 42
43 ~SpdyFrameBuilder();
44
44 // Returns the size of the SpdyFrameBuilder's data. 45 // Returns the size of the SpdyFrameBuilder's data.
45 int length() const { return length_; } 46 int length() const { return length_; }
46 47
47 // Takes the buffer from the SpdyFrameBuilder. 48 // Takes the buffer from the SpdyFrameBuilder.
48 SpdyFrame* take() { 49 SpdyFrame* take() {
49 SpdyFrame* rv = new SpdyFrame(buffer_, true); 50 SpdyFrame* rv = new SpdyFrame(buffer_, true);
50 buffer_ = NULL; 51 buffer_ = NULL;
51 capacity_ = 0; 52 capacity_ = 0;
52 length_ = 0; 53 length_ = 0;
53 return rv; 54 return rv;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 private: 155 private:
155 char* buffer_; 156 char* buffer_;
156 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). 157 size_t capacity_; // Allocation size of payload (or -1 if buffer is const).
157 size_t length_; // current length of the buffer 158 size_t length_; // current length of the buffer
158 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. 159 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer.
159 }; 160 };
160 161
161 } // namespace spdy 162 } // namespace spdy
162 163
163 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ 164 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_pool.cc ('k') | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698