Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/sys_byteorder.h" | |
|
eroman
2011/12/28 00:50:20
nit: order lexicographically.
Ilya Sherman
2011/12/28 01:20:02
Done.
| |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 13 #include "net/base/sys_byteorder.h" | |
| 14 #include "net/spdy/spdy_protocol.h" | 14 #include "net/spdy/spdy_protocol.h" |
| 15 | 15 |
| 16 namespace spdy { | 16 namespace spdy { |
| 17 | 17 |
| 18 // This class provides facilities for basic binary value packing and unpacking | 18 // This class provides facilities for basic binary value packing and unpacking |
| 19 // into Spdy frames. | 19 // into Spdy frames. |
| 20 // | 20 // |
| 21 // The SpdyFrameBuilder supports appending primitive values (int, string, etc) | 21 // The SpdyFrameBuilder supports appending primitive values (int, string, etc) |
| 22 // to a frame instance. The SpdyFrameBuilder grows its internal memory buffer | 22 // to a frame instance. The SpdyFrameBuilder grows its internal memory buffer |
| 23 // dynamically to hold the sequence of primitive values. The internal memory | 23 // dynamically to hold the sequence of primitive values. The internal memory |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 private: | 155 private: |
| 156 char* buffer_; | 156 char* buffer_; |
| 157 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). |
| 158 size_t length_; // current length of the buffer | 158 size_t length_; // current length of the buffer |
| 159 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. |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 } // namespace spdy | 162 } // namespace spdy |
| 163 | 163 |
| 164 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ | 164 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
| OLD | NEW |