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_TEST_UTIL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 void set_proxy_delegate(ProxyDelegate* proxy_delegate) { | 75 void set_proxy_delegate(ProxyDelegate* proxy_delegate) { |
76 proxy_delegate_ = proxy_delegate; | 76 proxy_delegate_ = proxy_delegate; |
77 } | 77 } |
78 | 78 |
79 void set_http_network_session_params( | 79 void set_http_network_session_params( |
80 std::unique_ptr<HttpNetworkSession::Params> params) { | 80 std::unique_ptr<HttpNetworkSession::Params> params) { |
81 http_network_session_params_ = std::move(params); | 81 http_network_session_params_ = std::move(params); |
82 } | 82 } |
83 | 83 |
| 84 void set_http_network_session_dynamic_shared_params( |
| 85 std::unique_ptr<HttpNetworkSession::DynamicSharedParams> |
| 86 dynamic_shared_params) { |
| 87 http_network_session_dynamic_shared_params_ = |
| 88 std::move(dynamic_shared_params); |
| 89 } |
| 90 |
84 void SetSdchManager(std::unique_ptr<SdchManager> sdch_manager) { | 91 void SetSdchManager(std::unique_ptr<SdchManager> sdch_manager) { |
85 context_storage_.set_sdch_manager(std::move(sdch_manager)); | 92 context_storage_.set_sdch_manager(std::move(sdch_manager)); |
86 } | 93 } |
87 | 94 |
88 void SetCTPolicyEnforcer( | 95 void SetCTPolicyEnforcer( |
89 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer) { | 96 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer) { |
90 context_storage_.set_ct_policy_enforcer(std::move(ct_policy_enforcer)); | 97 context_storage_.set_ct_policy_enforcer(std::move(ct_policy_enforcer)); |
91 } | 98 } |
92 | 99 |
93 private: | 100 private: |
94 bool initialized_ = false; | 101 bool initialized_ = false; |
95 | 102 |
96 // Optional parameters to override default values. Note that values that | 103 // Optional parameters to override default values. Note that values that |
97 // point to other objects the TestURLRequestContext creates will be | 104 // point to other objects the TestURLRequestContext creates will be |
98 // overwritten. | 105 // overwritten. |
99 std::unique_ptr<HttpNetworkSession::Params> http_network_session_params_; | 106 std::unique_ptr<HttpNetworkSession::Params> http_network_session_params_; |
100 | 107 |
| 108 // Optional dynamic shared parameters for the HttpNetworkSession. |
| 109 std::unique_ptr<HttpNetworkSession::DynamicSharedParams> |
| 110 http_network_session_dynamic_shared_params_; |
| 111 |
101 // Not owned: | 112 // Not owned: |
102 ClientSocketFactory* client_socket_factory_ = nullptr; | 113 ClientSocketFactory* client_socket_factory_ = nullptr; |
103 | 114 |
104 ProxyDelegate* proxy_delegate_ = nullptr; | 115 ProxyDelegate* proxy_delegate_ = nullptr; |
105 | 116 |
106 protected: | 117 protected: |
107 URLRequestContextStorage context_storage_; | 118 URLRequestContextStorage context_storage_; |
108 }; | 119 }; |
109 | 120 |
110 //----------------------------------------------------------------------------- | 121 //----------------------------------------------------------------------------- |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 NetworkDelegate* network_delegate) const override; | 435 NetworkDelegate* network_delegate) const override; |
425 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); | 436 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); |
426 | 437 |
427 private: | 438 private: |
428 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; | 439 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; |
429 }; | 440 }; |
430 | 441 |
431 } // namespace net | 442 } // namespace net |
432 | 443 |
433 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 444 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |