| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/url_request_context_factory.h" | 5 #include "chromecast/browser/url_request_context_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 base::MakeUnique<net::FileProtocolHandler>( | 252 base::MakeUnique<net::FileProtocolHandler>( |
| 253 content::BrowserThread::GetBlockingPool() | 253 content::BrowserThread::GetBlockingPool() |
| 254 ->GetTaskRunnerWithShutdownBehavior( | 254 ->GetTaskRunnerWithShutdownBehavior( |
| 255 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); | 255 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| 256 DCHECK(set_protocol); | 256 DCHECK(set_protocol); |
| 257 } | 257 } |
| 258 | 258 |
| 259 // Set up interceptors in the reverse order. | 259 // Set up interceptors in the reverse order. |
| 260 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = | 260 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = |
| 261 std::move(job_factory); | 261 std::move(job_factory); |
| 262 for (content::URLRequestInterceptorScopedVector::reverse_iterator i = | 262 for (auto i = request_interceptors.rbegin(); i != request_interceptors.rend(); |
| 263 request_interceptors.rbegin(); | |
| 264 i != request_interceptors.rend(); | |
| 265 ++i) { | 263 ++i) { |
| 266 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( | 264 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( |
| 267 std::move(top_job_factory), base::WrapUnique(*i))); | 265 std::move(top_job_factory), std::move(*i))); |
| 268 } | 266 } |
| 269 request_interceptors.weak_clear(); | 267 request_interceptors.clear(); |
| 270 | 268 |
| 271 main_job_factory_.reset(top_job_factory.release()); | 269 main_job_factory_.reset(top_job_factory.release()); |
| 272 | 270 |
| 273 main_dependencies_initialized_ = true; | 271 main_dependencies_initialized_ = true; |
| 274 } | 272 } |
| 275 | 273 |
| 276 void URLRequestContextFactory::InitializeMediaContextDependencies( | 274 void URLRequestContextFactory::InitializeMediaContextDependencies( |
| 277 net::HttpTransactionFactory* transaction_factory) { | 275 net::HttpTransactionFactory* transaction_factory) { |
| 278 if (media_dependencies_initialized_) | 276 if (media_dependencies_initialized_) |
| 279 return; | 277 return; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 398 |
| 401 void URLRequestContextFactory::InitializeNetworkDelegates() { | 399 void URLRequestContextFactory::InitializeNetworkDelegates() { |
| 402 app_network_delegate_->Initialize(false); | 400 app_network_delegate_->Initialize(false); |
| 403 LOG(INFO) << "Initialized app network delegate."; | 401 LOG(INFO) << "Initialized app network delegate."; |
| 404 system_network_delegate_->Initialize(false); | 402 system_network_delegate_->Initialize(false); |
| 405 LOG(INFO) << "Initialized system network delegate."; | 403 LOG(INFO) << "Initialized system network delegate."; |
| 406 } | 404 } |
| 407 | 405 |
| 408 } // namespace shell | 406 } // namespace shell |
| 409 } // namespace chromecast | 407 } // namespace chromecast |
| OLD | NEW |