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

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: Sync'd to revision p349162. Created 5 years, 3 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
« no previous file with comments | « net/url_request/url_request_context_storage.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 093b74a748e51f46227d975535ead449f5149784..3e388c50fd38c9b21cf3c075ae429f5288ae8b6e 100644
--- a/net/url_request/url_request_ftp_job_unittest.cc
+++ b/net/url_request/url_request_ftp_job_unittest.cc
@@ -48,18 +48,19 @@ 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",
make_scoped_ptr(ftp_protocol_handler_));
- context_storage_.set_job_factory(job_factory);
+ context_storage_.set_job_factory(job_factory.Pass());
Init();
}
@@ -67,8 +68,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:
@@ -226,12 +227,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.
@@ -295,10 +296,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(
« no previous file with comments | « net/url_request/url_request_context_storage.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698