OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_NETWORK_LAYER_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_LAYER_H_ |
6 #define NET_HTTP_HTTP_NETWORK_LAYER_H_ | 6 #define NET_HTTP_HTTP_NETWORK_LAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 HostResolver* host_resolver, | 71 HostResolver* host_resolver, |
72 CertVerifier* cert_verifier, | 72 CertVerifier* cert_verifier, |
73 DnsRRResolver* dnsrr_resolver, | 73 DnsRRResolver* dnsrr_resolver, |
74 DnsCertProvenanceChecker* dns_cert_checker, | 74 DnsCertProvenanceChecker* dns_cert_checker, |
75 SSLHostInfoFactory* ssl_host_info_factory, | 75 SSLHostInfoFactory* ssl_host_info_factory, |
76 ProxyService* proxy_service, | 76 ProxyService* proxy_service, |
77 SSLConfigService* ssl_config_service, | 77 SSLConfigService* ssl_config_service, |
78 HttpAuthHandlerFactory* http_auth_handler_factory, | 78 HttpAuthHandlerFactory* http_auth_handler_factory, |
79 HttpNetworkDelegate* network_delegate, | 79 HttpNetworkDelegate* network_delegate, |
80 NetLog* net_log); | 80 NetLog* net_log); |
| 81 |
81 // Create a transaction factory that instantiate a network layer over an | 82 // Create a transaction factory that instantiate a network layer over an |
82 // existing network session. Network session contains some valuable | 83 // existing network session. Network session contains some valuable |
83 // information (e.g. authentication data) that we want to share across | 84 // information (e.g. authentication data) that we want to share across |
84 // multiple network layers. This method exposes the implementation details | 85 // multiple network layers. This method exposes the implementation details |
85 // of a network layer, use this method with an existing network layer only | 86 // of a network layer, use this method with an existing network layer only |
86 // when network session is shared. | 87 // when network session is shared. |
87 static HttpTransactionFactory* CreateFactory(HttpNetworkSession* session); | 88 static HttpTransactionFactory* CreateFactory(HttpNetworkSession* session); |
88 | 89 |
89 // HttpTransactionFactory methods: | |
90 virtual int CreateTransaction(scoped_ptr<HttpTransaction>* trans); | |
91 virtual HttpCache* GetCache(); | |
92 virtual HttpNetworkSession* GetSession(); | |
93 virtual void Suspend(bool suspend); | |
94 | |
95 // Enable the spdy protocol. | 90 // Enable the spdy protocol. |
96 // Without calling this function, SPDY is disabled. The mode can be: | 91 // Without calling this function, SPDY is disabled. The mode can be: |
97 // "" : (default) SSL and compression are enabled, flow | 92 // "" : (default) SSL and compression are enabled, flow |
98 // control disabled. | 93 // control disabled. |
99 // "no-ssl" : disables SSL. | 94 // "no-ssl" : disables SSL. |
100 // "no-compress" : disables compression. | 95 // "no-compress" : disables compression. |
101 // "flow-control": enables flow control. | 96 // "flow-control": enables flow control. |
102 // "none" : disables both SSL and compression. | 97 // "none" : disables both SSL and compression. |
103 static void EnableSpdy(const std::string& mode); | 98 static void EnableSpdy(const std::string& mode); |
104 | 99 |
| 100 // HttpTransactionFactory methods: |
| 101 virtual int CreateTransaction(scoped_ptr<HttpTransaction>* trans); |
| 102 virtual HttpCache* GetCache(); |
| 103 virtual HttpNetworkSession* GetSession(); |
| 104 virtual void Suspend(bool suspend); |
| 105 |
105 private: | 106 private: |
106 // The factory we will use to create network sockets. | 107 // The factory we will use to create network sockets. |
107 ClientSocketFactory* socket_factory_; | 108 ClientSocketFactory* socket_factory_; |
108 | 109 |
109 // The host resolver, proxy service, etc. that will be used when lazily | 110 // The host resolver, proxy service, etc. that will be used when lazily |
110 // creating |session_|. | 111 // creating |session_|. |
111 HostResolver* host_resolver_; | 112 HostResolver* host_resolver_; |
112 CertVerifier* cert_verifier_; | 113 CertVerifier* cert_verifier_; |
113 DnsRRResolver* dnsrr_resolver_; | 114 DnsRRResolver* dnsrr_resolver_; |
114 DnsCertProvenanceChecker* dns_cert_checker_; | 115 DnsCertProvenanceChecker* dns_cert_checker_; |
115 SSLHostInfoFactory* ssl_host_info_factory_; | 116 SSLHostInfoFactory* ssl_host_info_factory_; |
116 scoped_refptr<ProxyService> proxy_service_; | 117 scoped_refptr<ProxyService> proxy_service_; |
117 | 118 |
118 // The SSL config service being used for the session. | 119 // The SSL config service being used for the session. |
119 scoped_refptr<SSLConfigService> ssl_config_service_; | 120 scoped_refptr<SSLConfigService> ssl_config_service_; |
120 | 121 |
121 scoped_refptr<HttpNetworkSession> session_; | 122 scoped_refptr<HttpNetworkSession> session_; |
122 scoped_ptr<SpdySessionPool> spdy_session_pool_; | 123 scoped_ptr<SpdySessionPool> spdy_session_pool_; |
123 | 124 |
124 HttpAuthHandlerFactory* http_auth_handler_factory_; | 125 HttpAuthHandlerFactory* http_auth_handler_factory_; |
125 HttpNetworkDelegate* network_delegate_; | 126 HttpNetworkDelegate* network_delegate_; |
126 NetLog* net_log_; | 127 NetLog* net_log_; |
127 | 128 |
128 bool suspended_; | 129 bool suspended_; |
129 }; | 130 }; |
130 | 131 |
131 } // namespace net | 132 } // namespace net |
132 | 133 |
133 #endif // NET_HTTP_HTTP_NETWORK_LAYER_H_ | 134 #endif // NET_HTTP_HTTP_NETWORK_LAYER_H_ |
OLD | NEW |