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

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

Issue 2590413003: Update TaskTraits in browser_main_loop.cc. (Closed)
Patch Set: fix todo Created 3 years, 12 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 (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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 thread_id < BrowserThread::ID_COUNT; 1004 thread_id < BrowserThread::ID_COUNT;
1005 ++thread_id) { 1005 ++thread_id) {
1006 // If this thread ID is backed by a real thread, |thread_to_start| will be 1006 // If this thread ID is backed by a real thread, |thread_to_start| will be
1007 // set to the appropriate BrowserProcessSubThread*. And |options| can be 1007 // set to the appropriate BrowserProcessSubThread*. And |options| can be
1008 // updated away from its default. 1008 // updated away from its default.
1009 std::unique_ptr<BrowserProcessSubThread>* thread_to_start = nullptr; 1009 std::unique_ptr<BrowserProcessSubThread>* thread_to_start = nullptr;
1010 base::Thread::Options options; 1010 base::Thread::Options options;
1011 1011
1012 // Otherwise this thread ID will be backed by a SingleThreadTaskRunner using 1012 // Otherwise this thread ID will be backed by a SingleThreadTaskRunner using
1013 // |non_ui_non_io_task_runner_traits| (which can be augmented below). 1013 // |non_ui_non_io_task_runner_traits| (which can be augmented below).
1014 // TODO(gab): Existing non-UI/non-IO BrowserThreads allow waiting so the 1014 // TODO(gab): Existing non-UI/non-IO BrowserThreads allow sync primitives so
1015 // initial redirection will as well but they probably don't need to. 1015 // the initial redirection will as well but they probably don't need to.
1016 base::TaskTraits non_ui_non_io_task_runner_traits = 1016 base::TaskTraits non_ui_non_io_task_runner_traits =
1017 base::TaskTraits().WithFileIO().WithWait(); 1017 base::TaskTraits().MayBlock().WithSyncPrimitives();
1018 1018
1019 switch (thread_id) { 1019 switch (thread_id) {
1020 case BrowserThread::DB: 1020 case BrowserThread::DB:
1021 TRACE_EVENT_BEGIN1("startup", 1021 TRACE_EVENT_BEGIN1("startup",
1022 "BrowserMainLoop::CreateThreads:start", 1022 "BrowserMainLoop::CreateThreads:start",
1023 "Thread", "BrowserThread::DB"); 1023 "Thread", "BrowserThread::DB");
1024 if (redirect_nonUInonIO_browser_threads) { 1024 if (redirect_nonUInonIO_browser_threads) {
1025 non_ui_non_io_task_runner_traits 1025 non_ui_non_io_task_runner_traits
1026 .WithPriority(base::TaskPriority::USER_VISIBLE) 1026 .WithPriority(base::TaskPriority::USER_VISIBLE)
1027 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN); 1027 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN);
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 if (!audio_manager_) { 1793 if (!audio_manager_) {
1794 audio_thread_ = base::MakeUnique<AudioManagerThread>(); 1794 audio_thread_ = base::MakeUnique<AudioManagerThread>();
1795 audio_manager_ = media::AudioManager::Create( 1795 audio_manager_ = media::AudioManager::Create(
1796 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), 1796 audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
1797 MediaInternals::GetInstance()); 1797 MediaInternals::GetInstance());
1798 } 1798 }
1799 CHECK(audio_manager_); 1799 CHECK(audio_manager_);
1800 } 1800 }
1801 1801
1802 } // namespace content 1802 } // namespace content
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