| OLD | NEW |
| 1 // Copyright (c) 2009 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_FRAME_BUILDER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_ |
| 6 #define NET_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 |
| 11 #else | 11 #else |
| 12 #include <arpa/inet.h> | 12 #include <arpa/inet.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/logging.h" | 17 #include "base/basictypes.h" |
| 18 #include "net/spdy/spdy_protocol.h" | 18 #include "net/spdy/spdy_protocol.h" |
| 19 | 19 |
| 20 namespace spdy { | 20 namespace spdy { |
| 21 | 21 |
| 22 // This class provides facilities for basic binary value packing and unpacking | 22 // This class provides facilities for basic binary value packing and unpacking |
| 23 // into Spdy frames. | 23 // into Spdy frames. |
| 24 // | 24 // |
| 25 // The SpdyFrameBuilder supports appending primitive values (int, string, etc) | 25 // The SpdyFrameBuilder supports appending primitive values (int, string, etc) |
| 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 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 char* buffer_; | 155 char* buffer_; |
| 156 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). | 156 size_t capacity_; // Allocation size of payload (or -1 if buffer is const). |
| 157 size_t length_; // current length of the buffer | 157 size_t length_; // current length of the buffer |
| 158 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. | 158 size_t variable_buffer_offset_; // IF non-zero, then offset to a buffer. |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace spdy | 161 } // namespace spdy |
| 162 | 162 |
| 163 #endif // NET_SPDY_FRAME_BUILDER_H_ | 163 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
| 164 | |
| OLD | NEW |