Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: net/http/http_stream_factory_impl.h

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

Powered by Google App Engine
This is Rietveld 408576698