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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 client_socket_factory_ = factory; | 70 client_socket_factory_ = factory; |
71 } | 71 } |
72 | 72 |
73 ProxyDelegate* proxy_delegate() { return proxy_delegate_; } | 73 ProxyDelegate* proxy_delegate() { return proxy_delegate_; } |
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> session_params) { |
81 http_network_session_params_ = std::move(params); | 81 http_network_session_params_ = std::move(session_params); |
| 82 } |
| 83 |
| 84 void set_http_network_session_context( |
| 85 std::unique_ptr<HttpNetworkSession::Context> session_context) { |
| 86 http_network_session_context_ = std::move(session_context); |
82 } | 87 } |
83 | 88 |
84 void SetSdchManager(std::unique_ptr<SdchManager> sdch_manager) { | 89 void SetSdchManager(std::unique_ptr<SdchManager> sdch_manager) { |
85 context_storage_.set_sdch_manager(std::move(sdch_manager)); | 90 context_storage_.set_sdch_manager(std::move(sdch_manager)); |
86 } | 91 } |
87 | 92 |
88 void SetCTPolicyEnforcer( | 93 void SetCTPolicyEnforcer( |
89 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer) { | 94 std::unique_ptr<CTPolicyEnforcer> ct_policy_enforcer) { |
90 context_storage_.set_ct_policy_enforcer(std::move(ct_policy_enforcer)); | 95 context_storage_.set_ct_policy_enforcer(std::move(ct_policy_enforcer)); |
91 } | 96 } |
92 | 97 |
93 private: | 98 private: |
94 bool initialized_ = false; | 99 bool initialized_ = false; |
95 | 100 |
96 // Optional parameters to override default values. Note that values that | 101 // Optional parameters to override default values. Note that values in the |
97 // point to other objects the TestURLRequestContext creates will be | 102 // HttpNetworkSession::Context that point to other objects the |
98 // overwritten. | 103 // TestURLRequestContext creates will be overwritten. |
99 std::unique_ptr<HttpNetworkSession::Params> http_network_session_params_; | 104 std::unique_ptr<HttpNetworkSession::Params> http_network_session_params_; |
| 105 std::unique_ptr<HttpNetworkSession::Context> http_network_session_context_; |
100 | 106 |
101 // Not owned: | 107 // Not owned: |
102 ClientSocketFactory* client_socket_factory_ = nullptr; | 108 ClientSocketFactory* client_socket_factory_ = nullptr; |
103 | 109 |
104 ProxyDelegate* proxy_delegate_ = nullptr; | 110 ProxyDelegate* proxy_delegate_ = nullptr; |
105 | 111 |
106 protected: | 112 protected: |
107 URLRequestContextStorage context_storage_; | 113 URLRequestContextStorage context_storage_; |
108 }; | 114 }; |
109 | 115 |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 NetworkDelegate* network_delegate) const override; | 430 NetworkDelegate* network_delegate) const override; |
425 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); | 431 void set_main_intercept_job(std::unique_ptr<URLRequestJob> job); |
426 | 432 |
427 private: | 433 private: |
428 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; | 434 mutable std::unique_ptr<URLRequestJob> main_intercept_job_; |
429 }; | 435 }; |
430 | 436 |
431 } // namespace net | 437 } // namespace net |
432 | 438 |
433 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ | 439 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ |
OLD | NEW |