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_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_CHROMIUM_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 21 matching lines...) Expand all Loading... |
32 #include "net/proxy/proxy_server.h" | 32 #include "net/proxy/proxy_server.h" |
33 #include "net/quic/chromium/network_connection.h" | 33 #include "net/quic/chromium/network_connection.h" |
34 #include "net/quic/chromium/quic_chromium_client_session.h" | 34 #include "net/quic/chromium/quic_chromium_client_session.h" |
35 #include "net/quic/chromium/quic_clock_skew_detector.h" | 35 #include "net/quic/chromium/quic_clock_skew_detector.h" |
36 #include "net/quic/chromium/quic_http_stream.h" | 36 #include "net/quic/chromium/quic_http_stream.h" |
37 #include "net/quic/core/quic_client_push_promise_index.h" | 37 #include "net/quic/core/quic_client_push_promise_index.h" |
38 #include "net/quic/core/quic_config.h" | 38 #include "net/quic/core/quic_config.h" |
39 #include "net/quic/core/quic_crypto_stream.h" | 39 #include "net/quic/core/quic_crypto_stream.h" |
40 #include "net/quic/core/quic_packets.h" | 40 #include "net/quic/core/quic_packets.h" |
41 #include "net/quic/core/quic_server_id.h" | 41 #include "net/quic/core/quic_server_id.h" |
| 42 #include "net/quic/platform/api/quic_string_piece.h" |
42 #include "net/ssl/ssl_config_service.h" | 43 #include "net/ssl/ssl_config_service.h" |
43 | 44 |
44 namespace base { | 45 namespace base { |
45 class Value; | 46 class Value; |
46 namespace trace_event { | 47 namespace trace_event { |
47 class ProcessMemoryDump; | 48 class ProcessMemoryDump; |
48 } | 49 } |
49 } | 50 } |
50 | 51 |
51 namespace net { | 52 namespace net { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 ~QuicStreamRequest(); | 113 ~QuicStreamRequest(); |
113 | 114 |
114 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is | 115 // |cert_verify_flags| is bitwise OR'd of CertVerifier::VerifyFlags and it is |
115 // passed to CertVerifier::Verify. | 116 // passed to CertVerifier::Verify. |
116 // |destination| will be resolved and resulting IPEndPoint used to open a | 117 // |destination| will be resolved and resulting IPEndPoint used to open a |
117 // QuicConnection. This can be different than HostPortPair::FromURL(url). | 118 // QuicConnection. This can be different than HostPortPair::FromURL(url). |
118 int Request(const HostPortPair& destination, | 119 int Request(const HostPortPair& destination, |
119 PrivacyMode privacy_mode, | 120 PrivacyMode privacy_mode, |
120 int cert_verify_flags, | 121 int cert_verify_flags, |
121 const GURL& url, | 122 const GURL& url, |
122 base::StringPiece method, | 123 QuicStringPiece method, |
123 const NetLogWithSource& net_log, | 124 const NetLogWithSource& net_log, |
124 const CompletionCallback& callback); | 125 const CompletionCallback& callback); |
125 | 126 |
126 void OnRequestComplete(int rv); | 127 void OnRequestComplete(int rv); |
127 | 128 |
128 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It | 129 // Helper method that calls |factory_|'s GetTimeDelayForWaitingJob(). It |
129 // returns the amount of time waiting job should be delayed. | 130 // returns the amount of time waiting job should be delayed. |
130 base::TimeDelta GetTimeDelayForWaitingJob() const; | 131 base::TimeDelta GetTimeDelayForWaitingJob() const; |
131 | 132 |
132 std::unique_ptr<QuicHttpStream> CreateStream(); | 133 std::unique_ptr<QuicHttpStream> CreateStream(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 240 |
240 // Creates a new QuicHttpStream to |host_port_pair| which will be | 241 // Creates a new QuicHttpStream to |host_port_pair| which will be |
241 // owned by |request|. | 242 // owned by |request|. |
242 // If a matching session already exists, this method will return OK. If no | 243 // If a matching session already exists, this method will return OK. If no |
243 // matching session exists, this will return ERR_IO_PENDING and will invoke | 244 // matching session exists, this will return ERR_IO_PENDING and will invoke |
244 // OnRequestComplete asynchronously. | 245 // OnRequestComplete asynchronously. |
245 int Create(const QuicServerId& server_id, | 246 int Create(const QuicServerId& server_id, |
246 const HostPortPair& destination, | 247 const HostPortPair& destination, |
247 int cert_verify_flags, | 248 int cert_verify_flags, |
248 const GURL& url, | 249 const GURL& url, |
249 base::StringPiece method, | 250 QuicStringPiece method, |
250 const NetLogWithSource& net_log, | 251 const NetLogWithSource& net_log, |
251 QuicStreamRequest* request); | 252 QuicStreamRequest* request); |
252 | 253 |
253 // Called when the handshake for |session| is confirmed. If QUIC is disabled | 254 // Called when the handshake for |session| is confirmed. If QUIC is disabled |
254 // currently disabled, then it closes the connection and returns true. | 255 // currently disabled, then it closes the connection and returns true. |
255 bool OnHandshakeConfirmed(QuicChromiumClientSession* session); | 256 bool OnHandshakeConfirmed(QuicChromiumClientSession* session); |
256 | 257 |
257 // Called when a TCP job completes for an origin that QUIC potentially | 258 // Called when a TCP job completes for an origin that QUIC potentially |
258 // could be used for. | 259 // could be used for. |
259 void OnTcpJobCompleted(bool succeeded); | 260 void OnTcpJobCompleted(bool succeeded); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 const scoped_refptr<SSLConfigService> ssl_config_service_; | 676 const scoped_refptr<SSLConfigService> ssl_config_service_; |
676 | 677 |
677 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 678 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
678 | 679 |
679 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 680 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
680 }; | 681 }; |
681 | 682 |
682 } // namespace net | 683 } // namespace net |
683 | 684 |
684 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 685 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |