Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
| 15 #include "net/http/http_stream_factory.h" | 15 #include "net/http/http_stream_factory.h" |
| 16 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 17 #include "net/proxy/proxy_server.h" | 17 #include "net/proxy/proxy_server.h" |
| 18 #include "net/socket/ssl_client_socket.h" | 18 #include "net/socket/ssl_client_socket.h" |
| 19 #include "net/spdy/spdy_session_key.h" | 19 #include "net/spdy/spdy_session_key.h" |
| 20 | 20 |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 class HttpNetworkSession; | 23 class HttpNetworkSession; |
| 24 class SpdySession; | 24 class SpdySession; |
| 25 class BidirectionalStream; | |
|
Bence
2015/10/01 05:29:28
Why do you need this?
xunjieli
2015/10/01 18:41:16
Thanks for catching that. Done.
| |
| 25 | 26 |
| 26 class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory { | 27 class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory { |
| 27 public: | 28 public: |
| 28 // RequestStream may only be called if |for_websockets| is false. | 29 // RequestStream may only be called if |for_websockets| is false. |
| 29 // RequestWebSocketHandshakeStream may only be called if |for_websockets| | 30 // RequestWebSocketHandshakeStream may only be called if |for_websockets| |
| 30 // is true. | 31 // is true. |
| 31 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); | 32 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); |
| 32 ~HttpStreamFactoryImpl() override; | 33 ~HttpStreamFactoryImpl() override; |
| 33 | 34 |
| 34 // HttpStreamFactory interface | 35 // HttpStreamFactory interface |
| 35 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, | 36 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, |
| 36 RequestPriority priority, | 37 RequestPriority priority, |
| 37 const SSLConfig& server_ssl_config, | 38 const SSLConfig& server_ssl_config, |
| 38 const SSLConfig& proxy_ssl_config, | 39 const SSLConfig& proxy_ssl_config, |
| 39 HttpStreamRequest::Delegate* delegate, | 40 HttpStreamRequest::Delegate* delegate, |
| 40 const BoundNetLog& net_log) override; | 41 const BoundNetLog& net_log) override; |
| 41 | 42 |
| 42 HttpStreamRequest* RequestWebSocketHandshakeStream( | 43 HttpStreamRequest* RequestWebSocketHandshakeStream( |
| 43 const HttpRequestInfo& info, | 44 const HttpRequestInfo& info, |
| 44 RequestPriority priority, | 45 RequestPriority priority, |
| 45 const SSLConfig& server_ssl_config, | 46 const SSLConfig& server_ssl_config, |
| 46 const SSLConfig& proxy_ssl_config, | 47 const SSLConfig& proxy_ssl_config, |
| 47 HttpStreamRequest::Delegate* delegate, | 48 HttpStreamRequest::Delegate* delegate, |
| 48 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 49 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
| 49 const BoundNetLog& net_log) override; | 50 const BoundNetLog& net_log) override; |
| 50 | 51 |
| 52 HttpStreamRequest* RequestBidirectionalStream( | |
| 53 const HttpRequestInfo& info, | |
| 54 RequestPriority priority, | |
| 55 const SSLConfig& server_ssl_config, | |
| 56 const SSLConfig& proxy_ssl_config, | |
| 57 HttpStreamRequest::Delegate* delegate, | |
| 58 const BoundNetLog& net_log) override; | |
| 59 | |
| 51 void PreconnectStreams(int num_streams, | 60 void PreconnectStreams(int num_streams, |
| 52 const HttpRequestInfo& info, | 61 const HttpRequestInfo& info, |
| 53 const SSLConfig& server_ssl_config, | 62 const SSLConfig& server_ssl_config, |
| 54 const SSLConfig& proxy_ssl_config) override; | 63 const SSLConfig& proxy_ssl_config) override; |
| 55 const HostMappingRules* GetHostMappingRules() const override; | 64 const HostMappingRules* GetHostMappingRules() const override; |
| 56 | 65 |
| 57 size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); } | 66 size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); } |
| 58 | 67 |
| 59 private: | 68 private: |
| 60 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority); | 69 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 // deleted when the factory is destroyed. | 135 // deleted when the factory is destroyed. |
| 127 std::set<const Job*> preconnect_job_set_; | 136 std::set<const Job*> preconnect_job_set_; |
| 128 | 137 |
| 129 const bool for_websockets_; | 138 const bool for_websockets_; |
| 130 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); | 139 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); |
| 131 }; | 140 }; |
| 132 | 141 |
| 133 } // namespace net | 142 } // namespace net |
| 134 | 143 |
| 135 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 144 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| OLD | NEW |