| 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_BUFFERED_SPDY_FRAMER_H_ | 5 #ifndef NET_SPDY_BUFFERED_SPDY_FRAMER_H_ |
| 6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_ | 6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Returns the SPDY major version corresponding to the given NextProto | 23 // Returns the SPDY major version corresponding to the given NextProto |
| 24 // value, which must represent a SPDY-like protocol. | 24 // value, which must represent a SPDY-like protocol. |
| 25 NET_EXPORT_PRIVATE SpdyMajorVersion NextProtoToSpdyMajorVersion( | 25 NET_EXPORT_PRIVATE SpdyMajorVersion NextProtoToSpdyMajorVersion( |
| 26 NextProto next_proto); | 26 NextProto next_proto); |
| 27 | 27 |
| 28 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { | 28 class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface { |
| 29 public: | 29 public: |
| 30 BufferedSpdyFramerVisitorInterface() {} | 30 BufferedSpdyFramerVisitorInterface() {} |
| 31 | 31 |
| 32 // Called if an error is detected in the SpdyFrame protocol. | 32 // Called if an error is detected in the SpdySerializedFrame protocol. |
| 33 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; | 33 virtual void OnError(SpdyFramer::SpdyError error_code) = 0; |
| 34 | 34 |
| 35 // Called if an error is detected in a SPDY stream. | 35 // Called if an error is detected in a SPDY stream. |
| 36 virtual void OnStreamError(SpdyStreamId stream_id, | 36 virtual void OnStreamError(SpdyStreamId stream_id, |
| 37 const std::string& description) = 0; | 37 const std::string& description) = 0; |
| 38 | 38 |
| 39 // Called after all the header data for SYN_STREAM control frame is received. | 39 // Called after all the header data for SYN_STREAM control frame is received. |
| 40 virtual void OnSynStream(SpdyStreamId stream_id, | 40 virtual void OnSynStream(SpdyStreamId stream_id, |
| 41 SpdyStreamId associated_stream_id, | 41 SpdyStreamId associated_stream_id, |
| 42 SpdyPriority priority, | 42 SpdyPriority priority, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; | 206 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; |
| 207 | 207 |
| 208 // SpdyFramer methods. | 208 // SpdyFramer methods. |
| 209 size_t ProcessInput(const char* data, size_t len); | 209 size_t ProcessInput(const char* data, size_t len); |
| 210 SpdyMajorVersion protocol_version(); | 210 SpdyMajorVersion protocol_version(); |
| 211 void Reset(); | 211 void Reset(); |
| 212 SpdyFramer::SpdyError error_code() const; | 212 SpdyFramer::SpdyError error_code() const; |
| 213 SpdyFramer::SpdyState state() const; | 213 SpdyFramer::SpdyState state() const; |
| 214 bool MessageFullyRead(); | 214 bool MessageFullyRead(); |
| 215 bool HasError(); | 215 bool HasError(); |
| 216 SpdyFrame* CreateSynStream(SpdyStreamId stream_id, | 216 SpdySerializedFrame* CreateSynStream(SpdyStreamId stream_id, |
| 217 SpdyStreamId associated_stream_id, | 217 SpdyStreamId associated_stream_id, |
| 218 SpdyPriority priority, | 218 SpdyPriority priority, |
| 219 SpdyControlFlags flags, | 219 SpdyControlFlags flags, |
| 220 const SpdyHeaderBlock* headers); | 220 const SpdyHeaderBlock* headers); |
| 221 SpdyFrame* CreateSynReply(SpdyStreamId stream_id, | 221 SpdySerializedFrame* CreateSynReply(SpdyStreamId stream_id, |
| 222 SpdyControlFlags flags, | 222 SpdyControlFlags flags, |
| 223 const SpdyHeaderBlock* headers); | 223 const SpdyHeaderBlock* headers); |
| 224 SpdyFrame* CreateRstStream(SpdyStreamId stream_id, | 224 SpdySerializedFrame* CreateRstStream(SpdyStreamId stream_id, |
| 225 SpdyRstStreamStatus status) const; | 225 SpdyRstStreamStatus status) const; |
| 226 SpdyFrame* CreateSettings(const SettingsMap& values) const; | 226 SpdySerializedFrame* CreateSettings(const SettingsMap& values) const; |
| 227 SpdyFrame* CreatePingFrame(SpdyPingId unique_id, bool is_ack) const; | 227 SpdySerializedFrame* CreatePingFrame(SpdyPingId unique_id, bool is_ack) const; |
| 228 SpdyFrame* CreateGoAway(SpdyStreamId last_accepted_stream_id, | 228 SpdySerializedFrame* CreateGoAway(SpdyStreamId last_accepted_stream_id, |
| 229 SpdyGoAwayStatus status, | 229 SpdyGoAwayStatus status, |
| 230 base::StringPiece debug_data) const; | 230 base::StringPiece debug_data) const; |
| 231 SpdyFrame* CreateHeaders(SpdyStreamId stream_id, | 231 SpdySerializedFrame* CreateHeaders(SpdyStreamId stream_id, |
| 232 SpdyControlFlags flags, | 232 SpdyControlFlags flags, |
| 233 SpdyPriority priority, | 233 SpdyPriority priority, |
| 234 const SpdyHeaderBlock* headers); | 234 const SpdyHeaderBlock* headers); |
| 235 SpdyFrame* CreateWindowUpdate(SpdyStreamId stream_id, | 235 SpdySerializedFrame* CreateWindowUpdate(SpdyStreamId stream_id, |
| 236 uint32_t delta_window_size) const; | 236 uint32_t delta_window_size) const; |
| 237 SpdyFrame* CreateDataFrame(SpdyStreamId stream_id, | 237 SpdySerializedFrame* CreateDataFrame(SpdyStreamId stream_id, |
| 238 const char* data, | 238 const char* data, |
| 239 uint32_t len, | 239 uint32_t len, |
| 240 SpdyDataFlags flags); | 240 SpdyDataFlags flags); |
| 241 SpdyFrame* CreatePushPromise(SpdyStreamId stream_id, | 241 SpdySerializedFrame* CreatePushPromise(SpdyStreamId stream_id, |
| 242 SpdyStreamId promised_stream_id, | 242 SpdyStreamId promised_stream_id, |
| 243 const SpdyHeaderBlock* headers); | 243 const SpdyHeaderBlock* headers); |
| 244 | 244 |
| 245 // Serialize a frame of unknown type. | 245 // Serialize a frame of unknown type. |
| 246 SpdySerializedFrame* SerializeFrame(const SpdyFrameIR& frame) { | 246 SpdySerializedFrame SerializeFrame(const SpdyFrameIR& frame) { |
| 247 return spdy_framer_.SerializeFrame(frame); | 247 return spdy_framer_.SerializeFrame(frame); |
| 248 } | 248 } |
| 249 | 249 |
| 250 SpdyPriority GetHighestPriority() const; | 250 SpdyPriority GetHighestPriority() const; |
| 251 | 251 |
| 252 size_t GetDataFrameMinimumSize() const { | 252 size_t GetDataFrameMinimumSize() const { |
| 253 return spdy_framer_.GetDataFrameMinimumSize(); | 253 return spdy_framer_.GetDataFrameMinimumSize(); |
| 254 } | 254 } |
| 255 | 255 |
| 256 size_t GetControlFrameHeaderSize() const { | 256 size_t GetControlFrameHeaderSize() const { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 std::string debug_data; | 310 std::string debug_data; |
| 311 }; | 311 }; |
| 312 scoped_ptr<GoAwayFields> goaway_fields_; | 312 scoped_ptr<GoAwayFields> goaway_fields_; |
| 313 | 313 |
| 314 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); | 314 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); |
| 315 }; | 315 }; |
| 316 | 316 |
| 317 } // namespace net | 317 } // namespace net |
| 318 | 318 |
| 319 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ | 319 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ |
| OLD | NEW |