OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 // HttpNetworkTransaction. | 186 // HttpNetworkTransaction. |
187 struct SpdySessionDependencies { | 187 struct SpdySessionDependencies { |
188 // Default set of dependencies -- "null" proxy service. | 188 // Default set of dependencies -- "null" proxy service. |
189 explicit SpdySessionDependencies(NextProto protocol); | 189 explicit SpdySessionDependencies(NextProto protocol); |
190 | 190 |
191 // Custom proxy service dependency. | 191 // Custom proxy service dependency. |
192 SpdySessionDependencies(NextProto protocol, ProxyService* proxy_service); | 192 SpdySessionDependencies(NextProto protocol, ProxyService* proxy_service); |
193 | 193 |
194 ~SpdySessionDependencies(); | 194 ~SpdySessionDependencies(); |
195 | 195 |
196 static HttpNetworkSession* SpdyCreateSession( | 196 static scoped_ptr<HttpNetworkSession> SpdyCreateSession( |
197 SpdySessionDependencies* session_deps); | 197 SpdySessionDependencies* session_deps); |
198 static HttpNetworkSession* SpdyCreateSessionDeterministic( | 198 static scoped_ptr<HttpNetworkSession> SpdyCreateSessionDeterministic( |
199 SpdySessionDependencies* session_deps); | 199 SpdySessionDependencies* session_deps); |
200 static HttpNetworkSession::Params CreateSessionParams( | 200 static HttpNetworkSession::Params CreateSessionParams( |
201 SpdySessionDependencies* session_deps); | 201 SpdySessionDependencies* session_deps); |
202 | 202 |
203 // NOTE: host_resolver must be ordered before http_auth_handler_factory. | 203 // NOTE: host_resolver must be ordered before http_auth_handler_factory. |
204 scoped_ptr<MockHostResolverBase> host_resolver; | 204 scoped_ptr<MockHostResolverBase> host_resolver; |
205 scoped_ptr<CertVerifier> cert_verifier; | 205 scoped_ptr<CertVerifier> cert_verifier; |
206 scoped_ptr<TransportSecurityState> transport_security_state; | 206 scoped_ptr<TransportSecurityState> transport_security_state; |
207 scoped_ptr<ProxyService> proxy_service; | 207 scoped_ptr<ProxyService> proxy_service; |
208 scoped_refptr<SSLConfigService> ssl_config_service; | 208 scoped_refptr<SSLConfigService> ssl_config_service; |
(...skipping 27 matching lines...) Expand all Loading... | |
236 URLRequestContextStorage storage_; | 236 URLRequestContextStorage storage_; |
237 }; | 237 }; |
238 | 238 |
239 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL. | 239 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL. |
240 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key); | 240 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key); |
241 | 241 |
242 // Creates a SPDY session for the given key and puts it in the SPDY | 242 // Creates a SPDY session for the given key and puts it in the SPDY |
243 // session pool in |http_session|. A SPDY session for |key| must not | 243 // session pool in |http_session|. A SPDY session for |key| must not |
244 // already exist. | 244 // already exist. |
245 base::WeakPtr<SpdySession> CreateInsecureSpdySession( | 245 base::WeakPtr<SpdySession> CreateInsecureSpdySession( |
246 const scoped_refptr<HttpNetworkSession>& http_session, | 246 const scoped_ptr<HttpNetworkSession>& http_session, |
pauljensen
2015/09/02 14:32:30
Should be a raw pointer.
mmenke
2015/09/02 16:29:34
Done. Also searched the entire CL for this mistak
| |
247 const SpdySessionKey& key, | 247 const SpdySessionKey& key, |
248 const BoundNetLog& net_log); | 248 const BoundNetLog& net_log); |
249 | 249 |
250 // Tries to create a SPDY session for the given key but expects the | 250 // Tries to create a SPDY session for the given key but expects the |
251 // attempt to fail with the given error. A SPDY session for |key| must | 251 // attempt to fail with the given error. A SPDY session for |key| must |
252 // not already exist. The session will be created but close in the | 252 // not already exist. The session will be created but close in the |
253 // next event loop iteration. | 253 // next event loop iteration. |
254 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure( | 254 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure( |
255 const scoped_refptr<HttpNetworkSession>& http_session, | 255 const scoped_ptr<HttpNetworkSession>& http_session, |
pauljensen
2015/09/02 14:32:30
ditto
mmenke
2015/09/02 16:29:34
Done.
| |
256 const SpdySessionKey& key, | 256 const SpdySessionKey& key, |
257 Error expected_error, | 257 Error expected_error, |
258 const BoundNetLog& net_log); | 258 const BoundNetLog& net_log); |
259 | 259 |
260 // Like CreateInsecureSpdySession(), but uses TLS. | 260 // Like CreateInsecureSpdySession(), but uses TLS. |
261 base::WeakPtr<SpdySession> CreateSecureSpdySession( | 261 base::WeakPtr<SpdySession> CreateSecureSpdySession( |
262 const scoped_refptr<HttpNetworkSession>& http_session, | 262 const scoped_ptr<HttpNetworkSession>& http_session, |
pauljensen
2015/09/02 14:32:30
ditto
mmenke
2015/09/02 16:29:34
Done.
| |
263 const SpdySessionKey& key, | 263 const SpdySessionKey& key, |
264 const BoundNetLog& net_log); | 264 const BoundNetLog& net_log); |
265 | 265 |
266 // Creates an insecure SPDY session for the given key and puts it in | 266 // Creates an insecure SPDY session for the given key and puts it in |
267 // |pool|. The returned session will neither receive nor send any | 267 // |pool|. The returned session will neither receive nor send any |
268 // data. A SPDY session for |key| must not already exist. | 268 // data. A SPDY session for |key| must not already exist. |
269 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool, | 269 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool, |
270 const SpdySessionKey& key); | 270 const SpdySessionKey& key); |
271 | 271 |
272 // Tries to create an insecure SPDY session for the given key but | 272 // Tries to create an insecure SPDY session for the given key but |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
586 int64* content_length) const; | 586 int64* content_length) const; |
587 | 587 |
588 const NextProto protocol_; | 588 const NextProto protocol_; |
589 const SpdyMajorVersion spdy_version_; | 589 const SpdyMajorVersion spdy_version_; |
590 GURL default_url_; | 590 GURL default_url_; |
591 }; | 591 }; |
592 | 592 |
593 } // namespace net | 593 } // namespace net |
594 | 594 |
595 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 595 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
OLD | NEW |