| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 bool enable_ping; | 215 bool enable_ping; |
| 216 bool enable_user_alternate_protocol_ports; | 216 bool enable_user_alternate_protocol_ports; |
| 217 NextProto protocol; | 217 NextProto protocol; |
| 218 size_t stream_initial_recv_window_size; | 218 size_t stream_initial_recv_window_size; |
| 219 SpdySession::TimeFunc time_func; | 219 SpdySession::TimeFunc time_func; |
| 220 NextProtoVector next_protos; | 220 NextProtoVector next_protos; |
| 221 std::string trusted_spdy_proxy; | 221 std::string trusted_spdy_proxy; |
| 222 bool force_spdy_over_ssl; | 222 bool force_spdy_over_ssl; |
| 223 bool force_spdy_always; | 223 bool force_spdy_always; |
| 224 bool use_alternate_protocols; | 224 bool use_alternate_protocols; |
| 225 bool enable_websocket_over_spdy; | |
| 226 NetLog* net_log; | 225 NetLog* net_log; |
| 227 }; | 226 }; |
| 228 | 227 |
| 229 class SpdyURLRequestContext : public URLRequestContext { | 228 class SpdyURLRequestContext : public URLRequestContext { |
| 230 public: | 229 public: |
| 231 SpdyURLRequestContext(NextProto protocol, | 230 SpdyURLRequestContext(NextProto protocol, |
| 232 bool force_spdy_over_ssl, | 231 bool force_spdy_over_ssl, |
| 233 bool force_spdy_always); | 232 bool force_spdy_always); |
| 234 ~SpdyURLRequestContext() override; | 233 ~SpdyURLRequestContext() override; |
| 235 | 234 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // For versions below SPDY4, adds the version HTTP/1.1 header. | 545 // For versions below SPDY4, adds the version HTTP/1.1 header. |
| 547 void MaybeAddVersionHeader(SpdyFrameWithNameValueBlockIR* frame_ir) const; | 546 void MaybeAddVersionHeader(SpdyFrameWithNameValueBlockIR* frame_ir) const; |
| 548 void MaybeAddVersionHeader(SpdyHeaderBlock* block) const; | 547 void MaybeAddVersionHeader(SpdyHeaderBlock* block) const; |
| 549 | 548 |
| 550 // Maps |priority| to SPDY version priority, and sets it on |frame_ir|. | 549 // Maps |priority| to SPDY version priority, and sets it on |frame_ir|. |
| 551 void SetPriority(RequestPriority priority, SpdySynStreamIR* frame_ir) const; | 550 void SetPriority(RequestPriority priority, SpdySynStreamIR* frame_ir) const; |
| 552 | 551 |
| 553 NextProto protocol() const { return protocol_; } | 552 NextProto protocol() const { return protocol_; } |
| 554 SpdyMajorVersion spdy_version() const { return spdy_version_; } | 553 SpdyMajorVersion spdy_version() const { return spdy_version_; } |
| 555 bool is_spdy2() const { return protocol_ < kProtoSPDY3; } | 554 bool is_spdy2() const { return protocol_ < kProtoSPDY3; } |
| 556 bool include_version_header() const { return protocol_ < kProtoSPDY4; } | 555 bool include_version_header() const { |
| 556 return protocol_ < kProtoSPDY4MinimumVersion; |
| 557 } |
| 557 scoped_ptr<SpdyFramer> CreateFramer(bool compressed) const; | 558 scoped_ptr<SpdyFramer> CreateFramer(bool compressed) const; |
| 558 | 559 |
| 559 const char* GetMethodKey() const; | 560 const char* GetMethodKey() const; |
| 560 const char* GetStatusKey() const; | 561 const char* GetStatusKey() const; |
| 561 const char* GetHostKey() const; | 562 const char* GetHostKey() const; |
| 562 const char* GetSchemeKey() const; | 563 const char* GetSchemeKey() const; |
| 563 const char* GetVersionKey() const; | 564 const char* GetVersionKey() const; |
| 564 const char* GetPathKey() const; | 565 const char* GetPathKey() const; |
| 565 | 566 |
| 566 private: | 567 private: |
| 567 // |content_length| may be NULL, in which case the content-length | 568 // |content_length| may be NULL, in which case the content-length |
| 568 // header will be omitted. | 569 // header will be omitted. |
| 569 scoped_ptr<SpdyHeaderBlock> ConstructHeaderBlock( | 570 scoped_ptr<SpdyHeaderBlock> ConstructHeaderBlock( |
| 570 base::StringPiece method, | 571 base::StringPiece method, |
| 571 base::StringPiece url, | 572 base::StringPiece url, |
| 572 int64* content_length) const; | 573 int64* content_length) const; |
| 573 | 574 |
| 574 const NextProto protocol_; | 575 const NextProto protocol_; |
| 575 const SpdyMajorVersion spdy_version_; | 576 const SpdyMajorVersion spdy_version_; |
| 576 }; | 577 }; |
| 577 | 578 |
| 578 } // namespace net | 579 } // namespace net |
| 579 | 580 |
| 580 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 581 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
| OLD | NEW |