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

Side by Side Diff: net/url_request/url_request_test_util.cc

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary initialization; respond to review Created 8 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_context_storage.cc ('k') | remoting/host/url_request_context.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 #include "net/url_request/url_request_test_util.h" 5 #include "net/url_request/url_request_test_util.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 TestURLRequestContext::~TestURLRequestContext() { 55 TestURLRequestContext::~TestURLRequestContext() {
56 DCHECK(initialized_); 56 DCHECK(initialized_);
57 } 57 }
58 58
59 void TestURLRequestContext::Init() { 59 void TestURLRequestContext::Init() {
60 DCHECK(!initialized_); 60 DCHECK(!initialized_);
61 initialized_ = true; 61 initialized_ = true;
62 62
63 if (!host_resolver()) 63 if (!host_resolver())
64 context_storage_.set_host_resolver(new net::MockCachingHostResolver()); 64 context_storage_.set_host_resolver(
65 scoped_ptr<net::HostResolver>(new net::MockCachingHostResolver()));
65 if (!proxy_service()) 66 if (!proxy_service())
66 context_storage_.set_proxy_service(net::ProxyService::CreateDirect()); 67 context_storage_.set_proxy_service(net::ProxyService::CreateDirect());
67 if (!cert_verifier()) 68 if (!cert_verifier())
68 context_storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); 69 context_storage_.set_cert_verifier(net::CertVerifier::CreateDefault());
69 if (!ftp_transaction_factory()) { 70 if (!ftp_transaction_factory()) {
70 #if !defined(DISABLE_FTP_SUPPORT) 71 #if !defined(DISABLE_FTP_SUPPORT)
71 context_storage_.set_ftp_transaction_factory( 72 context_storage_.set_ftp_transaction_factory(
72 new net::FtpNetworkLayer(host_resolver())); 73 new net::FtpNetworkLayer(host_resolver()));
73 #else 74 #else
74 context_storage_.set_ftp_transaction_factory(NULL); 75 context_storage_.set_ftp_transaction_factory(NULL);
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 551
551 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse( 552 net::URLRequestJob* TestJobInterceptor::MaybeInterceptResponse(
552 net::URLRequest* request, 553 net::URLRequest* request,
553 net::NetworkDelegate* network_delegate) const { 554 net::NetworkDelegate* network_delegate) const {
554 return NULL; 555 return NULL;
555 } 556 }
556 557
557 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) { 558 void TestJobInterceptor::set_main_intercept_job(net::URLRequestJob* job) {
558 main_intercept_job_ = job; 559 main_intercept_job_ = job;
559 } 560 }
OLDNEW
« no previous file with comments | « net/url_request/url_request_context_storage.cc ('k') | remoting/host/url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698