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

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

Issue 2608103002: Remove ScopedVector from URLRequestInterceptorScopedVector. (Closed)
Patch Set: aw Created 3 years, 11 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 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 main_request_context_->set_cert_verifier(cert_verifier_.get()); 1092 main_request_context_->set_cert_verifier(cert_verifier_.get());
1093 #else 1093 #else
1094 main_request_context_->set_cert_verifier( 1094 main_request_context_->set_cert_verifier(
1095 io_thread_globals->cert_verifier.get()); 1095 io_thread_globals->cert_verifier.get());
1096 #endif 1096 #endif
1097 } 1097 }
1098 1098
1099 // Install the New Tab Page Interceptor. 1099 // Install the New Tab Page Interceptor.
1100 if (profile_params_->new_tab_page_interceptor.get()) { 1100 if (profile_params_->new_tab_page_interceptor.get()) {
1101 request_interceptors.push_back( 1101 request_interceptors.push_back(
1102 profile_params_->new_tab_page_interceptor.release()); 1102 std::move(profile_params_->new_tab_page_interceptor));
1103 } 1103 }
1104 1104
1105 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier( 1105 std::unique_ptr<net::MultiLogCTVerifier> ct_verifier(
1106 new net::MultiLogCTVerifier()); 1106 new net::MultiLogCTVerifier());
1107 ct_verifier->AddLogs(io_thread_globals->ct_logs); 1107 ct_verifier->AddLogs(io_thread_globals->ct_logs);
1108 main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); 1108 main_request_context_->set_cert_transparency_verifier(ct_verifier.get());
1109 1109
1110 ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( 1110 ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker(
1111 io_thread_globals->ct_logs)); 1111 io_thread_globals->ct_logs));
1112 ct_verifier->SetObserver(ct_tree_tracker_.get()); 1112 ct_verifier->SetObserver(ct_tree_tracker_.get());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver)); 1189 url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver));
1190 #endif // !BUILDFLAG(DISABLE_FTP_SUPPORT) 1190 #endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
1191 1191
1192 #if BUILDFLAG(DEBUG_DEVTOOLS) 1192 #if BUILDFLAG(DEBUG_DEVTOOLS)
1193 request_interceptors.push_back(new DebugDevToolsInterceptor); 1193 request_interceptors.push_back(new DebugDevToolsInterceptor);
1194 #endif 1194 #endif
1195 1195
1196 // Set up interceptors in the reverse order. 1196 // Set up interceptors in the reverse order.
1197 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = 1197 std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
1198 std::move(job_factory); 1198 std::move(job_factory);
1199 for (content::URLRequestInterceptorScopedVector::reverse_iterator i = 1199 for (auto i = request_interceptors.rbegin(); i != request_interceptors.rend();
1200 request_interceptors.rbegin();
1201 i != request_interceptors.rend();
1202 ++i) { 1200 ++i) {
1203 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( 1201 top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
1204 std::move(top_job_factory), base::WrapUnique(*i))); 1202 std::move(top_job_factory), std::move(*i)));
1205 } 1203 }
1206 request_interceptors.weak_clear(); 1204 request_interceptors.clear();
1207 1205
1208 if (protocol_handler_interceptor) { 1206 if (protocol_handler_interceptor) {
1209 protocol_handler_interceptor->Chain(std::move(top_job_factory)); 1207 protocol_handler_interceptor->Chain(std::move(top_job_factory));
1210 return std::move(protocol_handler_interceptor); 1208 return std::move(protocol_handler_interceptor);
1211 } else { 1209 } else {
1212 return top_job_factory; 1210 return top_job_factory;
1213 } 1211 }
1214 } 1212 }
1215 1213
1216 void ProfileIOData::ShutdownOnUIThread( 1214 void ProfileIOData::ShutdownOnUIThread(
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 void ProfileIOData::SetCookieSettingsForTesting( 1308 void ProfileIOData::SetCookieSettingsForTesting(
1311 content_settings::CookieSettings* cookie_settings) { 1309 content_settings::CookieSettings* cookie_settings) {
1312 DCHECK(!cookie_settings_.get()); 1310 DCHECK(!cookie_settings_.get());
1313 cookie_settings_ = cookie_settings; 1311 cookie_settings_ = cookie_settings;
1314 } 1312 }
1315 1313
1316 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( 1314 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState(
1317 const GURL& url) const { 1315 const GURL& url) const {
1318 return url_blacklist_manager_->GetURLBlacklistState(url); 1316 return url_blacklist_manager_->GetURLBlacklistState(url);
1319 } 1317 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.cc ('k') | chromecast/browser/url_request_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698