| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 // will vary the most between calls. If |direct| is false, the | 404 // will vary the most between calls. If |direct| is false, the |
| 405 // the full url will be used instead of simply the path. | 405 // the full url will be used instead of simply the path. |
| 406 // Returns a SpdyFrame. | 406 // Returns a SpdyFrame. |
| 407 SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], | 407 SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], |
| 408 int extra_header_count, | 408 int extra_header_count, |
| 409 bool compressed, | 409 bool compressed, |
| 410 int stream_id, | 410 int stream_id, |
| 411 RequestPriority request_priority, | 411 RequestPriority request_priority, |
| 412 bool direct); | 412 bool direct); |
| 413 | 413 |
| 414 // Same as above, but with an option to set the |fin| flag. |
| 415 SpdyFrame* ConstructSpdyGet(const char* const extra_headers[], |
| 416 int extra_header_count, |
| 417 bool compressed, |
| 418 int stream_id, |
| 419 RequestPriority request_priority, |
| 420 bool direct, |
| 421 bool fin); |
| 422 |
| 414 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. | 423 // Constructs a standard SPDY SYN_STREAM frame for a CONNECT request. |
| 415 SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], | 424 SpdyFrame* ConstructSpdyConnect(const char* const extra_headers[], |
| 416 int extra_header_count, | 425 int extra_header_count, |
| 417 int stream_id, | 426 int stream_id, |
| 418 RequestPriority priority, | 427 RequestPriority priority, |
| 419 const HostPortPair& host_port_pair); | 428 const HostPortPair& host_port_pair); |
| 420 | 429 |
| 421 // Constructs a standard SPDY push SYN frame. | 430 // Constructs a standard SPDY push SYN frame. |
| 422 // |extra_headers| are the extra header-value pairs, which typically | 431 // |extra_headers| are the extra header-value pairs, which typically |
| 423 // will vary the most between calls. | 432 // will vary the most between calls. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 440 int associated_stream_id); | 449 int associated_stream_id); |
| 441 | 450 |
| 442 SpdyFrame* ConstructSpdyPushHeaders(int stream_id, | 451 SpdyFrame* ConstructSpdyPushHeaders(int stream_id, |
| 443 const char* const extra_headers[], | 452 const char* const extra_headers[], |
| 444 int extra_header_count); | 453 int extra_header_count); |
| 445 | 454 |
| 446 SpdyFrame* ConstructSpdyHeaderFrame(int stream_id, | 455 SpdyFrame* ConstructSpdyHeaderFrame(int stream_id, |
| 447 const char* const headers[], | 456 const char* const headers[], |
| 448 int header_count); | 457 int header_count); |
| 449 | 458 |
| 459 // Constructs a SPDY header frame with END_STREAM flag set to |fin|. |
| 460 SpdyFrame* ConstructSpdyHeaderFrame(int stream_id, |
| 461 const char* const headers[], |
| 462 int header_count, |
| 463 bool fin); |
| 464 |
| 450 // Construct a SPDY syn (HEADERS or SYN_STREAM, depending on protocol | 465 // Construct a SPDY syn (HEADERS or SYN_STREAM, depending on protocol |
| 451 // version) carrying exactly the given headers and priority. | 466 // version) carrying exactly the given headers and priority. |
| 452 SpdyFrame* ConstructSpdySyn(int stream_id, | 467 SpdyFrame* ConstructSpdySyn(int stream_id, |
| 453 const SpdyHeaderBlock& headers, | 468 const SpdyHeaderBlock& headers, |
| 454 RequestPriority priority, | 469 RequestPriority priority, |
| 455 bool compressed, | 470 bool compressed, |
| 456 bool fin); | 471 bool fin); |
| 457 | 472 |
| 458 // Construct a SPDY reply (HEADERS or SYN_REPLY, depending on protocol | 473 // Construct a SPDY reply (HEADERS or SYN_REPLY, depending on protocol |
| 459 // version) carrying exactly the given headers, and the default priority | 474 // version) carrying exactly the given headers, and the default priority |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 GURL default_url_; | 586 GURL default_url_; |
| 572 bool dependency_priorities_; | 587 bool dependency_priorities_; |
| 573 | 588 |
| 574 // Track a FIFO list of the stream_id of all created requests by priority. | 589 // Track a FIFO list of the stream_id of all created requests by priority. |
| 575 std::map<int, std::vector<int>> priority_to_stream_id_list_; | 590 std::map<int, std::vector<int>> priority_to_stream_id_list_; |
| 576 }; | 591 }; |
| 577 | 592 |
| 578 } // namespace net | 593 } // namespace net |
| 579 | 594 |
| 580 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 595 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| OLD | NEW |