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

Side by Side Diff: content/public/browser/browser_thread.h

Issue 2857983003: Use constexpr TaskTraits constructor in content. (Closed)
Patch Set: CR gab #8 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 | « content/network/url_loader_impl.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | 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 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // The main thread in the browser. 67 // The main thread in the browser.
68 UI, 68 UI,
69 69
70 // This is the thread that interacts with the database. 70 // This is the thread that interacts with the database.
71 DB, 71 DB,
72 72
73 // This is the thread that interacts with the file system. 73 // This is the thread that interacts with the file system.
74 // DEPRECATED: prefer base/task_scheduler/post_task.h for new classes 74 // DEPRECATED: prefer base/task_scheduler/post_task.h for new classes
75 // requiring a background file I/O task runner, i.e.: 75 // requiring a background file I/O task runner, i.e.:
76 // base::CreateSequencedTaskRunnerWithTraits( 76 // base::CreateSequencedTaskRunnerWithTraits(
77 // base::TaskTraits().MayBlock() 77 // {base::MayBlock(), base::TaskPriority::BACKGROUND})
78 // .WithPriority(base::TaskPriority::BACKGROUND))
79 // Note: You can use base::TaskPriority::USER_VISIBLE instead of 78 // Note: You can use base::TaskPriority::USER_VISIBLE instead of
80 // base::TaskPriority::BACKGROUND if the latency of this operation 79 // base::TaskPriority::BACKGROUND if the latency of this operation
81 // is visible but non-blocking to the user. 80 // is visible but non-blocking to the user.
82 FILE, 81 FILE,
83 82
84 // Used for file system operations that block user interactions. 83 // Used for file system operations that block user interactions.
85 // Responsiveness of this thread affect users. 84 // Responsiveness of this thread affect users.
86 // DEPRECATED: prefer base/task_scheduler/post_task.h for new classes 85 // DEPRECATED: prefer base/task_scheduler/post_task.h for new classes
87 // requiring a user-blocking file I/O task runner, i.e.: 86 // requiring a user-blocking file I/O task runner, i.e.:
88 // base::CreateSequencedTaskRunnerWithTraits( 87 // base::CreateSequencedTaskRunnerWithTraits(
89 // base::TaskTraits().MayBlock() 88 // {base::MayBlock(), base::TaskPriority::USER_BLOCKING})
90 // .WithPriority(base::TaskPriority::USER_BLOCKING))
91 FILE_USER_BLOCKING, 89 FILE_USER_BLOCKING,
92 90
93 // Used to launch and terminate Chrome processes. 91 // Used to launch and terminate Chrome processes.
94 PROCESS_LAUNCHER, 92 PROCESS_LAUNCHER,
95 93
96 // This is the thread to handle slow HTTP cache operations. 94 // This is the thread to handle slow HTTP cache operations.
97 CACHE, 95 CACHE,
98 96
99 // This is the thread that processes non-blocking IO, i.e. IPC and network. 97 // This is the thread that processes non-blocking IO, i.e. IPC and network.
100 // Blocking IO should happen on other threads like DB, FILE, 98 // Blocking IO should happen on other threads like DB, FILE,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 215
218 // Returns the thread pool used for blocking file I/O. Use this object to 216 // Returns the thread pool used for blocking file I/O. Use this object to
219 // perform random blocking operations such as file writes. 217 // perform random blocking operations such as file writes.
220 // 218 //
221 // DEPRECATED: use an independent TaskRunner obtained from 219 // DEPRECATED: use an independent TaskRunner obtained from
222 // base/task_scheduler/post_task.h instead, e.g.: 220 // base/task_scheduler/post_task.h instead, e.g.:
223 // BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( 221 // BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
224 // base::SequencedWorkerPool::GetSequenceToken()) 222 // base::SequencedWorkerPool::GetSequenceToken())
225 // => 223 // =>
226 // base::CreateSequencedTaskRunnerWithTraits( 224 // base::CreateSequencedTaskRunnerWithTraits(
227 // base::TaskTraits().MayBlock()...). 225 // {base::MayBlock()}).
228 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT; 226 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT;
229 227
230 // Callable on any thread. Returns whether the given well-known thread is 228 // Callable on any thread. Returns whether the given well-known thread is
231 // initialized. 229 // initialized.
232 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT; 230 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT;
233 231
234 // Callable on any thread. Returns whether you're currently on a particular 232 // Callable on any thread. Returns whether you're currently on a particular
235 // thread. To DCHECK this, use the DCHECK_CURRENTLY_ON() macro above. 233 // thread. To DCHECK this, use the DCHECK_CURRENTLY_ON() macro above.
236 static bool CurrentlyOn(ID identifier) WARN_UNUSED_RESULT; 234 static bool CurrentlyOn(ID identifier) WARN_UNUSED_RESULT;
237 235
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 private: 317 private:
320 friend class BrowserThreadImpl; 318 friend class BrowserThreadImpl;
321 319
322 BrowserThread() {} 320 BrowserThread() {}
323 DISALLOW_COPY_AND_ASSIGN(BrowserThread); 321 DISALLOW_COPY_AND_ASSIGN(BrowserThread);
324 }; 322 };
325 323
326 } // namespace content 324 } // namespace content
327 325
328 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ 326 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_
OLDNEW
« no previous file with comments | « content/network/url_loader_impl.cc ('k') | content/renderer/gpu/render_widget_compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698