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

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

Issue 11348333: Clean up SpdySessionDependencies to remove code duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years 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 | Annotate | Revision Log
OLDNEW
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_SPDY_SPDY_TEST_UTIL_H_ 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_H_
6 #define NET_SPDY_SPDY_TEST_UTIL_H_ 6 #define NET_SPDY_SPDY_TEST_UTIL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "net/base/cert_verifier.h" 9 #include "net/base/cert_verifier.h"
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode); 333 MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode);
334 334
335 // Combines the given SpdyFrames into the given char array and returns 335 // Combines the given SpdyFrames into the given char array and returns
336 // the total length. 336 // the total length.
337 int CombineFrames(const SpdyFrame** frames, int num_frames, 337 int CombineFrames(const SpdyFrame** frames, int num_frames,
338 char* buff, int buff_len); 338 char* buff, int buff_len);
339 339
340 // Helper to manage the lifetimes of the dependencies for a 340 // Helper to manage the lifetimes of the dependencies for a
341 // HttpNetworkTransaction. 341 // HttpNetworkTransaction.
342 class SpdySessionDependencies { 342 class SpdySessionDependencies {
willchan no longer on Chromium 2012/12/01 21:00:22 We should probably make this a struct at some poin
Ryan Hamilton 2012/12/01 22:26:41 Done.
343 public: 343 public:
344 // Default set of dependencies -- "null" proxy service. 344 // Default set of dependencies -- "null" proxy service.
345 SpdySessionDependencies(); 345 SpdySessionDependencies();
346 346
347 // Custom proxy service dependency. 347 // Custom proxy service dependency.
348 explicit SpdySessionDependencies(ProxyService* proxy_service); 348 explicit SpdySessionDependencies(ProxyService* proxy_service);
349 349
350 ~SpdySessionDependencies(); 350 ~SpdySessionDependencies();
351 351
352 static HttpNetworkSession* SpdyCreateSession( 352 static HttpNetworkSession* SpdyCreateSession(
353 SpdySessionDependencies* session_deps); 353 SpdySessionDependencies* session_deps);
354 static HttpNetworkSession* SpdyCreateSessionDeterministic( 354 static HttpNetworkSession* SpdyCreateSessionDeterministic(
355 SpdySessionDependencies* session_deps); 355 SpdySessionDependencies* session_deps);
356 356
357 net::HttpNetworkSession::Params CreateSessionParams();
willchan no longer on Chromium 2012/12/01 21:00:22 If it would not require a lot of manual effort (yo
Ryan Hamilton 2012/12/01 22:26:41 Done. (only used in a couple places)
358
357 // NOTE: host_resolver must be ordered before http_auth_handler_factory. 359 // NOTE: host_resolver must be ordered before http_auth_handler_factory.
358 scoped_ptr<MockHostResolverBase> host_resolver; 360 scoped_ptr<MockHostResolverBase> host_resolver;
359 scoped_ptr<CertVerifier> cert_verifier; 361 scoped_ptr<CertVerifier> cert_verifier;
360 scoped_ptr<ProxyService> proxy_service; 362 scoped_ptr<ProxyService> proxy_service;
361 scoped_refptr<SSLConfigService> ssl_config_service; 363 scoped_refptr<SSLConfigService> ssl_config_service;
362 scoped_ptr<MockClientSocketFactory> socket_factory; 364 scoped_ptr<MockClientSocketFactory> socket_factory;
363 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory; 365 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory;
364 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; 366 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
365 HttpServerPropertiesImpl http_server_properties; 367 HttpServerPropertiesImpl http_server_properties;
366 std::string trusted_spdy_proxy; 368 std::string trusted_spdy_proxy;
369 NetLog* net_log;
367 }; 370 };
368 371
369 class SpdyURLRequestContext : public URLRequestContext { 372 class SpdyURLRequestContext : public URLRequestContext {
370 public: 373 public:
371 SpdyURLRequestContext(); 374 SpdyURLRequestContext();
372 virtual ~SpdyURLRequestContext(); 375 virtual ~SpdyURLRequestContext();
373 376
374 MockClientSocketFactory& socket_factory() { return socket_factory_; } 377 MockClientSocketFactory& socket_factory() { return socket_factory_; }
375 378
376 private: 379 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 422
420 private: 423 private:
421 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper); 424 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper);
422 }; 425 };
423 426
424 } // namespace test_spdy2 427 } // namespace test_spdy2
425 428
426 } // namespace net 429 } // namespace net
427 430
428 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ 431 #endif // NET_SPDY_SPDY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool_spdy3_unittest.cc ('k') | net/spdy/spdy_test_util_spdy2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698