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

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

Issue 10203002: Make URLRequestThrottlerManager a member of URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR (pure merge) Created 8 years, 7 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 | 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 #include "net/spdy/spdy_test_util_spdy2.h" 5 #include "net/spdy/spdy_test_util_spdy2.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "net/base/mock_cert_verifier.h" 13 #include "net/base/mock_cert_verifier.h"
14 #include "net/http/http_network_session.h" 14 #include "net/http/http_network_session.h"
15 #include "net/http/http_network_transaction.h" 15 #include "net/http/http_network_transaction.h"
16 #include "net/http/http_server_properties_impl.h" 16 #include "net/http/http_server_properties_impl.h"
17 #include "net/spdy/buffered_spdy_framer.h" 17 #include "net/spdy/buffered_spdy_framer.h"
18 #include "net/spdy/spdy_http_utils.h" 18 #include "net/spdy/spdy_http_utils.h"
19 #include "net/spdy/spdy_session.h" 19 #include "net/spdy/spdy_session.h"
20 #include "net/url_request/url_request_throttler_manager.h"
20 21
21 namespace net { 22 namespace net {
22 namespace test_spdy2 { 23 namespace test_spdy2 {
23 24
24 namespace { 25 namespace {
25 26
26 // Parses a URL into the scheme, host, and path components required for a 27 // Parses a URL into the scheme, host, and path components required for a
27 // SPDY request. 28 // SPDY request.
28 void ParseUrl(const char* const url, std::string* scheme, std::string* host, 29 void ParseUrl(const char* const url, std::string* scheme, std::string* host,
29 std::string* path) { 30 std::string* path) {
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 961
961 SpdyURLRequestContext::SpdyURLRequestContext() 962 SpdyURLRequestContext::SpdyURLRequestContext()
962 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) { 963 : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
963 storage_.set_host_resolver(new MockHostResolver()); 964 storage_.set_host_resolver(new MockHostResolver());
964 storage_.set_cert_verifier(new MockCertVerifier); 965 storage_.set_cert_verifier(new MockCertVerifier);
965 storage_.set_proxy_service(ProxyService::CreateDirect()); 966 storage_.set_proxy_service(ProxyService::CreateDirect());
966 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); 967 storage_.set_ssl_config_service(new SSLConfigServiceDefaults);
967 storage_.set_http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault( 968 storage_.set_http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault(
968 host_resolver())); 969 host_resolver()));
969 storage_.set_http_server_properties(new HttpServerPropertiesImpl); 970 storage_.set_http_server_properties(new HttpServerPropertiesImpl);
971 storage_.set_throttler_manager(new URLRequestThrottlerManager);
970 net::HttpNetworkSession::Params params; 972 net::HttpNetworkSession::Params params;
971 params.client_socket_factory = &socket_factory_; 973 params.client_socket_factory = &socket_factory_;
972 params.host_resolver = host_resolver(); 974 params.host_resolver = host_resolver();
973 params.cert_verifier = cert_verifier(); 975 params.cert_verifier = cert_verifier();
974 params.proxy_service = proxy_service(); 976 params.proxy_service = proxy_service();
975 params.ssl_config_service = ssl_config_service(); 977 params.ssl_config_service = ssl_config_service();
976 params.http_auth_handler_factory = http_auth_handler_factory(); 978 params.http_auth_handler_factory = http_auth_handler_factory();
977 params.network_delegate = network_delegate(); 979 params.network_delegate = network_delegate();
978 params.http_server_properties = http_server_properties(); 980 params.http_server_properties = http_server_properties();
979 scoped_refptr<HttpNetworkSession> network_session( 981 scoped_refptr<HttpNetworkSession> network_session(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 } 1013 }
1012 1014
1013 SpdyTestStateHelper::~SpdyTestStateHelper() { 1015 SpdyTestStateHelper::~SpdyTestStateHelper() {
1014 SpdySession::ResetStaticSettingsToInit(); 1016 SpdySession::ResetStaticSettingsToInit();
1015 // TODO(rch): save/restore this value 1017 // TODO(rch): save/restore this value
1016 BufferedSpdyFramer::set_enable_compression_default(true); 1018 BufferedSpdyFramer::set_enable_compression_default(true);
1017 } 1019 }
1018 1020
1019 } // namespace test_spdy2 1021 } // namespace test_spdy2
1020 } // namespace net 1022 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698