| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 set_protocol = job_factory->SetProtocolHandler( | 281 set_protocol = job_factory->SetProtocolHandler( |
| 282 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); | 282 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler)); |
| 283 DCHECK(set_protocol); | 283 DCHECK(set_protocol); |
| 284 | 284 |
| 285 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 285 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 286 switches::kEnableLocalFileAccesses)) { | 286 switches::kEnableLocalFileAccesses)) { |
| 287 set_protocol = job_factory->SetProtocolHandler( | 287 set_protocol = job_factory->SetProtocolHandler( |
| 288 url::kFileScheme, | 288 url::kFileScheme, |
| 289 base::MakeUnique<net::FileProtocolHandler>( | 289 base::MakeUnique<net::FileProtocolHandler>( |
| 290 base::CreateTaskRunnerWithTraits( | 290 base::CreateTaskRunnerWithTraits( |
| 291 base::TaskTraits() | 291 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 292 .MayBlock() | 292 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))); |
| 293 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 294 .WithShutdownBehavior( | |
| 295 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN)))); | |
| 296 DCHECK(set_protocol); | 293 DCHECK(set_protocol); |
| 297 } | 294 } |
| 298 | 295 |
| 299 // Set up interceptors in the reverse order. | 296 // Set up interceptors in the reverse order. |
| 300 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = | 297 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = |
| 301 std::move(job_factory); | 298 std::move(job_factory); |
| 302 for (auto i = request_interceptors.rbegin(); i != request_interceptors.rend(); | 299 for (auto i = request_interceptors.rbegin(); i != request_interceptors.rend(); |
| 303 ++i) { | 300 ++i) { |
| 304 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( | 301 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( |
| 305 std::move(top_job_factory), std::move(*i))); | 302 std::move(top_job_factory), std::move(*i))); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 if (media_getter_) { | 472 if (media_getter_) { |
| 476 media_getter_->GetURLRequestContext() | 473 media_getter_->GetURLRequestContext() |
| 477 ->http_transaction_factory() | 474 ->http_transaction_factory() |
| 478 ->GetSession() | 475 ->GetSession() |
| 479 ->DisableQuic(); | 476 ->DisableQuic(); |
| 480 } | 477 } |
| 481 } | 478 } |
| 482 | 479 |
| 483 } // namespace shell | 480 } // namespace shell |
| 484 } // namespace chromecast | 481 } // namespace chromecast |
| OLD | NEW |