Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: net/spdy/spdy_protocol.h

Issue 664803003: Update from chromium a8e7c94b1b79a0948d05a1fcfff53391d22ce37a (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_framer_test.cc ('k') | net/ssl/default_channel_id_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 SpdyStreamId last_good_stream_id_; 838 SpdyStreamId last_good_stream_id_;
839 SpdyGoAwayStatus status_; 839 SpdyGoAwayStatus status_;
840 const base::StringPiece description_; 840 const base::StringPiece description_;
841 841
842 DISALLOW_COPY_AND_ASSIGN(SpdyGoAwayIR); 842 DISALLOW_COPY_AND_ASSIGN(SpdyGoAwayIR);
843 }; 843 };
844 844
845 class NET_EXPORT_PRIVATE SpdyHeadersIR : public SpdyFrameWithNameValueBlockIR { 845 class NET_EXPORT_PRIVATE SpdyHeadersIR : public SpdyFrameWithNameValueBlockIR {
846 public: 846 public:
847 explicit SpdyHeadersIR(SpdyStreamId stream_id) 847 explicit SpdyHeadersIR(SpdyStreamId stream_id)
848 : SpdyFrameWithNameValueBlockIR(stream_id), 848 : SpdyFrameWithNameValueBlockIR(stream_id),
849 has_priority_(false), 849 has_priority_(false),
850 priority_(0) {} 850 priority_(0),
851 padded_(false),
852 padding_payload_len_(0) {}
851 853
852 void Visit(SpdyFrameVisitor* visitor) const override; 854 void Visit(SpdyFrameVisitor* visitor) const override;
853 855
854 bool has_priority() const { return has_priority_; } 856 bool has_priority() const { return has_priority_; }
855 void set_has_priority(bool has_priority) { has_priority_ = has_priority; } 857 void set_has_priority(bool has_priority) { has_priority_ = has_priority; }
856 uint32 priority() const { return priority_; } 858 uint32 priority() const { return priority_; }
857 void set_priority(SpdyPriority priority) { priority_ = priority; } 859 void set_priority(SpdyPriority priority) { priority_ = priority; }
858 860
861 bool padded() const { return padded_; }
862 int padding_payload_len() const { return padding_payload_len_; }
863 void set_padding_len(int padding_len) {
864 DCHECK_GT(padding_len, 0);
865 DCHECK_LE(padding_len, kPaddingSizePerFrame);
866 padded_ = true;
867 // The pad field takes one octet on the wire.
868 padding_payload_len_ = padding_len - 1;
869 }
870
859 private: 871 private:
860 bool has_priority_; 872 bool has_priority_;
861 // 31-bit priority. 873 // 31-bit priority.
862 uint32 priority_; 874 uint32 priority_;
875
876 bool padded_;
877 int padding_payload_len_;
878
863 DISALLOW_COPY_AND_ASSIGN(SpdyHeadersIR); 879 DISALLOW_COPY_AND_ASSIGN(SpdyHeadersIR);
864 }; 880 };
865 881
866 class NET_EXPORT_PRIVATE SpdyWindowUpdateIR : public SpdyFrameWithStreamIdIR { 882 class NET_EXPORT_PRIVATE SpdyWindowUpdateIR : public SpdyFrameWithStreamIdIR {
867 public: 883 public:
868 SpdyWindowUpdateIR(SpdyStreamId stream_id, int32 delta) 884 SpdyWindowUpdateIR(SpdyStreamId stream_id, int32 delta)
869 : SpdyFrameWithStreamIdIR(stream_id) { 885 : SpdyFrameWithStreamIdIR(stream_id) {
870 set_delta(delta); 886 set_delta(delta);
871 } 887 }
872 int32 delta() const { return delta_; } 888 int32 delta() const { return delta_; }
(...skipping 21 matching lines...) Expand all
894 910
895 private: 911 private:
896 DISALLOW_COPY_AND_ASSIGN(SpdyBlockedIR); 912 DISALLOW_COPY_AND_ASSIGN(SpdyBlockedIR);
897 }; 913 };
898 914
899 class NET_EXPORT_PRIVATE SpdyPushPromiseIR 915 class NET_EXPORT_PRIVATE SpdyPushPromiseIR
900 : public SpdyFrameWithNameValueBlockIR { 916 : public SpdyFrameWithNameValueBlockIR {
901 public: 917 public:
902 SpdyPushPromiseIR(SpdyStreamId stream_id, SpdyStreamId promised_stream_id) 918 SpdyPushPromiseIR(SpdyStreamId stream_id, SpdyStreamId promised_stream_id)
903 : SpdyFrameWithNameValueBlockIR(stream_id), 919 : SpdyFrameWithNameValueBlockIR(stream_id),
904 promised_stream_id_(promised_stream_id) {} 920 promised_stream_id_(promised_stream_id),
921 padded_(false),
922 padding_payload_len_(0) {}
905 SpdyStreamId promised_stream_id() const { return promised_stream_id_; } 923 SpdyStreamId promised_stream_id() const { return promised_stream_id_; }
906 void set_promised_stream_id(SpdyStreamId id) { promised_stream_id_ = id; } 924 void set_promised_stream_id(SpdyStreamId id) { promised_stream_id_ = id; }
907 925
908 void Visit(SpdyFrameVisitor* visitor) const override; 926 void Visit(SpdyFrameVisitor* visitor) const override;
909 927
928 bool padded() const { return padded_; }
929 int padding_payload_len() const { return padding_payload_len_; }
930 void set_padding_len(int padding_len) {
931 DCHECK_GT(padding_len, 0);
932 DCHECK_LE(padding_len, kPaddingSizePerFrame);
933 padded_ = true;
934 // The pad field takes one octet on the wire.
935 padding_payload_len_ = padding_len - 1;
936 }
937
910 private: 938 private:
911 SpdyStreamId promised_stream_id_; 939 SpdyStreamId promised_stream_id_;
940
941 bool padded_;
942 int padding_payload_len_;
943
912 DISALLOW_COPY_AND_ASSIGN(SpdyPushPromiseIR); 944 DISALLOW_COPY_AND_ASSIGN(SpdyPushPromiseIR);
913 }; 945 };
914 946
915 // TODO(jgraettinger): This representation needs review. SpdyContinuationIR 947 // TODO(jgraettinger): This representation needs review. SpdyContinuationIR
916 // needs to frame a portion of a single, arbitrarily-broken encoded buffer. 948 // needs to frame a portion of a single, arbitrarily-broken encoded buffer.
917 class NET_EXPORT_PRIVATE SpdyContinuationIR 949 class NET_EXPORT_PRIVATE SpdyContinuationIR
918 : public SpdyFrameWithNameValueBlockIR { 950 : public SpdyFrameWithNameValueBlockIR {
919 public: 951 public:
920 explicit SpdyContinuationIR(SpdyStreamId stream_id) 952 explicit SpdyContinuationIR(SpdyStreamId stream_id)
921 : SpdyFrameWithNameValueBlockIR(stream_id), 953 : SpdyFrameWithNameValueBlockIR(stream_id),
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 SpdyFrameVisitor() {} 1089 SpdyFrameVisitor() {}
1058 virtual ~SpdyFrameVisitor() {} 1090 virtual ~SpdyFrameVisitor() {}
1059 1091
1060 private: 1092 private:
1061 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); 1093 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor);
1062 }; 1094 };
1063 1095
1064 } // namespace net 1096 } // namespace net
1065 1097
1066 #endif // NET_SPDY_SPDY_PROTOCOL_H_ 1098 #endif // NET_SPDY_SPDY_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_framer_test.cc ('k') | net/ssl/default_channel_id_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698