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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2629583003: Remove TaskTraits::with_file_io(). (Closed)
Patch Set: 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 DCHECK_EQ(WORKER_POOL_COUNT, params_vector.size()); 456 DCHECK_EQ(WORKER_POOL_COUNT, params_vector.size());
457 return params_vector; 457 return params_vector;
458 } 458 }
459 459
460 // Returns the worker pool index for |traits| defaulting to FOREGROUND or 460 // Returns the worker pool index for |traits| defaulting to FOREGROUND or
461 // FOREGROUND_FILE_IO on any other priorities based off of worker pools defined 461 // FOREGROUND_FILE_IO on any other priorities based off of worker pools defined
462 // in GetDefaultSchedulerWorkerPoolParams(). 462 // in GetDefaultSchedulerWorkerPoolParams().
463 size_t DefaultBrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits) { 463 size_t DefaultBrowserWorkerPoolIndexForTraits(const base::TaskTraits& traits) {
464 const bool is_background = 464 const bool is_background =
465 traits.priority() == base::TaskPriority::BACKGROUND; 465 traits.priority() == base::TaskPriority::BACKGROUND;
466 if (traits.with_file_io()) 466 if (traits.may_block() || traits.with_base_sync_primitives())
467 return is_background ? BACKGROUND_FILE_IO : FOREGROUND_FILE_IO; 467 return is_background ? BACKGROUND_FILE_IO : FOREGROUND_FILE_IO;
468 468
469 return is_background ? BACKGROUND : FOREGROUND; 469 return is_background ? BACKGROUND : FOREGROUND;
470 } 470 }
471 471
472 } // namespace 472 } // namespace
473 473
474 #if defined(USE_X11) && !defined(OS_CHROMEOS) 474 #if defined(USE_X11) && !defined(OS_CHROMEOS)
475 namespace internal { 475 namespace internal {
476 476
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 if (!audio_manager_) { 1781 if (!audio_manager_) {
1782 audio_thread_ = base::MakeUnique<AudioManagerThread>(); 1782 audio_thread_ = base::MakeUnique<AudioManagerThread>();
1783 audio_manager_ = media::AudioManager::Create( 1783 audio_manager_ = media::AudioManager::Create(
1784 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), 1784 audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
1785 MediaInternals::GetInstance()); 1785 MediaInternals::GetInstance());
1786 } 1786 }
1787 CHECK(audio_manager_); 1787 CHECK(audio_manager_);
1788 } 1788 }
1789 1789
1790 } // namespace content 1790 } // namespace content
OLDNEW
« no previous file with comments | « components/task_scheduler_util/browser/initialization.cc ('k') | content/renderer/render_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698