Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: net/spdy/spdy_test_util_common.h

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_stream_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 192 SpdySessionDependencies(NextProto protocol,
193 scoped_ptr<ProxyService> proxy_service); 193 scoped_ptr<ProxyService> proxy_service);
194 194
195 ~SpdySessionDependencies(); 195 ~SpdySessionDependencies();
196 196
197 static HttpNetworkSession* SpdyCreateSession( 197 static scoped_ptr<HttpNetworkSession> SpdyCreateSession(
198 SpdySessionDependencies* session_deps); 198 SpdySessionDependencies* session_deps);
199 static HttpNetworkSession* SpdyCreateSessionDeterministic( 199 static scoped_ptr<HttpNetworkSession> SpdyCreateSessionDeterministic(
200 SpdySessionDependencies* session_deps); 200 SpdySessionDependencies* session_deps);
201 static HttpNetworkSession::Params CreateSessionParams( 201 static HttpNetworkSession::Params CreateSessionParams(
202 SpdySessionDependencies* session_deps); 202 SpdySessionDependencies* session_deps);
203 203
204 // NOTE: host_resolver must be ordered before http_auth_handler_factory. 204 // NOTE: host_resolver must be ordered before http_auth_handler_factory.
205 scoped_ptr<MockHostResolverBase> host_resolver; 205 scoped_ptr<MockHostResolverBase> host_resolver;
206 scoped_ptr<CertVerifier> cert_verifier; 206 scoped_ptr<CertVerifier> cert_verifier;
207 scoped_ptr<TransportSecurityState> transport_security_state; 207 scoped_ptr<TransportSecurityState> transport_security_state;
208 scoped_ptr<ProxyService> proxy_service; 208 scoped_ptr<ProxyService> proxy_service;
209 scoped_refptr<SSLConfigService> ssl_config_service; 209 scoped_refptr<SSLConfigService> ssl_config_service;
(...skipping 27 matching lines...) Expand all
237 URLRequestContextStorage storage_; 237 URLRequestContextStorage storage_;
238 }; 238 };
239 239
240 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL. 240 // Equivalent to pool->GetIfExists(spdy_session_key, BoundNetLog()) != NULL.
241 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key); 241 bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key);
242 242
243 // Creates a SPDY session for the given key and puts it in the SPDY 243 // Creates a SPDY session for the given key and puts it in the SPDY
244 // session pool in |http_session|. A SPDY session for |key| must not 244 // session pool in |http_session|. A SPDY session for |key| must not
245 // already exist. 245 // already exist.
246 base::WeakPtr<SpdySession> CreateInsecureSpdySession( 246 base::WeakPtr<SpdySession> CreateInsecureSpdySession(
247 const scoped_refptr<HttpNetworkSession>& http_session, 247 HttpNetworkSession* http_session,
248 const SpdySessionKey& key, 248 const SpdySessionKey& key,
249 const BoundNetLog& net_log); 249 const BoundNetLog& net_log);
250 250
251 // Tries to create a SPDY session for the given key but expects the 251 // Tries to create a SPDY session for the given key but expects the
252 // attempt to fail with the given error. A SPDY session for |key| must 252 // attempt to fail with the given error. A SPDY session for |key| must
253 // not already exist. The session will be created but close in the 253 // not already exist. The session will be created but close in the
254 // next event loop iteration. 254 // next event loop iteration.
255 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure( 255 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure(
256 const scoped_refptr<HttpNetworkSession>& http_session, 256 HttpNetworkSession* http_session,
257 const SpdySessionKey& key, 257 const SpdySessionKey& key,
258 Error expected_error, 258 Error expected_error,
259 const BoundNetLog& net_log); 259 const BoundNetLog& net_log);
260 260
261 // Like CreateInsecureSpdySession(), but uses TLS. 261 // Like CreateInsecureSpdySession(), but uses TLS.
262 base::WeakPtr<SpdySession> CreateSecureSpdySession( 262 base::WeakPtr<SpdySession> CreateSecureSpdySession(
263 const scoped_refptr<HttpNetworkSession>& http_session, 263 HttpNetworkSession* http_session,
264 const SpdySessionKey& key, 264 const SpdySessionKey& key,
265 const BoundNetLog& net_log); 265 const BoundNetLog& net_log);
266 266
267 // Creates an insecure SPDY session for the given key and puts it in 267 // Creates an insecure SPDY session for the given key and puts it in
268 // |pool|. The returned session will neither receive nor send any 268 // |pool|. The returned session will neither receive nor send any
269 // data. A SPDY session for |key| must not already exist. 269 // data. A SPDY session for |key| must not already exist.
270 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool, 270 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool,
271 const SpdySessionKey& key); 271 const SpdySessionKey& key);
272 272
273 // Tries to create an insecure SPDY session for the given key but 273 // Tries to create an insecure SPDY session for the given key but
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 int64* content_length) const; 585 int64* content_length) const;
586 586
587 const NextProto protocol_; 587 const NextProto protocol_;
588 const SpdyMajorVersion spdy_version_; 588 const SpdyMajorVersion spdy_version_;
589 GURL default_url_; 589 GURL default_url_;
590 }; 590 };
591 591
592 } // namespace net 592 } // namespace net
593 593
594 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ 594 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream_unittest.cc ('k') | net/spdy/spdy_test_util_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698