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

Side by Side Diff: net/cert_net/cert_net_fetcher_impl_unittest.cc

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 | « jingle/glue/proxy_resolving_client_socket.cc ('k') | net/http/http_cache.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/cert_net/cert_net_fetcher_impl.h" 5 #include "net/cert_net/cert_net_fetcher_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 storage_.set_http_server_properties( 42 storage_.set_http_server_properties(
43 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); 43 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
44 44
45 HttpNetworkSession::Params params; 45 HttpNetworkSession::Params params;
46 params.host_resolver = host_resolver(); 46 params.host_resolver = host_resolver();
47 params.cert_verifier = cert_verifier(); 47 params.cert_verifier = cert_verifier();
48 params.transport_security_state = transport_security_state(); 48 params.transport_security_state = transport_security_state();
49 params.proxy_service = proxy_service(); 49 params.proxy_service = proxy_service();
50 params.ssl_config_service = ssl_config_service(); 50 params.ssl_config_service = ssl_config_service();
51 params.http_server_properties = http_server_properties(); 51 params.http_server_properties = http_server_properties();
52 scoped_refptr<HttpNetworkSession> network_session( 52 storage_.set_http_network_session(
53 new HttpNetworkSession(params)); 53 make_scoped_ptr(new HttpNetworkSession(params)));
54 storage_.set_http_transaction_factory( 54 storage_.set_http_transaction_factory(make_scoped_ptr(new HttpCache(
55 make_scoped_ptr(new HttpCache(network_session.get(), 55 storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0),
56 HttpCache::DefaultBackend::InMemory(0))) 56 false /* set_up_quic_server_info */)));
57 .Pass());
58 storage_.set_job_factory(make_scoped_ptr(new URLRequestJobFactoryImpl())); 57 storage_.set_job_factory(make_scoped_ptr(new URLRequestJobFactoryImpl()));
59 } 58 }
60 59
61 ~RequestContext() override { AssertNoURLRequests(); } 60 ~RequestContext() override { AssertNoURLRequests(); }
62 61
63 private: 62 private:
64 URLRequestContextStorage storage_; 63 URLRequestContextStorage storage_;
65 }; 64 };
66 65
67 class FetchResult { 66 class FetchResult {
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 EXPECT_EQ(1, network_delegate_.created_requests()); 750 EXPECT_EQ(1, network_delegate_.created_requests());
752 751
753 scoped_ptr<FetchResult> result = callback1.WaitForResult(); 752 scoped_ptr<FetchResult> result = callback1.WaitForResult();
754 result->VerifySuccess("-cert.crt-\n"); 753 result->VerifySuccess("-cert.crt-\n");
755 754
756 // request2 was cancelled. 755 // request2 was cancelled.
757 EXPECT_FALSE(callback2.HasResult()); 756 EXPECT_FALSE(callback2.HasResult());
758 } 757 }
759 758
760 } // namespace net 759 } // namespace net
OLDNEW
« no previous file with comments | « jingle/glue/proxy_resolving_client_socket.cc ('k') | net/http/http_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698