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

Side by Side Diff: content/shell/browser/shell_url_request_context_getter.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_url_request_context_getter.h" 5 #include "content/shell/browser/shell_url_request_context_getter.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 url::kFileScheme, 234 url::kFileScheme,
235 base::MakeUnique<net::FileProtocolHandler>( 235 base::MakeUnique<net::FileProtocolHandler>(
236 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( 236 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
237 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); 237 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
238 DCHECK(set_protocol); 238 DCHECK(set_protocol);
239 #endif 239 #endif
240 240
241 // Set up interceptors in the reverse order. 241 // Set up interceptors in the reverse order.
242 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = 242 std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
243 std::move(job_factory); 243 std::move(job_factory);
244 for (URLRequestInterceptorScopedVector::reverse_iterator i = 244 for (auto i = request_interceptors_.rbegin();
245 request_interceptors_.rbegin(); 245 i != request_interceptors_.rend(); ++i) {
246 i != request_interceptors_.rend();
247 ++i) {
248 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( 246 top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
249 std::move(top_job_factory), base::WrapUnique(*i))); 247 std::move(top_job_factory), std::move(*i)));
250 } 248 }
251 request_interceptors_.weak_clear(); 249 request_interceptors_.clear();
252 250
253 storage_->set_job_factory(std::move(top_job_factory)); 251 storage_->set_job_factory(std::move(top_job_factory));
254 } 252 }
255 253
256 return url_request_context_.get(); 254 return url_request_context_.get();
257 } 255 }
258 256
259 scoped_refptr<base::SingleThreadTaskRunner> 257 scoped_refptr<base::SingleThreadTaskRunner>
260 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 258 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
261 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); 259 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
262 } 260 }
263 261
264 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 262 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
265 return url_request_context_->host_resolver(); 263 return url_request_context_->host_resolver();
266 } 264 }
267 265
268 } // namespace content 266 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/browser_context.h ('k') | headless/lib/browser/headless_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698