OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_test_util.h" | 5 #include "net/spdy/spdy_test_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 // Constructs a standard SPDY GET SYN packet, optionally compressed. | 364 // Constructs a standard SPDY GET SYN packet, optionally compressed. |
365 // |extra_headers| are the extra header-value pairs, which typically | 365 // |extra_headers| are the extra header-value pairs, which typically |
366 // will vary the most between calls. | 366 // will vary the most between calls. |
367 // Returns a SpdyFrame. | 367 // Returns a SpdyFrame. |
368 spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], | 368 spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], |
369 int extra_header_count, | 369 int extra_header_count, |
370 bool compressed, | 370 bool compressed, |
371 int stream_id, | 371 int stream_id, |
372 RequestPriority request_priority) { | 372 RequestPriority request_priority) { |
373 static const char* const kStandardGetHeaders[] = { | 373 return ConstructSpdyGet(extra_headers, extra_header_count, compressed, |
| 374 stream_id, request_priority, true); |
| 375 } |
| 376 |
| 377 // Constructs a standard SPDY GET SYN packet, optionally compressed. |
| 378 // |extra_headers| are the extra header-value pairs, which typically |
| 379 // will vary the most between calls. |
| 380 // Returns a SpdyFrame. |
| 381 spdy::SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], |
| 382 int extra_header_count, |
| 383 bool compressed, |
| 384 int stream_id, |
| 385 RequestPriority request_priority, |
| 386 bool direct) { |
| 387 const char* const kStandardGetHeaders[] = { |
374 "method", | 388 "method", |
375 "GET", | 389 "GET", |
376 "url", | 390 "url", |
377 "/", | 391 (direct ? "/" : "http://www.google.com/"), |
378 "host", | 392 "host", |
379 "www.google.com", | 393 "www.google.com", |
380 "scheme", | 394 "scheme", |
381 "http", | 395 "http", |
382 "version", | 396 "version", |
383 "HTTP/1.1" | 397 "HTTP/1.1" |
384 }; | 398 }; |
385 return ConstructSpdyControlFrame(extra_headers, | 399 return ConstructSpdyControlFrame(extra_headers, |
386 extra_header_count, | 400 extra_header_count, |
387 compressed, | 401 compressed, |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 spdy::CONTROL_FLAG_FIN, // Control Flags | 768 spdy::CONTROL_FLAG_FIN, // Control Flags |
755 false, // Compressed | 769 false, // Compressed |
756 spdy::INVALID, // Status | 770 spdy::INVALID, // Status |
757 NULL, // Data | 771 NULL, // Data |
758 0, // Length | 772 0, // Length |
759 spdy::DATA_FLAG_NONE // Data Flags | 773 spdy::DATA_FLAG_NONE // Data Flags |
760 }; | 774 }; |
761 return kHeader; | 775 return kHeader; |
762 } | 776 } |
763 } // namespace net | 777 } // namespace net |
OLD | NEW |