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

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

Issue 290003006: Land recent SPDY changes (through 67282679) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on nullptr => NULL Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_protocol_test.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 #include "net/spdy/spdy_protocol.h" 5 #include "net/spdy/spdy_protocol.h"
6 6
7 namespace net { 7 namespace net {
8 8
9 SpdyFrameWithNameValueBlockIR::SpdyFrameWithNameValueBlockIR( 9 SpdyFrameWithNameValueBlockIR::SpdyFrameWithNameValueBlockIR(
10 SpdyStreamId stream_id) : SpdyFrameWithFinIR(stream_id) {} 10 SpdyStreamId stream_id) : SpdyFrameWithFinIR(stream_id) {}
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return WINDOW_UPDATE; 91 return WINDOW_UPDATE;
92 } 92 }
93 break; 93 break;
94 case SPDY4: 94 case SPDY4:
95 case SPDY5: 95 case SPDY5:
96 switch (frame_type_field) { 96 switch (frame_type_field) {
97 case 0: 97 case 0:
98 return DATA; 98 return DATA;
99 case 1: 99 case 1:
100 return HEADERS; 100 return HEADERS;
101 // TODO(hkhalil): Add PRIORITY. 101 case 2:
102 return PRIORITY;
102 case 3: 103 case 3:
103 return RST_STREAM; 104 return RST_STREAM;
104 case 4: 105 case 4:
105 return SETTINGS; 106 return SETTINGS;
106 case 5: 107 case 5:
107 return PUSH_PROMISE; 108 return PUSH_PROMISE;
108 case 6: 109 case 6:
109 return PING; 110 return PING;
110 case 7: 111 case 7:
111 return GOAWAY; 112 return GOAWAY;
112 case 8: 113 case 8:
113 return WINDOW_UPDATE; 114 return WINDOW_UPDATE;
114 case 9: 115 case 9:
115 return CONTINUATION; 116 return CONTINUATION;
116 case 10: 117 case 10:
118 return ALTSVC;
119 case 11:
117 return BLOCKED; 120 return BLOCKED;
118 } 121 }
119 break; 122 break;
120 } 123 }
121 124
122 LOG(DFATAL) << "Unhandled frame type " << frame_type_field; 125 LOG(DFATAL) << "Unhandled frame type " << frame_type_field;
123 return DATA; 126 return DATA;
124 } 127 }
125 128
126 int SpdyConstants::SerializeFrameType(SpdyMajorVersion version, 129 int SpdyConstants::SerializeFrameType(SpdyMajorVersion version,
(...skipping 22 matching lines...) Expand all
149 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; 152 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type;
150 return -1; 153 return -1;
151 } 154 }
152 case SPDY4: 155 case SPDY4:
153 case SPDY5: 156 case SPDY5:
154 switch (frame_type) { 157 switch (frame_type) {
155 case DATA: 158 case DATA:
156 return 0; 159 return 0;
157 case HEADERS: 160 case HEADERS:
158 return 1; 161 return 1;
159 // TODO(hkhalil): Add PRIORITY. 162 case PRIORITY:
163 return 2;
160 case RST_STREAM: 164 case RST_STREAM:
161 return 3; 165 return 3;
162 case SETTINGS: 166 case SETTINGS:
163 return 4; 167 return 4;
164 case PUSH_PROMISE: 168 case PUSH_PROMISE:
165 return 5; 169 return 5;
166 case PING: 170 case PING:
167 return 6; 171 return 6;
168 case GOAWAY: 172 case GOAWAY:
169 return 7; 173 return 7;
170 case WINDOW_UPDATE: 174 case WINDOW_UPDATE:
171 return 8; 175 return 8;
172 case CONTINUATION: 176 case CONTINUATION:
173 return 9; 177 return 9;
178 case ALTSVC:
179 return 10;
174 case BLOCKED: 180 case BLOCKED:
175 return 10; 181 return 11;
176 default: 182 default:
177 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type; 183 LOG(DFATAL) << "Serializing unhandled frame type " << frame_type;
178 return -1; 184 return -1;
179 } 185 }
180 } 186 }
181 187
182 LOG(DFATAL) << "Unhandled SPDY version " << version; 188 LOG(DFATAL) << "Unhandled SPDY version " << version;
183 return -1; 189 return -1;
184 } 190 }
185 191
(...skipping 16 matching lines...) Expand all
202 208
203 return true; 209 return true;
204 case SPDY4: 210 case SPDY4:
205 case SPDY5: 211 case SPDY5:
206 // HEADER_TABLE_SIZE is the first valid setting id. 212 // HEADER_TABLE_SIZE is the first valid setting id.
207 if (setting_id_field < 213 if (setting_id_field <
208 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { 214 SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) {
209 return false; 215 return false;
210 } 216 }
211 217
212 // INITIAL_WINDOW_SIZE is the last valid setting id. 218 // COMPRESS_DATA is the last valid setting id.
213 if (setting_id_field > 219 if (setting_id_field >
214 SerializeSettingId(version, SETTINGS_INITIAL_WINDOW_SIZE)) { 220 SerializeSettingId(version, SETTINGS_COMPRESS_DATA)) {
215 return false; 221 return false;
216 } 222 }
217 223
218 return true; 224 return true;
219 } 225 }
220 226
221 LOG(DFATAL) << "Unhandled SPDY version " << version; 227 LOG(DFATAL) << "Unhandled SPDY version " << version;
222 return false; 228 return false;
223 } 229 }
224 230
(...skipping 23 matching lines...) Expand all
248 case SPDY5: 254 case SPDY5:
249 switch (setting_id_field) { 255 switch (setting_id_field) {
250 case 1: 256 case 1:
251 return SETTINGS_HEADER_TABLE_SIZE; 257 return SETTINGS_HEADER_TABLE_SIZE;
252 case 2: 258 case 2:
253 return SETTINGS_ENABLE_PUSH; 259 return SETTINGS_ENABLE_PUSH;
254 case 3: 260 case 3:
255 return SETTINGS_MAX_CONCURRENT_STREAMS; 261 return SETTINGS_MAX_CONCURRENT_STREAMS;
256 case 4: 262 case 4:
257 return SETTINGS_INITIAL_WINDOW_SIZE; 263 return SETTINGS_INITIAL_WINDOW_SIZE;
264 case 5:
265 return SETTINGS_COMPRESS_DATA;
258 } 266 }
259 break; 267 break;
260 } 268 }
261 269
262 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field; 270 LOG(DFATAL) << "Unhandled setting ID " << setting_id_field;
263 return SETTINGS_UPLOAD_BANDWIDTH; 271 return SETTINGS_UPLOAD_BANDWIDTH;
264 } 272 }
265 273
266 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, 274 int SpdyConstants::SerializeSettingId(SpdyMajorVersion version,
267 SpdySettingsIds id) { 275 SpdySettingsIds id) {
(...skipping 23 matching lines...) Expand all
291 case SPDY5: 299 case SPDY5:
292 switch (id) { 300 switch (id) {
293 case SETTINGS_HEADER_TABLE_SIZE: 301 case SETTINGS_HEADER_TABLE_SIZE:
294 return 1; 302 return 1;
295 case SETTINGS_ENABLE_PUSH: 303 case SETTINGS_ENABLE_PUSH:
296 return 2; 304 return 2;
297 case SETTINGS_MAX_CONCURRENT_STREAMS: 305 case SETTINGS_MAX_CONCURRENT_STREAMS:
298 return 3; 306 return 3;
299 case SETTINGS_INITIAL_WINDOW_SIZE: 307 case SETTINGS_INITIAL_WINDOW_SIZE:
300 return 4; 308 return 4;
309 case SETTINGS_COMPRESS_DATA:
310 return 5;
301 default: 311 default:
302 LOG(DFATAL) << "Serializing unhandled setting id " << id; 312 LOG(DFATAL) << "Serializing unhandled setting id " << id;
303 return -1; 313 return -1;
304 } 314 }
305 } 315 }
306 LOG(DFATAL) << "Unhandled SPDY version " << version; 316 LOG(DFATAL) << "Unhandled SPDY version " << version;
307 return -1; 317 return -1;
308 } 318 }
309 319
310 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, 320 bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version,
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 } 791 }
782 792
783 void SpdyPushPromiseIR::Visit(SpdyFrameVisitor* visitor) const { 793 void SpdyPushPromiseIR::Visit(SpdyFrameVisitor* visitor) const {
784 return visitor->VisitPushPromise(*this); 794 return visitor->VisitPushPromise(*this);
785 } 795 }
786 796
787 void SpdyContinuationIR::Visit(SpdyFrameVisitor* visitor) const { 797 void SpdyContinuationIR::Visit(SpdyFrameVisitor* visitor) const {
788 return visitor->VisitContinuation(*this); 798 return visitor->VisitContinuation(*this);
789 } 799 }
790 800
801 SpdyAltSvcIR::SpdyAltSvcIR(SpdyStreamId stream_id)
802 : SpdyFrameWithStreamIdIR(stream_id),
803 max_age_(0),
804 port_(0) {}
805
806 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const {
807 return visitor->VisitAltSvc(*this);
808 }
809
791 } // namespace net 810 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698