| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // capacity_. The given type must be a control frame type. | 52 // capacity_. The given type must be a control frame type. |
| 53 // Used only for SPDY versions <4. | 53 // Used only for SPDY versions <4. |
| 54 bool WriteControlFrameHeader(const SpdyFramer& framer, | 54 bool WriteControlFrameHeader(const SpdyFramer& framer, |
| 55 SpdyFrameType type, | 55 SpdyFrameType type, |
| 56 uint8 flags); | 56 uint8 flags); |
| 57 | 57 |
| 58 // Populates this frame with a SPDY data frame header using version-specific | 58 // Populates this frame with a SPDY data frame header using version-specific |
| 59 // information from the |framer| and length information from capacity_. | 59 // information from the |framer| and length information from capacity_. |
| 60 bool WriteDataFrameHeader(const SpdyFramer& framer, | 60 bool WriteDataFrameHeader(const SpdyFramer& framer, |
| 61 SpdyStreamId stream_id, | 61 SpdyStreamId stream_id, |
| 62 SpdyDataFlags flags); | 62 uint8 flags); |
| 63 | 63 |
| 64 // Populates this frame with a SPDY4/HTTP2 frame prefix using | 64 // Populates this frame with a SPDY4/HTTP2 frame prefix using |
| 65 // version-specific information from the |framer| and length information from | 65 // version-specific information from the |framer| and length information from |
| 66 // capacity_. The given type must be a control frame type. | 66 // capacity_. The given type must be a control frame type. |
| 67 // Used only for SPDY versions >=4. | 67 // Used only for SPDY versions >=4. |
| 68 bool WriteFramePrefix(const SpdyFramer& framer, | 68 bool WriteFramePrefix(const SpdyFramer& framer, |
| 69 SpdyFrameType type, | 69 SpdyFrameType type, |
| 70 uint8 flags, | 70 uint8 flags, |
| 71 SpdyStreamId stream_id); | 71 SpdyStreamId stream_id); |
| 72 | 72 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool CanWrite(size_t length) const; | 123 bool CanWrite(size_t length) const; |
| 124 | 124 |
| 125 scoped_ptr<char[]> buffer_; | 125 scoped_ptr<char[]> buffer_; |
| 126 size_t capacity_; // Allocation size of payload, set by constructor. | 126 size_t capacity_; // Allocation size of payload, set by constructor. |
| 127 size_t length_; // Current length of the buffer. | 127 size_t length_; // Current length of the buffer. |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace net | 130 } // namespace net |
| 131 | 131 |
| 132 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ | 132 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ |
| OLD | NEW |