| 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/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/sys_byteorder.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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 private: | 158 private: |
| 159 char* buffer_; | 159 char* buffer_; |
| 160 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). | 160 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). |
| 161 size_t length_; // current length of the buffer | 161 size_t length_; // current length of the buffer |
| 162 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. | 162 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace spdy | 165 } // namespace spdy |
| 166 | 166 |
| 167 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ | 167 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
| OLD | NEW |