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_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | |
12 #include <set> | 11 #include <set> |
13 #include <string> | |
14 #include <vector> | 12 #include <vector> |
15 | 13 |
16 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
17 #include "base/macros.h" | 15 #include "base/macros.h" |
18 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
19 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
20 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
21 #include "net/base/privacy_mode.h" | 19 #include "net/base/privacy_mode.h" |
22 #include "net/base/request_priority.h" | 20 #include "net/base/request_priority.h" |
23 #include "net/http/http_stream_factory.h" | 21 #include "net/http/http_stream_factory.h" |
(...skipping 15 matching lines...) Expand all Loading... |
39 class NET_EXPORT_PRIVATE JobController; | 37 class NET_EXPORT_PRIVATE JobController; |
40 class NET_EXPORT_PRIVATE JobFactory; | 38 class NET_EXPORT_PRIVATE JobFactory; |
41 class NET_EXPORT_PRIVATE Request; | 39 class NET_EXPORT_PRIVATE Request; |
42 // RequestStream may only be called if |for_websockets| is false. | 40 // RequestStream may only be called if |for_websockets| is false. |
43 // RequestWebSocketHandshakeStream may only be called if |for_websockets| | 41 // RequestWebSocketHandshakeStream may only be called if |for_websockets| |
44 // is true. | 42 // is true. |
45 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); | 43 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); |
46 ~HttpStreamFactoryImpl() override; | 44 ~HttpStreamFactoryImpl() override; |
47 | 45 |
48 // HttpStreamFactory interface | 46 // HttpStreamFactory interface |
49 std::unique_ptr<HttpStreamRequest> RequestStream( | 47 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, |
| 48 RequestPriority priority, |
| 49 const SSLConfig& server_ssl_config, |
| 50 const SSLConfig& proxy_ssl_config, |
| 51 HttpStreamRequest::Delegate* delegate, |
| 52 bool enable_ip_based_pooling, |
| 53 bool enable_alternative_services, |
| 54 const NetLogWithSource& net_log) override; |
| 55 |
| 56 HttpStreamRequest* RequestWebSocketHandshakeStream( |
50 const HttpRequestInfo& info, | 57 const HttpRequestInfo& info, |
51 RequestPriority priority, | 58 RequestPriority priority, |
52 const SSLConfig& server_ssl_config, | 59 const SSLConfig& server_ssl_config, |
53 const SSLConfig& proxy_ssl_config, | |
54 HttpStreamRequest::Delegate* delegate, | |
55 bool enable_ip_based_pooling, | |
56 bool enable_alternative_services, | |
57 const NetLogWithSource& net_log) override; | |
58 | |
59 std::unique_ptr<HttpStreamRequest> RequestWebSocketHandshakeStream( | |
60 const HttpRequestInfo& info, | |
61 RequestPriority priority, | |
62 const SSLConfig& server_ssl_config, | |
63 const SSLConfig& proxy_ssl_config, | 60 const SSLConfig& proxy_ssl_config, |
64 HttpStreamRequest::Delegate* delegate, | 61 HttpStreamRequest::Delegate* delegate, |
65 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 62 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
66 bool enable_ip_based_pooling, | 63 bool enable_ip_based_pooling, |
67 bool enable_alternative_services, | 64 bool enable_alternative_services, |
68 const NetLogWithSource& net_log) override; | 65 const NetLogWithSource& net_log) override; |
69 | 66 |
70 std::unique_ptr<HttpStreamRequest> RequestBidirectionalStreamImpl( | 67 HttpStreamRequest* RequestBidirectionalStreamImpl( |
71 const HttpRequestInfo& info, | 68 const HttpRequestInfo& info, |
72 RequestPriority priority, | 69 RequestPriority priority, |
73 const SSLConfig& server_ssl_config, | 70 const SSLConfig& server_ssl_config, |
74 const SSLConfig& proxy_ssl_config, | 71 const SSLConfig& proxy_ssl_config, |
75 HttpStreamRequest::Delegate* delegate, | 72 HttpStreamRequest::Delegate* delegate, |
76 bool enable_ip_based_pooling, | 73 bool enable_ip_based_pooling, |
77 bool enable_alternative_services, | 74 bool enable_alternative_services, |
78 const NetLogWithSource& net_log) override; | 75 const NetLogWithSource& net_log) override; |
79 | 76 |
80 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override; | 77 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // enum in histograms.xml. | 113 // enum in histograms.xml. |
117 enum AlternativeServiceType { | 114 enum AlternativeServiceType { |
118 NO_ALTERNATIVE_SERVICE = 0, | 115 NO_ALTERNATIVE_SERVICE = 0, |
119 QUIC_SAME_DESTINATION = 1, | 116 QUIC_SAME_DESTINATION = 1, |
120 QUIC_DIFFERENT_DESTINATION = 2, | 117 QUIC_DIFFERENT_DESTINATION = 2, |
121 NOT_QUIC_SAME_DESTINATION = 3, | 118 NOT_QUIC_SAME_DESTINATION = 3, |
122 NOT_QUIC_DIFFERENT_DESTINATION = 4, | 119 NOT_QUIC_DIFFERENT_DESTINATION = 4, |
123 MAX_ALTERNATIVE_SERVICE_TYPE | 120 MAX_ALTERNATIVE_SERVICE_TYPE |
124 }; | 121 }; |
125 | 122 |
126 std::unique_ptr<HttpStreamRequest> RequestStreamInternal( | 123 HttpStreamRequest* RequestStreamInternal( |
127 const HttpRequestInfo& info, | 124 const HttpRequestInfo& info, |
128 RequestPriority priority, | 125 RequestPriority priority, |
129 const SSLConfig& server_ssl_config, | 126 const SSLConfig& server_ssl_config, |
130 const SSLConfig& proxy_ssl_config, | 127 const SSLConfig& proxy_ssl_config, |
131 HttpStreamRequest::Delegate* delegate, | 128 HttpStreamRequest::Delegate* delegate, |
132 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 129 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
133 HttpStreamRequest::StreamType stream_type, | 130 HttpStreamRequest::StreamType stream_type, |
134 bool enable_ip_based_pooling, | 131 bool enable_ip_based_pooling, |
135 bool enable_alternative_services, | 132 bool enable_alternative_services, |
136 const NetLogWithSource& net_log); | 133 const NetLogWithSource& net_log); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 198 |
202 // The count of JobControllers that was most recently logged to histograms. | 199 // The count of JobControllers that was most recently logged to histograms. |
203 size_t last_logged_job_controller_count_; | 200 size_t last_logged_job_controller_count_; |
204 | 201 |
205 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); | 202 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); |
206 }; | 203 }; |
207 | 204 |
208 } // namespace net | 205 } // namespace net |
209 | 206 |
210 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 207 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
OLD | NEW |