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

Unified Diff: net/url_request/url_request_ftp_job_unittest.cc

Issue 1290243007: Shift URLRequestContextStorage over to taking scoped_ptrs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Paul_BuilderGrab
Patch Set: Lots of fixes driven by try jobs. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_ftp_job_unittest.cc
diff --git a/net/url_request/url_request_ftp_job_unittest.cc b/net/url_request/url_request_ftp_job_unittest.cc
index 4a8178dd448eb60e8721e7b11e23e870f2b4f7d7..5653a8559f3c3d5622dc03cb3c6b314bdb43c24e 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -48,17 +48,18 @@ class MockProxyResolverFactory : public ProxyResolverFactory {
class FtpTestURLRequestContext : public TestURLRequestContext {
public:
FtpTestURLRequestContext(ClientSocketFactory* socket_factory,
- ProxyService* proxy_service,
+ scoped_ptr<ProxyService> proxy_service,
NetworkDelegate* network_delegate,
FtpTransactionFactory* ftp_transaction_factory)
: TestURLRequestContext(true),
ftp_protocol_handler_(new FtpProtocolHandler(ftp_transaction_factory)) {
set_client_socket_factory(socket_factory);
- context_storage_.set_proxy_service(proxy_service);
+ context_storage_.set_proxy_service(proxy_service.Pass());
set_network_delegate(network_delegate);
- URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl;
+ scoped_ptr<URLRequestJobFactoryImpl> job_factory =
+ make_scoped_ptr(new URLRequestJobFactoryImpl);
job_factory->SetProtocolHandler("ftp", ftp_protocol_handler_);
- context_storage_.set_job_factory(job_factory);
+ context_storage_.set_job_factory(job_factory.Pass());
Init();
}
@@ -66,8 +67,8 @@ class FtpTestURLRequestContext : public TestURLRequestContext {
return ftp_protocol_handler_->ftp_auth_cache_.get();
}
- void set_proxy_service(ProxyService* proxy_service) {
- context_storage_.set_proxy_service(proxy_service);
+ void set_proxy_service(scoped_ptr<ProxyService> proxy_service) {
+ context_storage_.set_proxy_service(proxy_service.Pass());
}
private:
@@ -225,12 +226,12 @@ TEST_F(URLRequestFtpJobPriorityTest, SetSubsequentTransactionPriority) {
class URLRequestFtpJobTest : public testing::Test {
public:
URLRequestFtpJobTest()
- : request_context_(&socket_factory_,
- new ProxyService(
- new SimpleProxyConfigService, NULL, NULL),
- &network_delegate_,
- &ftp_transaction_factory_) {
- }
+ : request_context_(
+ &socket_factory_,
+ make_scoped_ptr(
+ new ProxyService(new SimpleProxyConfigService, NULL, NULL)),
+ &network_delegate_,
+ &ftp_transaction_factory_) {}
~URLRequestFtpJobTest() override {
// Clean up any remaining tasks that mess up unrelated tests.
@@ -294,10 +295,10 @@ TEST_F(URLRequestFtpJobTest, FtpProxyRequest) {
// Regression test for http://crbug.com/237526 .
TEST_F(URLRequestFtpJobTest, FtpProxyRequestOrphanJob) {
// Use a PAC URL so that URLRequestFtpJob's |pac_request_| field is non-NULL.
- request_context()->set_proxy_service(new ProxyService(
+ request_context()->set_proxy_service(make_scoped_ptr(new ProxyService(
new ProxyConfigServiceFixed(
ProxyConfig::CreateFromCustomPacURL(GURL("http://foo"))),
- make_scoped_ptr(new MockProxyResolverFactory), NULL));
+ make_scoped_ptr(new MockProxyResolverFactory), NULL)));
TestDelegate request_delegate;
scoped_ptr<URLRequest> url_request(request_context()->CreateRequest(

Powered by Google App Engine
This is Rietveld 408576698