OLD | NEW |
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 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 class NET_EXPORT_PRIVATE QuicStreamRequest { | 69 class NET_EXPORT_PRIVATE QuicStreamRequest { |
70 public: | 70 public: |
71 explicit QuicStreamRequest(QuicStreamFactory* factory); | 71 explicit QuicStreamRequest(QuicStreamFactory* factory); |
72 ~QuicStreamRequest(); | 72 ~QuicStreamRequest(); |
73 | 73 |
74 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is | 74 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is |
75 // passed to CertVerifier::Verify. | 75 // passed to CertVerifier::Verify. |
76 int Request(const HostPortPair& host_port_pair, | 76 int Request(const HostPortPair& host_port_pair, |
77 PrivacyMode privacy_mode, | 77 PrivacyMode privacy_mode, |
78 int cert_verify_flags, | 78 int cert_verify_flags, |
79 base::StringPiece origin_host, | 79 const GURL& url, |
80 base::StringPiece method, | 80 base::StringPiece method, |
81 const BoundNetLog& net_log, | 81 const BoundNetLog& net_log, |
82 const CompletionCallback& callback); | 82 const CompletionCallback& callback); |
83 | 83 |
84 void OnRequestComplete(int rv); | 84 void OnRequestComplete(int rv); |
85 | 85 |
86 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It | 86 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It |
87 // returns the amount of time waiting job should be delayed. | 87 // returns the amount of time waiting job should be delayed. |
88 base::TimeDelta GetTimeDelayForWaitingJob() const; | 88 base::TimeDelta GetTimeDelayForWaitingJob() const; |
89 | 89 |
90 scoped_ptr<QuicHttpStream> ReleaseStream(); | 90 scoped_ptr<QuicHttpStream> ReleaseStream(); |
91 | 91 |
92 void set_stream(scoped_ptr<QuicHttpStream> stream); | 92 void set_stream(scoped_ptr<QuicHttpStream> stream); |
93 | 93 |
94 const std::string& origin_host() const { return origin_host_; } | 94 const std::string& origin_host() const { return origin_host_; } |
95 | 95 |
96 PrivacyMode privacy_mode() const { return privacy_mode_; } | 96 PrivacyMode privacy_mode() const { return privacy_mode_; } |
97 | 97 |
98 const BoundNetLog& net_log() const { return net_log_; } | 98 const BoundNetLog& net_log() const { return net_log_; } |
99 | 99 |
100 private: | 100 private: |
101 QuicStreamFactory* factory_; | 101 QuicStreamFactory* factory_; |
102 HostPortPair host_port_pair_; | 102 HostPortPair host_port_pair_; |
103 std::string origin_host_; | 103 std::string origin_host_; |
| 104 string url_; |
104 PrivacyMode privacy_mode_; | 105 PrivacyMode privacy_mode_; |
105 BoundNetLog net_log_; | 106 BoundNetLog net_log_; |
106 CompletionCallback callback_; | 107 CompletionCallback callback_; |
107 scoped_ptr<QuicHttpStream> stream_; | 108 scoped_ptr<QuicHttpStream> stream_; |
108 | 109 |
109 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); | 110 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); |
110 }; | 111 }; |
111 | 112 |
112 // A factory for creating new QuicHttpStreams on top of a pool of | 113 // A factory for creating new QuicHttpStreams on top of a pool of |
113 // QuicChromiumClientSessions. | 114 // QuicChromiumClientSessions. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 StringPiece origin_host); | 166 StringPiece origin_host); |
166 | 167 |
167 // Creates a new QuicHttpStream to |host_port_pair| which will be | 168 // Creates a new QuicHttpStream to |host_port_pair| which will be |
168 // owned by |request|. | 169 // owned by |request|. |
169 // If a matching session already exists, this method will return OK. If no | 170 // If a matching session already exists, this method will return OK. If no |
170 // matching session exists, this will return ERR_IO_PENDING and will invoke | 171 // matching session exists, this will return ERR_IO_PENDING and will invoke |
171 // OnRequestComplete asynchronously. | 172 // OnRequestComplete asynchronously. |
172 int Create(const HostPortPair& host_port_pair, | 173 int Create(const HostPortPair& host_port_pair, |
173 PrivacyMode privacy_mode, | 174 PrivacyMode privacy_mode, |
174 int cert_verify_flags, | 175 int cert_verify_flags, |
175 base::StringPiece origin_host, | 176 const GURL& url, |
176 base::StringPiece method, | 177 base::StringPiece method, |
177 const BoundNetLog& net_log, | 178 const BoundNetLog& net_log, |
178 QuicStreamRequest* request); | 179 QuicStreamRequest* request); |
179 | 180 |
180 // If |packet_loss_rate| is greater than or equal to |packet_loss_threshold_| | 181 // If |packet_loss_rate| is greater than or equal to |packet_loss_threshold_| |
181 // it marks QUIC as recently broken for the port of the session. Increments | 182 // it marks QUIC as recently broken for the port of the session. Increments |
182 // |number_of_lossy_connections_| by port. If |number_of_lossy_connections_| | 183 // |number_of_lossy_connections_| by port. If |number_of_lossy_connections_| |
183 // is greater than or equal to |max_number_of_lossy_connections_| then it | 184 // is greater than or equal to |max_number_of_lossy_connections_| then it |
184 // disables QUIC. If QUIC is disabled then it closes the connection. | 185 // disables QUIC. If QUIC is disabled then it closes the connection. |
185 // | 186 // |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 uint64_t port_seed_; | 522 uint64_t port_seed_; |
522 | 523 |
523 // Local address of socket that was created in CreateSession. | 524 // Local address of socket that was created in CreateSession. |
524 IPEndPoint local_address_; | 525 IPEndPoint local_address_; |
525 bool check_persisted_supports_quic_; | 526 bool check_persisted_supports_quic_; |
526 bool has_initialized_data_; | 527 bool has_initialized_data_; |
527 std::set<HostPortPair> quic_supported_servers_at_startup_; | 528 std::set<HostPortPair> quic_supported_servers_at_startup_; |
528 | 529 |
529 NetworkConnection network_connection_; | 530 NetworkConnection network_connection_; |
530 | 531 |
| 532 int num_push_streams_created_; |
| 533 |
531 QuicClientPushPromiseIndex push_promise_index_; | 534 QuicClientPushPromiseIndex push_promise_index_; |
532 | 535 |
533 base::TaskRunner* task_runner_; | 536 base::TaskRunner* task_runner_; |
534 | 537 |
535 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 538 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
536 | 539 |
537 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 540 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
538 }; | 541 }; |
539 | 542 |
540 } // namespace net | 543 } // namespace net |
541 | 544 |
542 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 545 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |