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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // dynamically to hold the sequence of primitive values. The internal memory | 24 // dynamically to hold the sequence of primitive values. The internal memory |
25 // buffer is exposed as the "data" of the SpdyFrameBuilder. | 25 // buffer is exposed as the "data" of the SpdyFrameBuilder. |
26 class NET_EXPORT_PRIVATE SpdyFrameBuilder { | 26 class NET_EXPORT_PRIVATE SpdyFrameBuilder { |
27 public: | 27 public: |
28 // Initializes a SpdyFrameBuilder with a buffer of given size | 28 // Initializes a SpdyFrameBuilder with a buffer of given size |
29 explicit SpdyFrameBuilder(size_t size); | 29 explicit SpdyFrameBuilder(size_t size); |
30 | 30 |
31 // Initializes a SpdyFrameBuilder with a buffer of given size, | 31 // Initializes a SpdyFrameBuilder with a buffer of given size, |
32 // populate with a SPDY control frame header based on | 32 // populate with a SPDY control frame header based on |
33 // |type|, |flags|, and |spdy_version|. | 33 // |type|, |flags|, and |spdy_version|. |
34 SpdyFrameBuilder(SpdyControlType type, SpdyControlFlags flags, | 34 // |
| 35 // TODO(akalin): Add a typedef for this uint8. |
| 36 SpdyFrameBuilder(SpdyControlType type, uint8 flags, |
35 int spdy_version, size_t size); | 37 int spdy_version, size_t size); |
36 | 38 |
37 // Initiailizes a SpdyFrameBuilder with a buffer of given size, | 39 // Initiailizes a SpdyFrameBuilder with a buffer of given size, |
38 // populated with a SPDY data frame header based on | 40 // populated with a SPDY data frame header based on |
39 // |stream_id| and |flags|. | 41 // |stream_id| and |flags|. |
40 SpdyFrameBuilder(SpdyStreamId stream_id, SpdyDataFlags flags, size_t size); | 42 SpdyFrameBuilder(SpdyStreamId stream_id, SpdyDataFlags flags, size_t size); |
41 | 43 |
42 ~SpdyFrameBuilder(); | 44 ~SpdyFrameBuilder(); |
43 | 45 |
44 // Returns the size of the SpdyFrameBuilder's data. | 46 // Returns the size of the SpdyFrameBuilder's data. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 char* BeginWrite(size_t length); | 103 char* BeginWrite(size_t length); |
102 | 104 |
103 scoped_ptr<char[]> buffer_; | 105 scoped_ptr<char[]> buffer_; |
104 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). | 106 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). |
105 size_t length_; // current length of the buffer | 107 size_t length_; // current length of the buffer |
106 }; | 108 }; |
107 | 109 |
108 } // namespace net | 110 } // namespace net |
109 | 111 |
110 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ | 112 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
OLD | NEW |