| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ | 5 #ifndef CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ |
| 6 #define CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ | 6 #define CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/content_browser_client.h" | 9 #include "content/public/browser/content_browser_client.h" |
| 10 #include "net/http/http_network_session.h" | 10 #include "net/http/http_network_session.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 net::HostResolver* host_resolver() const { | 54 net::HostResolver* host_resolver() const { |
| 55 return host_resolver_.get(); | 55 return host_resolver_.get(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 // Initialize the CastNetworkDelegate objects. This needs to be done | 58 // Initialize the CastNetworkDelegate objects. This needs to be done |
| 59 // after the CastService is created, but before any URL requests are made. | 59 // after the CastService is created, but before any URL requests are made. |
| 60 void InitializeNetworkDelegates(); | 60 void InitializeNetworkDelegates(); |
| 61 | 61 |
| 62 void DisableQuic(); |
| 63 |
| 62 private: | 64 private: |
| 63 class URLRequestContextGetter; | 65 class URLRequestContextGetter; |
| 64 class MainURLRequestContextGetter; | 66 class MainURLRequestContextGetter; |
| 65 friend class URLRequestContextGetter; | 67 friend class URLRequestContextGetter; |
| 66 friend class MainURLRequestContextGetter; | 68 friend class MainURLRequestContextGetter; |
| 67 | 69 |
| 68 void InitializeSystemContextDependencies(); | 70 void InitializeSystemContextDependencies(); |
| 69 void InitializeMainContextDependencies( | 71 void InitializeMainContextDependencies( |
| 70 net::HttpTransactionFactory* factory, | 72 net::HttpTransactionFactory* factory, |
| 71 content::ProtocolHandlerMap* protocol_handlers, | 73 content::ProtocolHandlerMap* protocol_handlers, |
| 72 content::URLRequestInterceptorScopedVector request_interceptors); | 74 content::URLRequestInterceptorScopedVector request_interceptors); |
| 73 void InitializeMediaContextDependencies(net::HttpTransactionFactory* factory); | 75 void InitializeMediaContextDependencies(net::HttpTransactionFactory* factory); |
| 74 | 76 |
| 75 void PopulateNetworkSessionParams(bool ignore_certificate_errors, | 77 void PopulateNetworkSessionParams(bool ignore_certificate_errors, |
| 76 net::HttpNetworkSession::Params* params); | 78 net::HttpNetworkSession::Params* params); |
| 79 void DisableQuicOnBrowserIOThread(); |
| 77 | 80 |
| 78 // These are called by the RequestContextGetters to create each | 81 // These are called by the RequestContextGetters to create each |
| 79 // RequestContext. | 82 // RequestContext. |
| 80 // They must be called on the IO thread. | 83 // They must be called on the IO thread. |
| 81 net::URLRequestContext* CreateSystemRequestContext(); | 84 net::URLRequestContext* CreateSystemRequestContext(); |
| 82 net::URLRequestContext* CreateMediaRequestContext(); | 85 net::URLRequestContext* CreateMediaRequestContext(); |
| 83 net::URLRequestContext* CreateMainRequestContext( | 86 net::URLRequestContext* CreateMainRequestContext( |
| 84 content::BrowserContext* browser_context, | 87 content::BrowserContext* browser_context, |
| 85 content::ProtocolHandlerMap* protocol_handlers, | 88 content::ProtocolHandlerMap* protocol_handlers, |
| 86 content::URLRequestInterceptorScopedVector request_interceptors); | 89 content::URLRequestInterceptorScopedVector request_interceptors); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 114 std::unique_ptr<net::URLRequestJobFactory> system_job_factory_; | 117 std::unique_ptr<net::URLRequestJobFactory> system_job_factory_; |
| 115 | 118 |
| 116 bool main_dependencies_initialized_; | 119 bool main_dependencies_initialized_; |
| 117 std::unique_ptr<net::HttpTransactionFactory> main_transaction_factory_; | 120 std::unique_ptr<net::HttpTransactionFactory> main_transaction_factory_; |
| 118 std::unique_ptr<net::CookieStore> main_cookie_store_; | 121 std::unique_ptr<net::CookieStore> main_cookie_store_; |
| 119 std::unique_ptr<net::URLRequestJobFactory> main_job_factory_; | 122 std::unique_ptr<net::URLRequestJobFactory> main_job_factory_; |
| 120 | 123 |
| 121 bool media_dependencies_initialized_; | 124 bool media_dependencies_initialized_; |
| 122 std::unique_ptr<net::HttpTransactionFactory> media_transaction_factory_; | 125 std::unique_ptr<net::HttpTransactionFactory> media_transaction_factory_; |
| 123 | 126 |
| 127 // Determines if QUIC is enabled for a URLContextGetter when it is created. |
| 128 // QUIC can be disabled at runtime by calling DisableQuic() above. |
| 129 // Only accessed on content::BrowserThread::IO thread. |
| 130 bool enable_quic_; |
| 131 |
| 124 net::NetLog* net_log_; | 132 net::NetLog* net_log_; |
| 125 }; | 133 }; |
| 126 | 134 |
| 127 } // namespace shell | 135 } // namespace shell |
| 128 } // namespace chromecast | 136 } // namespace chromecast |
| 129 | 137 |
| 130 #endif // CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ | 138 #endif // CHROMECAST_BROWSER_URL_REQUEST_CONTEXT_FACTORY_H_ |
| OLD | NEW |