| 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 // This file contains some protocol structures for use with SPDY 2 and 3 | 5 // This file contains some protocol structures for use with SPDY 2 and 3 |
| 6 // The SPDY 2 spec can be found at: | 6 // The SPDY 2 spec can be found at: |
| 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2 | 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2 |
| 8 // The SPDY 3 spec can be found at: | 8 // The SPDY 3 spec can be found at: |
| 9 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 | 9 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 |
| 10 | 10 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 GOAWAY_PROTOCOL_ERROR = 1, | 356 GOAWAY_PROTOCOL_ERROR = 1, |
| 357 GOAWAY_INTERNAL_ERROR = 2, | 357 GOAWAY_INTERNAL_ERROR = 2, |
| 358 GOAWAY_NUM_STATUS_CODES = 3 // Must be last. | 358 GOAWAY_NUM_STATUS_CODES = 3 // Must be last. |
| 359 }; | 359 }; |
| 360 | 360 |
| 361 // A SPDY priority is a number between 0 and 7 (inclusive). | 361 // A SPDY priority is a number between 0 and 7 (inclusive). |
| 362 // SPDY priority range is version-dependant. For SPDY 2 and below, priority is a | 362 // SPDY priority range is version-dependant. For SPDY 2 and below, priority is a |
| 363 // number between 0 and 3. | 363 // number between 0 and 3. |
| 364 typedef uint8 SpdyPriority; | 364 typedef uint8 SpdyPriority; |
| 365 | 365 |
| 366 typedef uint8 SpdyCredentialSlot; | |
| 367 | |
| 368 typedef std::map<std::string, std::string> SpdyNameValueBlock; | 366 typedef std::map<std::string, std::string> SpdyNameValueBlock; |
| 369 | 367 |
| 370 typedef uint32 SpdyPingId; | 368 typedef uint32 SpdyPingId; |
| 371 | 369 |
| 372 class SpdyFrame; | 370 class SpdyFrame; |
| 373 typedef SpdyFrame SpdySerializedFrame; | 371 typedef SpdyFrame SpdySerializedFrame; |
| 374 | 372 |
| 375 class SpdyFrameVisitor; | 373 class SpdyFrameVisitor; |
| 376 | 374 |
| 377 // Intermediate representation for SPDY frames. | 375 // Intermediate representation for SPDY frames. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 DISALLOW_COPY_AND_ASSIGN(SpdyDataIR); | 491 DISALLOW_COPY_AND_ASSIGN(SpdyDataIR); |
| 494 }; | 492 }; |
| 495 | 493 |
| 496 class NET_EXPORT_PRIVATE SpdySynStreamIR | 494 class NET_EXPORT_PRIVATE SpdySynStreamIR |
| 497 : public SpdyFrameWithNameValueBlockIR { | 495 : public SpdyFrameWithNameValueBlockIR { |
| 498 public: | 496 public: |
| 499 explicit SpdySynStreamIR(SpdyStreamId stream_id) | 497 explicit SpdySynStreamIR(SpdyStreamId stream_id) |
| 500 : SpdyFrameWithNameValueBlockIR(stream_id), | 498 : SpdyFrameWithNameValueBlockIR(stream_id), |
| 501 associated_to_stream_id_(0), | 499 associated_to_stream_id_(0), |
| 502 priority_(0), | 500 priority_(0), |
| 503 slot_(0), | |
| 504 unidirectional_(false) {} | 501 unidirectional_(false) {} |
| 505 SpdyStreamId associated_to_stream_id() const { | 502 SpdyStreamId associated_to_stream_id() const { |
| 506 return associated_to_stream_id_; | 503 return associated_to_stream_id_; |
| 507 } | 504 } |
| 508 void set_associated_to_stream_id(SpdyStreamId stream_id) { | 505 void set_associated_to_stream_id(SpdyStreamId stream_id) { |
| 509 associated_to_stream_id_ = stream_id; | 506 associated_to_stream_id_ = stream_id; |
| 510 } | 507 } |
| 511 SpdyPriority priority() const { return priority_; } | 508 SpdyPriority priority() const { return priority_; } |
| 512 void set_priority(SpdyPriority priority) { priority_ = priority; } | 509 void set_priority(SpdyPriority priority) { priority_ = priority; } |
| 513 SpdyCredentialSlot slot() const { return slot_; } | |
| 514 void set_slot(SpdyCredentialSlot slot) { slot_ = slot; } | |
| 515 bool unidirectional() const { return unidirectional_; } | 510 bool unidirectional() const { return unidirectional_; } |
| 516 void set_unidirectional(bool unidirectional) { | 511 void set_unidirectional(bool unidirectional) { |
| 517 unidirectional_ = unidirectional; | 512 unidirectional_ = unidirectional; |
| 518 } | 513 } |
| 519 | 514 |
| 520 virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE; | 515 virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE; |
| 521 | 516 |
| 522 private: | 517 private: |
| 523 SpdyStreamId associated_to_stream_id_; | 518 SpdyStreamId associated_to_stream_id_; |
| 524 SpdyPriority priority_; | 519 SpdyPriority priority_; |
| 525 SpdyCredentialSlot slot_; | |
| 526 bool unidirectional_; | 520 bool unidirectional_; |
| 527 | 521 |
| 528 DISALLOW_COPY_AND_ASSIGN(SpdySynStreamIR); | 522 DISALLOW_COPY_AND_ASSIGN(SpdySynStreamIR); |
| 529 }; | 523 }; |
| 530 | 524 |
| 531 class NET_EXPORT_PRIVATE SpdySynReplyIR : public SpdyFrameWithNameValueBlockIR { | 525 class NET_EXPORT_PRIVATE SpdySynReplyIR : public SpdyFrameWithNameValueBlockIR { |
| 532 public: | 526 public: |
| 533 explicit SpdySynReplyIR(SpdyStreamId stream_id) | 527 explicit SpdySynReplyIR(SpdyStreamId stream_id) |
| 534 : SpdyFrameWithNameValueBlockIR(stream_id) {} | 528 : SpdyFrameWithNameValueBlockIR(stream_id) {} |
| 535 | 529 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 SpdyFrameVisitor() {} | 775 SpdyFrameVisitor() {} |
| 782 virtual ~SpdyFrameVisitor() {} | 776 virtual ~SpdyFrameVisitor() {} |
| 783 | 777 |
| 784 private: | 778 private: |
| 785 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); | 779 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); |
| 786 }; | 780 }; |
| 787 | 781 |
| 788 } // namespace net | 782 } // namespace net |
| 789 | 783 |
| 790 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 784 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
| OLD | NEW |