| 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> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 class HttpNetworkSession; | 23 class HttpNetworkSession; |
| 24 class SpdySession; | 24 class SpdySession; |
| 25 | 25 |
| 26 class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory { | 26 class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory { |
| 27 public: | 27 public: |
| 28 // RequestStream may only be called if |for_websockets| is false. | 28 // RequestStream may only be called if |for_websockets| is false. |
| 29 // RequestWebSocketHandshakeStream may only be called if |for_websockets| | 29 // RequestWebSocketHandshakeStream may only be called if |for_websockets| |
| 30 // is true. | 30 // is true. |
| 31 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); | 31 HttpStreamFactoryImpl(HttpNetworkSession* session, bool for_websockets); |
| 32 virtual ~HttpStreamFactoryImpl(); | 32 ~HttpStreamFactoryImpl() override; |
| 33 | 33 |
| 34 // HttpStreamFactory interface | 34 // HttpStreamFactory interface |
| 35 virtual HttpStreamRequest* RequestStream( | 35 HttpStreamRequest* RequestStream(const HttpRequestInfo& info, |
| 36 RequestPriority priority, |
| 37 const SSLConfig& server_ssl_config, |
| 38 const SSLConfig& proxy_ssl_config, |
| 39 HttpStreamRequest::Delegate* delegate, |
| 40 const BoundNetLog& net_log) override; |
| 41 |
| 42 HttpStreamRequest* RequestWebSocketHandshakeStream( |
| 36 const HttpRequestInfo& info, | 43 const HttpRequestInfo& info, |
| 37 RequestPriority priority, | 44 RequestPriority priority, |
| 38 const SSLConfig& server_ssl_config, | 45 const SSLConfig& server_ssl_config, |
| 39 const SSLConfig& proxy_ssl_config, | |
| 40 HttpStreamRequest::Delegate* delegate, | |
| 41 const BoundNetLog& net_log) override; | |
| 42 | |
| 43 virtual HttpStreamRequest* RequestWebSocketHandshakeStream( | |
| 44 const HttpRequestInfo& info, | |
| 45 RequestPriority priority, | |
| 46 const SSLConfig& server_ssl_config, | |
| 47 const SSLConfig& proxy_ssl_config, | 46 const SSLConfig& proxy_ssl_config, |
| 48 HttpStreamRequest::Delegate* delegate, | 47 HttpStreamRequest::Delegate* delegate, |
| 49 WebSocketHandshakeStreamBase::CreateHelper* create_helper, | 48 WebSocketHandshakeStreamBase::CreateHelper* create_helper, |
| 50 const BoundNetLog& net_log) override; | 49 const BoundNetLog& net_log) override; |
| 51 | 50 |
| 52 virtual void PreconnectStreams(int num_streams, | 51 void PreconnectStreams(int num_streams, |
| 53 const HttpRequestInfo& info, | 52 const HttpRequestInfo& info, |
| 54 RequestPriority priority, | 53 RequestPriority priority, |
| 55 const SSLConfig& server_ssl_config, | 54 const SSLConfig& server_ssl_config, |
| 56 const SSLConfig& proxy_ssl_config) override; | 55 const SSLConfig& proxy_ssl_config) override; |
| 57 virtual const HostMappingRules* GetHostMappingRules() const override; | 56 const HostMappingRules* GetHostMappingRules() const override; |
| 58 | 57 |
| 59 size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); } | 58 size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); } |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority); | 61 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority); |
| 63 | 62 |
| 64 class NET_EXPORT_PRIVATE Request; | 63 class NET_EXPORT_PRIVATE Request; |
| 65 class NET_EXPORT_PRIVATE Job; | 64 class NET_EXPORT_PRIVATE Job; |
| 66 | 65 |
| 67 typedef std::set<Request*> RequestSet; | 66 typedef std::set<Request*> RequestSet; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // deleted when the factory is destroyed. | 129 // deleted when the factory is destroyed. |
| 131 std::set<const Job*> preconnect_job_set_; | 130 std::set<const Job*> preconnect_job_set_; |
| 132 | 131 |
| 133 const bool for_websockets_; | 132 const bool for_websockets_; |
| 134 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); | 133 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); |
| 135 }; | 134 }; |
| 136 | 135 |
| 137 } // namespace net | 136 } // namespace net |
| 138 | 137 |
| 139 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ | 138 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ |
| OLD | NEW |