| 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_QUIC_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "net/base/address_list.h" | 15 #include "net/base/address_list.h" |
| 16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 17 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
| 18 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
| 19 #include "net/cert/cert_database.h" | 19 #include "net/cert/cert_database.h" |
| 20 #include "net/log/net_log.h" | 20 #include "net/log/net_log.h" |
| 21 #include "net/proxy/proxy_server.h" | 21 #include "net/proxy/proxy_server.h" |
| 22 #include "net/quic/network_connection.h" | 22 #include "net/quic/network_connection.h" |
| 23 #include "net/quic/quic_chromium_client_session.h" | 23 #include "net/quic/quic_chromium_client_session.h" |
| 24 #include "net/quic/quic_config.h" | 24 #include "net/quic/quic_config.h" |
| 25 #include "net/quic/quic_crypto_stream.h" | 25 #include "net/quic/quic_crypto_stream.h" |
| 26 #include "net/quic/quic_http_stream.h" | 26 #include "net/quic/quic_http_stream.h" |
| 27 #include "net/quic/quic_protocol.h" | 27 #include "net/quic/quic_protocol.h" |
| 28 #include "net/ssl/ssl_config_service.h" |
| 28 | 29 |
| 29 namespace net { | 30 namespace net { |
| 30 | 31 |
| 31 class CertPolicyEnforcer; | 32 class CertPolicyEnforcer; |
| 32 class CertVerifier; | 33 class CertVerifier; |
| 33 class ChannelIDService; | 34 class ChannelIDService; |
| 34 class ClientSocketFactory; | 35 class ClientSocketFactory; |
| 35 class HostResolver; | 36 class HostResolver; |
| 36 class HttpServerProperties; | 37 class HttpServerProperties; |
| 37 class QuicClock; | 38 class QuicClock; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 CompletionCallback callback_; | 92 CompletionCallback callback_; |
| 92 scoped_ptr<QuicHttpStream> stream_; | 93 scoped_ptr<QuicHttpStream> stream_; |
| 93 | 94 |
| 94 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); | 95 DISALLOW_COPY_AND_ASSIGN(QuicStreamRequest); |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 // A factory for creating new QuicHttpStreams on top of a pool of | 98 // A factory for creating new QuicHttpStreams on top of a pool of |
| 98 // QuicChromiumClientSessions. | 99 // QuicChromiumClientSessions. |
| 99 class NET_EXPORT_PRIVATE QuicStreamFactory | 100 class NET_EXPORT_PRIVATE QuicStreamFactory |
| 100 : public NetworkChangeNotifier::IPAddressObserver, | 101 : public NetworkChangeNotifier::IPAddressObserver, |
| 102 public SSLConfigService::Observer, |
| 101 public CertDatabase::Observer { | 103 public CertDatabase::Observer { |
| 102 public: | 104 public: |
| 103 QuicStreamFactory( | 105 QuicStreamFactory( |
| 104 HostResolver* host_resolver, | 106 HostResolver* host_resolver, |
| 105 ClientSocketFactory* client_socket_factory, | 107 ClientSocketFactory* client_socket_factory, |
| 106 base::WeakPtr<HttpServerProperties> http_server_properties, | 108 base::WeakPtr<HttpServerProperties> http_server_properties, |
| 107 CertVerifier* cert_verifier, | 109 CertVerifier* cert_verifier, |
| 108 CertPolicyEnforcer* cert_policy_enforcer, | 110 CertPolicyEnforcer* cert_policy_enforcer, |
| 109 ChannelIDService* channel_id_service, | 111 ChannelIDService* channel_id_service, |
| 110 TransportSecurityState* transport_security_state, | 112 TransportSecurityState* transport_security_state, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 191 |
| 190 // Delete all cached state objects in |crypto_config_|. | 192 // Delete all cached state objects in |crypto_config_|. |
| 191 void ClearCachedStatesInCryptoConfig(); | 193 void ClearCachedStatesInCryptoConfig(); |
| 192 | 194 |
| 193 // NetworkChangeNotifier::IPAddressObserver methods: | 195 // NetworkChangeNotifier::IPAddressObserver methods: |
| 194 | 196 |
| 195 // Until the servers support roaming, close all connections when the local | 197 // Until the servers support roaming, close all connections when the local |
| 196 // IP address changes. | 198 // IP address changes. |
| 197 void OnIPAddressChanged() override; | 199 void OnIPAddressChanged() override; |
| 198 | 200 |
| 201 // SSLConfigService::Observer methods: |
| 202 |
| 203 // We perform the same flushing as described above when SSL settings change. |
| 204 void OnSSLConfigChanged() override; |
| 205 |
| 199 // CertDatabase::Observer methods: | 206 // CertDatabase::Observer methods: |
| 200 | 207 |
| 201 // We close all sessions when certificate database is changed. | 208 // We close all sessions when certificate database is changed. |
| 202 void OnCertAdded(const X509Certificate* cert) override; | 209 void OnCertAdded(const X509Certificate* cert) override; |
| 203 void OnCACertChanged(const X509Certificate* cert) override; | 210 void OnCACertChanged(const X509Certificate* cert) override; |
| 204 | 211 |
| 205 bool require_confirmation() const { | 212 bool require_confirmation() const { |
| 206 return require_confirmation_; | 213 return require_confirmation_; |
| 207 } | 214 } |
| 208 | 215 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 base::TaskRunner* task_runner_; | 434 base::TaskRunner* task_runner_; |
| 428 | 435 |
| 429 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 436 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
| 430 | 437 |
| 431 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 438 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
| 432 }; | 439 }; |
| 433 | 440 |
| 434 } // namespace net | 441 } // namespace net |
| 435 | 442 |
| 436 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 443 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| OLD | NEW |