| 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_FRAMER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAMER_H_ |
| 6 #define NET_SPDY_SPDY_FRAMER_H_ | 6 #define NET_SPDY_SPDY_FRAMER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // OnControlFrameHeaderData(). | 277 // OnControlFrameHeaderData(). |
| 278 virtual void OnContinuation(SpdyStreamId stream_id, bool end) = 0; | 278 virtual void OnContinuation(SpdyStreamId stream_id, bool end) = 0; |
| 279 | 279 |
| 280 // Called when an ALTSVC frame has been parsed. | 280 // Called when an ALTSVC frame has been parsed. |
| 281 virtual void OnAltSvc(SpdyStreamId stream_id, | 281 virtual void OnAltSvc(SpdyStreamId stream_id, |
| 282 uint32 max_age, | 282 uint32 max_age, |
| 283 uint16 port, | 283 uint16 port, |
| 284 base::StringPiece protocol_id, | 284 base::StringPiece protocol_id, |
| 285 base::StringPiece host, | 285 base::StringPiece host, |
| 286 base::StringPiece origin) {} | 286 base::StringPiece origin) {} |
| 287 |
| 288 // Called when a PRIORITY frame is received. |
| 289 virtual void OnPriority(SpdyStreamId stream_id, |
| 290 SpdyStreamId parent_stream_id, |
| 291 uint8 weight, |
| 292 bool exclusive) {}; |
| 287 }; | 293 }; |
| 288 | 294 |
| 289 // Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting | 295 // Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting |
| 290 // SpdyFramerDebugVisitorInterface may be used in conjunction with SpdyFramer in | 296 // SpdyFramerDebugVisitorInterface may be used in conjunction with SpdyFramer in |
| 291 // order to extract debug/internal information about the SpdyFramer as it | 297 // order to extract debug/internal information about the SpdyFramer as it |
| 292 // operates. | 298 // operates. |
| 293 // | 299 // |
| 294 // Most SPDY implementations need not bother with this interface at all. | 300 // Most SPDY implementations need not bother with this interface at all. |
| 295 class NET_EXPORT_PRIVATE SpdyFramerDebugVisitorInterface { | 301 class NET_EXPORT_PRIVATE SpdyFramerDebugVisitorInterface { |
| 296 public: | 302 public: |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 // TODO(jgraettinger): This implementation is incorrect. The continuation | 477 // TODO(jgraettinger): This implementation is incorrect. The continuation |
| 472 // frame continues a previously-begun HPACK encoding; it doesn't begin a | 478 // frame continues a previously-begun HPACK encoding; it doesn't begin a |
| 473 // new one. Figure out whether it makes sense to keep SerializeContinuation(). | 479 // new one. Figure out whether it makes sense to keep SerializeContinuation(). |
| 474 SpdySerializedFrame* SerializeContinuation( | 480 SpdySerializedFrame* SerializeContinuation( |
| 475 const SpdyContinuationIR& continuation); | 481 const SpdyContinuationIR& continuation); |
| 476 | 482 |
| 477 // Serializes an ALTSVC frame. The ALTSVC frame advertises the | 483 // Serializes an ALTSVC frame. The ALTSVC frame advertises the |
| 478 // availability of an alternative service to the client. | 484 // availability of an alternative service to the client. |
| 479 SpdySerializedFrame* SerializeAltSvc(const SpdyAltSvcIR& altsvc); | 485 SpdySerializedFrame* SerializeAltSvc(const SpdyAltSvcIR& altsvc); |
| 480 | 486 |
| 487 // Serializes a PRIORITY frame. The PRIORITY frame advises a change in |
| 488 // the relative priority of the given stream. |
| 489 SpdySerializedFrame* SerializePriority(const SpdyPriorityIR& priority); |
| 490 |
| 481 // Serialize a frame of unknown type. | 491 // Serialize a frame of unknown type. |
| 482 SpdySerializedFrame* SerializeFrame(const SpdyFrameIR& frame); | 492 SpdySerializedFrame* SerializeFrame(const SpdyFrameIR& frame); |
| 483 | 493 |
| 484 // NOTES about frame compression. | 494 // NOTES about frame compression. |
| 485 // We want spdy to compress headers across the entire session. As long as | 495 // We want spdy to compress headers across the entire session. As long as |
| 486 // the session is over TCP, frames are sent serially. The client & server | 496 // the session is over TCP, frames are sent serially. The client & server |
| 487 // can each compress frames in the same order and then compress them in that | 497 // can each compress frames in the same order and then compress them in that |
| 488 // order, and the remote can do the reverse. However, we ultimately want | 498 // order, and the remote can do the reverse. However, we ultimately want |
| 489 // the creation of frames to be less sensitive to order so that they can be | 499 // the creation of frames to be less sensitive to order so that they can be |
| 490 // placed over a UDP based protocol and yet still benefit from some | 500 // placed over a UDP based protocol and yet still benefit from some |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM | 807 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM |
| 798 // flag is still carried in the HEADERS frame. If it's set, flip this so that | 808 // flag is still carried in the HEADERS frame. If it's set, flip this so that |
| 799 // we know to terminate the stream when the entire header block has been | 809 // we know to terminate the stream when the entire header block has been |
| 800 // processed. | 810 // processed. |
| 801 bool end_stream_when_done_; | 811 bool end_stream_when_done_; |
| 802 }; | 812 }; |
| 803 | 813 |
| 804 } // namespace net | 814 } // namespace net |
| 805 | 815 |
| 806 #endif // NET_SPDY_SPDY_FRAMER_H_ | 816 #endif // NET_SPDY_SPDY_FRAMER_H_ |
| OLD | NEW |