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

Side by Side Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
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/proxy/proxy_script_fetcher_impl.h" 5 #include "net/proxy/proxy_script_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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 params.transport_security_state = transport_security_state(); 74 params.transport_security_state = transport_security_state();
75 params.proxy_service = proxy_service(); 75 params.proxy_service = proxy_service();
76 params.ssl_config_service = ssl_config_service(); 76 params.ssl_config_service = ssl_config_service();
77 params.http_server_properties = http_server_properties(); 77 params.http_server_properties = http_server_properties();
78 scoped_refptr<HttpNetworkSession> network_session( 78 scoped_refptr<HttpNetworkSession> network_session(
79 new HttpNetworkSession(params)); 79 new HttpNetworkSession(params));
80 storage_.set_http_transaction_factory(new HttpCache( 80 storage_.set_http_transaction_factory(new HttpCache(
81 network_session.get(), HttpCache::DefaultBackend::InMemory(0))); 81 network_session.get(), HttpCache::DefaultBackend::InMemory(0)));
82 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl(); 82 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl();
83 #if !defined(DISABLE_FILE_SUPPORT) 83 #if !defined(DISABLE_FILE_SUPPORT)
84 job_factory->SetProtocolHandler( 84 job_factory->SetProtocolHandler("file",
85 "file", new FileProtocolHandler(base::ThreadTaskRunnerHandle::Get())); 85 make_scoped_ptr(new FileProtocolHandler(
86 base::ThreadTaskRunnerHandle::Get())));
86 #endif 87 #endif
87 storage_.set_job_factory(job_factory); 88 storage_.set_job_factory(job_factory);
88 } 89 }
89 90
90 ~RequestContext() override { AssertNoURLRequests(); } 91 ~RequestContext() override { AssertNoURLRequests(); }
91 92
92 private: 93 private:
93 URLRequestContextStorage storage_; 94 URLRequestContextStorage storage_;
94 }; 95 };
95 96
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 base::string16 text; 476 base::string16 text;
476 TestCompletionCallback callback; 477 TestCompletionCallback callback;
477 int result = pac_fetcher.Fetch(url, &text, callback.callback()); 478 int result = pac_fetcher.Fetch(url, &text, callback.callback());
478 EXPECT_EQ(ERR_FAILED, result); 479 EXPECT_EQ(ERR_FAILED, result);
479 } 480 }
480 } 481 }
481 482
482 } // namespace 483 } // namespace
483 484
484 } // namespace net 485 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698