| 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 | 955 |
| 956 private: | 956 private: |
| 957 uint32 max_age_; | 957 uint32 max_age_; |
| 958 uint16 port_; | 958 uint16 port_; |
| 959 SpdyProtocolId protocol_id_; | 959 SpdyProtocolId protocol_id_; |
| 960 std::string host_; | 960 std::string host_; |
| 961 std::string origin_; | 961 std::string origin_; |
| 962 DISALLOW_COPY_AND_ASSIGN(SpdyAltSvcIR); | 962 DISALLOW_COPY_AND_ASSIGN(SpdyAltSvcIR); |
| 963 }; | 963 }; |
| 964 | 964 |
| 965 class NET_EXPORT_PRIVATE SpdyPriorityIR : public SpdyFrameWithStreamIdIR { |
| 966 public: |
| 967 explicit SpdyPriorityIR(SpdyStreamId stream_id); |
| 968 explicit SpdyPriorityIR(SpdyStreamId stream_id, |
| 969 SpdyStreamId parent_stream_id, |
| 970 uint8 weight, |
| 971 bool exclusive); |
| 972 SpdyStreamId parent_stream_id() const { return parent_stream_id_; } |
| 973 void set_parent_stream_id(SpdyStreamId id) { parent_stream_id_ = id; } |
| 974 uint8 weight() const { return weight_; } |
| 975 void set_weight(uint8 weight) { weight_ = weight; } |
| 976 bool exclusive() const { return exclusive_; } |
| 977 void set_exclusive(bool exclusive) { exclusive_ = exclusive; } |
| 978 |
| 979 virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE; |
| 980 |
| 981 private: |
| 982 SpdyStreamId parent_stream_id_; |
| 983 uint8 weight_; |
| 984 bool exclusive_; |
| 985 DISALLOW_COPY_AND_ASSIGN(SpdyPriorityIR); |
| 986 }; |
| 987 |
| 965 // ------------------------------------------------------------------------- | 988 // ------------------------------------------------------------------------- |
| 966 // Wrapper classes for various SPDY frames. | 989 // Wrapper classes for various SPDY frames. |
| 967 | 990 |
| 968 // All Spdy Frame types derive from this SpdyFrame class. | 991 // All Spdy Frame types derive from this SpdyFrame class. |
| 969 class SpdyFrame { | 992 class SpdyFrame { |
| 970 public: | 993 public: |
| 971 // Create a SpdyFrame using a pre-created buffer. | 994 // Create a SpdyFrame using a pre-created buffer. |
| 972 // If |owns_buffer| is true, this class takes ownership of the buffer | 995 // If |owns_buffer| is true, this class takes ownership of the buffer |
| 973 // and will delete it on cleanup. The buffer must have been created using | 996 // and will delete it on cleanup. The buffer must have been created using |
| 974 // new char[]. | 997 // new char[]. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) = 0; | 1039 virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) = 0; |
| 1017 virtual void VisitSettings(const SpdySettingsIR& settings) = 0; | 1040 virtual void VisitSettings(const SpdySettingsIR& settings) = 0; |
| 1018 virtual void VisitPing(const SpdyPingIR& ping) = 0; | 1041 virtual void VisitPing(const SpdyPingIR& ping) = 0; |
| 1019 virtual void VisitGoAway(const SpdyGoAwayIR& goaway) = 0; | 1042 virtual void VisitGoAway(const SpdyGoAwayIR& goaway) = 0; |
| 1020 virtual void VisitHeaders(const SpdyHeadersIR& headers) = 0; | 1043 virtual void VisitHeaders(const SpdyHeadersIR& headers) = 0; |
| 1021 virtual void VisitWindowUpdate(const SpdyWindowUpdateIR& window_update) = 0; | 1044 virtual void VisitWindowUpdate(const SpdyWindowUpdateIR& window_update) = 0; |
| 1022 virtual void VisitBlocked(const SpdyBlockedIR& blocked) = 0; | 1045 virtual void VisitBlocked(const SpdyBlockedIR& blocked) = 0; |
| 1023 virtual void VisitPushPromise(const SpdyPushPromiseIR& push_promise) = 0; | 1046 virtual void VisitPushPromise(const SpdyPushPromiseIR& push_promise) = 0; |
| 1024 virtual void VisitContinuation(const SpdyContinuationIR& continuation) = 0; | 1047 virtual void VisitContinuation(const SpdyContinuationIR& continuation) = 0; |
| 1025 virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) = 0; | 1048 virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) = 0; |
| 1049 virtual void VisitPriority(const SpdyPriorityIR& priority) = 0; |
| 1026 virtual void VisitData(const SpdyDataIR& data) = 0; | 1050 virtual void VisitData(const SpdyDataIR& data) = 0; |
| 1027 | 1051 |
| 1028 protected: | 1052 protected: |
| 1029 SpdyFrameVisitor() {} | 1053 SpdyFrameVisitor() {} |
| 1030 virtual ~SpdyFrameVisitor() {} | 1054 virtual ~SpdyFrameVisitor() {} |
| 1031 | 1055 |
| 1032 private: | 1056 private: |
| 1033 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); | 1057 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); |
| 1034 }; | 1058 }; |
| 1035 | 1059 |
| 1036 } // namespace net | 1060 } // namespace net |
| 1037 | 1061 |
| 1038 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 1062 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
| OLD | NEW |