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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 2428143002: Clean up FtpTransactionFacory ownership. (Closed)
Patch Set: Response to comments Created 4 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
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 "chrome/browser/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 context->set_ssl_config_service(profile_params_->ssl_config_service.get()); 1168 context->set_ssl_config_service(profile_params_->ssl_config_service.get());
1169 } 1169 }
1170 1170
1171 std::unique_ptr<net::URLRequestJobFactory> 1171 std::unique_ptr<net::URLRequestJobFactory>
1172 ProfileIOData::SetUpJobFactoryDefaults( 1172 ProfileIOData::SetUpJobFactoryDefaults(
1173 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, 1173 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory,
1174 content::URLRequestInterceptorScopedVector request_interceptors, 1174 content::URLRequestInterceptorScopedVector request_interceptors,
1175 std::unique_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 1175 std::unique_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
1176 protocol_handler_interceptor, 1176 protocol_handler_interceptor,
1177 net::NetworkDelegate* network_delegate, 1177 net::NetworkDelegate* network_delegate,
1178 net::FtpTransactionFactory* ftp_transaction_factory) const { 1178 net::HostResolver* host_resolver) const {
1179 // NOTE(willchan): Keep these protocol handlers in sync with 1179 // NOTE(willchan): Keep these protocol handlers in sync with
1180 // ProfileIOData::IsHandledProtocol(). 1180 // ProfileIOData::IsHandledProtocol().
1181 bool set_protocol = job_factory->SetProtocolHandler( 1181 bool set_protocol = job_factory->SetProtocolHandler(
1182 url::kFileScheme, 1182 url::kFileScheme,
1183 base::MakeUnique<net::FileProtocolHandler>( 1183 base::MakeUnique<net::FileProtocolHandler>(
1184 content::BrowserThread::GetBlockingPool() 1184 content::BrowserThread::GetBlockingPool()
1185 ->GetTaskRunnerWithShutdownBehavior( 1185 ->GetTaskRunnerWithShutdownBehavior(
1186 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); 1186 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
1187 DCHECK(set_protocol); 1187 DCHECK(set_protocol);
1188 1188
(...skipping 28 matching lines...) Expand all
1217 url::kContentScheme, 1217 url::kContentScheme,
1218 content::ContentProtocolHandler::Create( 1218 content::ContentProtocolHandler::Create(
1219 content::BrowserThread::GetBlockingPool() 1219 content::BrowserThread::GetBlockingPool()
1220 ->GetTaskRunnerWithShutdownBehavior( 1220 ->GetTaskRunnerWithShutdownBehavior(
1221 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); 1221 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
1222 #endif 1222 #endif
1223 1223
1224 job_factory->SetProtocolHandler( 1224 job_factory->SetProtocolHandler(
1225 url::kAboutScheme, 1225 url::kAboutScheme,
1226 base::MakeUnique<about_handler::AboutProtocolHandler>()); 1226 base::MakeUnique<about_handler::AboutProtocolHandler>());
1227
1227 #if !defined(DISABLE_FTP_SUPPORT) 1228 #if !defined(DISABLE_FTP_SUPPORT)
1228 DCHECK(ftp_transaction_factory);
1229 job_factory->SetProtocolHandler( 1229 job_factory->SetProtocolHandler(
1230 url::kFtpScheme, 1230 url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver));
1231 base::MakeUnique<net::FtpProtocolHandler>(ftp_transaction_factory));
1232 #endif // !defined(DISABLE_FTP_SUPPORT) 1231 #endif // !defined(DISABLE_FTP_SUPPORT)
1233 1232
1234 #if defined(DEBUG_DEVTOOLS) 1233 #if defined(DEBUG_DEVTOOLS)
1235 request_interceptors.push_back(new DebugDevToolsInterceptor); 1234 request_interceptors.push_back(new DebugDevToolsInterceptor);
1236 #endif 1235 #endif
1237 1236
1238 // Set up interceptors in the reverse order. 1237 // Set up interceptors in the reverse order.
1239 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = 1238 std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
1240 std::move(job_factory); 1239 std::move(job_factory);
1241 for (content::URLRequestInterceptorScopedVector::reverse_iterator i = 1240 for (content::URLRequestInterceptorScopedVector::reverse_iterator i =
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 void ProfileIOData::SetCookieSettingsForTesting( 1351 void ProfileIOData::SetCookieSettingsForTesting(
1353 content_settings::CookieSettings* cookie_settings) { 1352 content_settings::CookieSettings* cookie_settings) {
1354 DCHECK(!cookie_settings_.get()); 1353 DCHECK(!cookie_settings_.get());
1355 cookie_settings_ = cookie_settings; 1354 cookie_settings_ = cookie_settings;
1356 } 1355 }
1357 1356
1358 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1357 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1359 const GURL& url) const { 1358 const GURL& url) const {
1360 return url_blacklist_manager_->GetURLBlacklistState(url); 1359 return url_blacklist_manager_->GetURLBlacklistState(url);
1361 } 1360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698