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

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

Issue 11348333: Clean up SpdySessionDependencies to remove code duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Comments 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
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.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) 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 "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/cert_verifier.h" 10 #include "net/base/cert_verifier.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 338
339 MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode); 339 MockRead CreateMockRead(const SpdyFrame& resp, int seq, IoMode mode);
340 340
341 // Combines the given SpdyFrames into the given char array and returns 341 // Combines the given SpdyFrames into the given char array and returns
342 // the total length. 342 // the total length.
343 int CombineFrames(const SpdyFrame** frames, int num_frames, 343 int CombineFrames(const SpdyFrame** frames, int num_frames,
344 char* buff, int buff_len); 344 char* buff, int buff_len);
345 345
346 // Helper to manage the lifetimes of the dependencies for a 346 // Helper to manage the lifetimes of the dependencies for a
347 // HttpNetworkTransaction. 347 // HttpNetworkTransaction.
348 class SpdySessionDependencies { 348 struct SpdySessionDependencies {
349 public:
350 // Default set of dependencies -- "null" proxy service. 349 // Default set of dependencies -- "null" proxy service.
351 SpdySessionDependencies(); 350 SpdySessionDependencies();
352 351
353 // Custom proxy service dependency. 352 // Custom proxy service dependency.
354 explicit SpdySessionDependencies(ProxyService* proxy_service); 353 explicit SpdySessionDependencies(ProxyService* proxy_service);
355 354
356 ~SpdySessionDependencies(); 355 ~SpdySessionDependencies();
357 356
358 static HttpNetworkSession* SpdyCreateSession( 357 static HttpNetworkSession* SpdyCreateSession(
359 SpdySessionDependencies* session_deps); 358 SpdySessionDependencies* session_deps);
360 static HttpNetworkSession* SpdyCreateSessionDeterministic( 359 static HttpNetworkSession* SpdyCreateSessionDeterministic(
361 SpdySessionDependencies* session_deps); 360 SpdySessionDependencies* session_deps);
361 static HttpNetworkSession::Params CreateSessionParams(
362 SpdySessionDependencies* session_deps);
362 363
363 // NOTE: host_resolver must be ordered before http_auth_handler_factory. 364 // NOTE: host_resolver must be ordered before http_auth_handler_factory.
364 scoped_ptr<MockHostResolverBase> host_resolver; 365 scoped_ptr<MockHostResolverBase> host_resolver;
365 scoped_ptr<CertVerifier> cert_verifier; 366 scoped_ptr<CertVerifier> cert_verifier;
366 scoped_ptr<ProxyService> proxy_service; 367 scoped_ptr<ProxyService> proxy_service;
367 scoped_refptr<SSLConfigService> ssl_config_service; 368 scoped_refptr<SSLConfigService> ssl_config_service;
368 scoped_ptr<MockClientSocketFactory> socket_factory; 369 scoped_ptr<MockClientSocketFactory> socket_factory;
369 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory; 370 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory;
370 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; 371 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory;
371 HttpServerPropertiesImpl http_server_properties; 372 HttpServerPropertiesImpl http_server_properties;
372 std::string trusted_spdy_proxy; 373 std::string trusted_spdy_proxy;
374 NetLog* net_log;
373 }; 375 };
374 376
375 class SpdyURLRequestContext : public URLRequestContext { 377 class SpdyURLRequestContext : public URLRequestContext {
376 public: 378 public:
377 SpdyURLRequestContext(); 379 SpdyURLRequestContext();
378 virtual ~SpdyURLRequestContext(); 380 virtual ~SpdyURLRequestContext();
379 381
380 MockClientSocketFactory& socket_factory() { return socket_factory_; } 382 MockClientSocketFactory& socket_factory() { return socket_factory_; }
381 383
382 private: 384 private:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 scoped_ptr<crypto::ECSignatureCreatorFactory> ec_signature_creator_factory_; 432 scoped_ptr<crypto::ECSignatureCreatorFactory> ec_signature_creator_factory_;
431 433
432 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper); 434 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper);
433 }; 435 };
434 436
435 } // namespace test_spdy3 437 } // namespace test_spdy3
436 438
437 } // namespace net 439 } // namespace net
438 440
439 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ 441 #endif // NET_SPDY_SPDY_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_spdy2.cc ('k') | net/spdy/spdy_test_util_spdy3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698