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

Side by Side Diff: chromecast/browser/url_request_context_factory.cc

Issue 2858993002: Use constexpr TaskTraits constructor in chromecast. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698