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_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "build/buildflag.h" |
12 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
| 14 #include "net/net_features.h" |
13 | 15 |
14 namespace net { | 16 namespace net { |
15 | 17 |
16 class CertVerifier; | 18 class CertVerifier; |
17 class ChannelIDService; | 19 class ChannelIDService; |
18 class CookieStore; | 20 class CookieStore; |
19 class CTPolicyEnforcer; | 21 class CTPolicyEnforcer; |
20 class CTVerifier; | 22 class CTVerifier; |
21 class HostResolver; | 23 class HostResolver; |
22 class HttpAuthHandlerFactory; | 24 class HttpAuthHandlerFactory; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void set_http_network_session( | 74 void set_http_network_session( |
73 std::unique_ptr<HttpNetworkSession> http_network_session); | 75 std::unique_ptr<HttpNetworkSession> http_network_session); |
74 void set_http_transaction_factory( | 76 void set_http_transaction_factory( |
75 std::unique_ptr<HttpTransactionFactory> http_transaction_factory); | 77 std::unique_ptr<HttpTransactionFactory> http_transaction_factory); |
76 void set_job_factory(std::unique_ptr<URLRequestJobFactory> job_factory); | 78 void set_job_factory(std::unique_ptr<URLRequestJobFactory> job_factory); |
77 void set_throttler_manager( | 79 void set_throttler_manager( |
78 std::unique_ptr<URLRequestThrottlerManager> throttler_manager); | 80 std::unique_ptr<URLRequestThrottlerManager> throttler_manager); |
79 void set_http_user_agent_settings( | 81 void set_http_user_agent_settings( |
80 std::unique_ptr<HttpUserAgentSettings> http_user_agent_settings); | 82 std::unique_ptr<HttpUserAgentSettings> http_user_agent_settings); |
81 void set_sdch_manager(std::unique_ptr<SdchManager> sdch_manager); | 83 void set_sdch_manager(std::unique_ptr<SdchManager> sdch_manager); |
| 84 |
| 85 #if BUILDFLAG(ENABLE_REPORTING) |
82 void set_reporting_service( | 86 void set_reporting_service( |
83 std::unique_ptr<ReportingService> reporting_service); | 87 std::unique_ptr<ReportingService> reporting_service); |
| 88 #endif // BUILDFLAG(ENABLE_REPORTING) |
84 | 89 |
85 // Everything else can be access through the URLRequestContext, but this | 90 // Everything else can be access through the URLRequestContext, but this |
86 // cannot. Having an accessor for it makes usage a little cleaner. | 91 // cannot. Having an accessor for it makes usage a little cleaner. |
87 HttpNetworkSession* http_network_session() const { | 92 HttpNetworkSession* http_network_session() const { |
88 return http_network_session_.get(); | 93 return http_network_session_.get(); |
89 } | 94 } |
90 | 95 |
91 private: | 96 private: |
92 // Not owned. | 97 // Not owned. |
93 URLRequestContext* const context_; | 98 URLRequestContext* const context_; |
(...skipping 18 matching lines...) Expand all Loading... |
112 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer_; | 117 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer_; |
113 | 118 |
114 // Not actually pointed at by the URLRequestContext, but may be used (but not | 119 // Not actually pointed at by the URLRequestContext, but may be used (but not |
115 // owned) by the HttpTransactionFactory. | 120 // owned) by the HttpTransactionFactory. |
116 std::unique_ptr<HttpNetworkSession> http_network_session_; | 121 std::unique_ptr<HttpNetworkSession> http_network_session_; |
117 | 122 |
118 std::unique_ptr<HttpTransactionFactory> http_transaction_factory_; | 123 std::unique_ptr<HttpTransactionFactory> http_transaction_factory_; |
119 std::unique_ptr<URLRequestJobFactory> job_factory_; | 124 std::unique_ptr<URLRequestJobFactory> job_factory_; |
120 std::unique_ptr<URLRequestThrottlerManager> throttler_manager_; | 125 std::unique_ptr<URLRequestThrottlerManager> throttler_manager_; |
121 std::unique_ptr<SdchManager> sdch_manager_; | 126 std::unique_ptr<SdchManager> sdch_manager_; |
| 127 #if BUILDFLAG(ENABLE_REPORTING) |
122 std::unique_ptr<ReportingService> reporting_service_; | 128 std::unique_ptr<ReportingService> reporting_service_; |
| 129 #endif // BUILDFLAG(ENABLE_REPORTING) |
123 | 130 |
124 DISALLOW_COPY_AND_ASSIGN(URLRequestContextStorage); | 131 DISALLOW_COPY_AND_ASSIGN(URLRequestContextStorage); |
125 }; | 132 }; |
126 | 133 |
127 } // namespace net | 134 } // namespace net |
128 | 135 |
129 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ | 136 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_STORAGE_H_ |
OLD | NEW |