| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // new one. Figure out whether it makes sense to keep SerializeContinuation(). | 487 // new one. Figure out whether it makes sense to keep SerializeContinuation(). |
| 488 SpdySerializedFrame* SerializeContinuation( | 488 SpdySerializedFrame* SerializeContinuation( |
| 489 const SpdyContinuationIR& continuation); | 489 const SpdyContinuationIR& continuation); |
| 490 | 490 |
| 491 // Serializes an ALTSVC frame. The ALTSVC frame advertises the | 491 // Serializes an ALTSVC frame. The ALTSVC frame advertises the |
| 492 // availability of an alternative service to the client. | 492 // availability of an alternative service to the client. |
| 493 SpdySerializedFrame* SerializeAltSvc(const SpdyAltSvcIR& altsvc); | 493 SpdySerializedFrame* SerializeAltSvc(const SpdyAltSvcIR& altsvc); |
| 494 | 494 |
| 495 // Serializes a PRIORITY frame. The PRIORITY frame advises a change in | 495 // Serializes a PRIORITY frame. The PRIORITY frame advises a change in |
| 496 // the relative priority of the given stream. | 496 // the relative priority of the given stream. |
| 497 SpdySerializedFrame* SerializePriority(const SpdyPriorityIR& priority); | 497 SpdySerializedFrame* SerializePriority(const SpdyPriorityIR& priority) const; |
| 498 | 498 |
| 499 // Serialize a frame of unknown type. | 499 // Serialize a frame of unknown type. |
| 500 SpdySerializedFrame* SerializeFrame(const SpdyFrameIR& frame); | 500 SpdySerializedFrame* SerializeFrame(const SpdyFrameIR& frame); |
| 501 | 501 |
| 502 // NOTES about frame compression. | 502 // NOTES about frame compression. |
| 503 // We want spdy to compress headers across the entire session. As long as | 503 // We want spdy to compress headers across the entire session. As long as |
| 504 // the session is over TCP, frames are sent serially. The client & server | 504 // the session is over TCP, frames are sent serially. The client & server |
| 505 // can each compress frames in the same order and then compress them in that | 505 // can each compress frames in the same order and then compress them in that |
| 506 // order, and the remote can do the reverse. However, we ultimately want | 506 // order, and the remote can do the reverse. However, we ultimately want |
| 507 // the creation of frames to be less sensitive to order so that they can be | 507 // the creation of frames to be less sensitive to order so that they can be |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 SpdyStreamId expect_continuation() const { return expect_continuation_; } | 572 SpdyStreamId expect_continuation() const { return expect_continuation_; } |
| 573 | 573 |
| 574 SpdyPriority GetLowestPriority() const { | 574 SpdyPriority GetLowestPriority() const { |
| 575 return spdy_version_ < SPDY3 ? 3 : 7; | 575 return spdy_version_ < SPDY3 ? 3 : 7; |
| 576 } | 576 } |
| 577 | 577 |
| 578 SpdyPriority GetHighestPriority() const { return 0; } | 578 SpdyPriority GetHighestPriority() const { return 0; } |
| 579 | 579 |
| 580 // Interpolates SpdyPriority values into SPDY4/HTTP2 priority weights, | 580 // Interpolates SpdyPriority values into SPDY4/HTTP2 priority weights, |
| 581 // and vice versa. | 581 // and vice versa. |
| 582 uint8 MapPriorityToWeight(SpdyPriority priority); | 582 static uint8 MapPriorityToWeight(SpdyPriority priority); |
| 583 SpdyPriority MapWeightToPriority(uint8 weight); | 583 static SpdyPriority MapWeightToPriority(uint8 weight); |
| 584 | 584 |
| 585 // Deliver the given control frame's compressed headers block to the visitor | 585 // Deliver the given control frame's compressed headers block to the visitor |
| 586 // in decompressed form, in chunks. Returns true if the visitor has | 586 // in decompressed form, in chunks. Returns true if the visitor has |
| 587 // accepted all of the chunks. | 587 // accepted all of the chunks. |
| 588 bool IncrementallyDecompressControlFrameHeaderData( | 588 bool IncrementallyDecompressControlFrameHeaderData( |
| 589 SpdyStreamId stream_id, | 589 SpdyStreamId stream_id, |
| 590 const char* data, | 590 const char* data, |
| 591 size_t len); | 591 size_t len); |
| 592 | 592 |
| 593 protected: | 593 protected: |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM | 801 // If a HEADERS frame is followed by a CONTINUATION frame, the FIN/END_STREAM |
| 802 // flag is still carried in the HEADERS frame. If it's set, flip this so that | 802 // flag is still carried in the HEADERS frame. If it's set, flip this so that |
| 803 // we know to terminate the stream when the entire header block has been | 803 // we know to terminate the stream when the entire header block has been |
| 804 // processed. | 804 // processed. |
| 805 bool end_stream_when_done_; | 805 bool end_stream_when_done_; |
| 806 }; | 806 }; |
| 807 | 807 |
| 808 } // namespace net | 808 } // namespace net |
| 809 | 809 |
| 810 #endif // NET_SPDY_SPDY_FRAMER_H_ | 810 #endif // NET_SPDY_SPDY_FRAMER_H_ |
| OLD | NEW |