Chromium Code Reviews| Index: content/shell/browser/shell_url_request_context_getter.cc |
| diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc |
| index bd5c9374328d26e24be3704afb8d69cfd88a2862..a08e3607adc815af62c24d9d3602071461cfe5a5 100644 |
| --- a/content/shell/browser/shell_url_request_context_getter.cc |
| +++ b/content/shell/browser/shell_url_request_context_getter.cc |
| @@ -64,12 +64,14 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter( |
| base::MessageLoop* io_loop, |
| base::MessageLoop* file_loop, |
| ProtocolHandlerMap* protocol_handlers, |
| + ProtocolHandlerScopedVector protocol_interceptors, |
| net::NetLog* net_log) |
| : ignore_certificate_errors_(ignore_certificate_errors), |
| base_path_(base_path), |
| io_loop_(io_loop), |
| file_loop_(file_loop), |
| - net_log_(net_log) { |
| + net_log_(net_log), |
| + protocol_interceptors_(protocol_interceptors.Pass()) { |
| // Must first be created on the UI thread. |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| @@ -214,7 +216,20 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
| GetTaskRunnerWithShutdownBehavior( |
| base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| DCHECK(set_protocol); |
| - storage_->set_job_factory(job_factory.release()); |
| + |
| + // Setup iterators in the reverse order. |
|
mmenke
2014/03/06 19:28:22
nit: "Set up"
kinuko
2014/03/07 08:25:01
Done.
|
| + scoped_ptr<net::URLRequestJobFactory> top_job_factory = |
| + job_factory.PassAs<net::URLRequestJobFactory>(); |
| + for (ProtocolHandlerScopedVector::reverse_iterator i = |
| + protocol_interceptors_.rbegin(); |
| + i != protocol_interceptors_.rend(); |
| + ++i) { |
| + top_job_factory.reset(new net::ProtocolInterceptJobFactory( |
| + top_job_factory.Pass(), make_scoped_ptr(*i))); |
| + } |
| + protocol_interceptors_.weak_clear(); |
| + |
| + storage_->set_job_factory(top_job_factory.release()); |
| } |
| return url_request_context_.get(); |