OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 int64 delay_ms); | 109 int64 delay_ms); |
110 static bool PostNonNestableTask(ID identifier, | 110 static bool PostNonNestableTask(ID identifier, |
111 const tracked_objects::Location& from_here, | 111 const tracked_objects::Location& from_here, |
112 const base::Closure& task); | 112 const base::Closure& task); |
113 static bool PostNonNestableDelayedTask( | 113 static bool PostNonNestableDelayedTask( |
114 ID identifier, | 114 ID identifier, |
115 const tracked_objects::Location& from_here, | 115 const tracked_objects::Location& from_here, |
116 const base::Closure& task, | 116 const base::Closure& task, |
117 int64 delay_ms); | 117 int64 delay_ms); |
118 | 118 |
| 119 // Posts a task on the IO thread. Syntactic sugar for |
| 120 // PostTask(BrowserThread::IO, ...). |
| 121 static bool PostTaskOnIOThread(const tracked_objects::Location& from_here, |
| 122 const base::Closure& task); |
| 123 |
119 // TODO(brettw) remove these when Task->Closure conversion is done. | 124 // TODO(brettw) remove these when Task->Closure conversion is done. |
120 static bool PostTask(ID identifier, | 125 static bool PostTask(ID identifier, |
121 const tracked_objects::Location& from_here, | 126 const tracked_objects::Location& from_here, |
122 Task* task); | 127 Task* task); |
123 static bool PostDelayedTask(ID identifier, | 128 static bool PostDelayedTask(ID identifier, |
124 const tracked_objects::Location& from_here, | 129 const tracked_objects::Location& from_here, |
125 Task* task, | 130 Task* task, |
126 int64 delay_ms); | 131 int64 delay_ms); |
127 static bool PostNonNestableTask(ID identifier, | 132 static bool PostNonNestableTask(ID identifier, |
128 const tracked_objects::Location& from_here, | 133 const tracked_objects::Location& from_here, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 private: | 247 private: |
243 friend class BrowserThreadImpl; | 248 friend class BrowserThreadImpl; |
244 | 249 |
245 BrowserThread() {} | 250 BrowserThread() {} |
246 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 251 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
247 }; | 252 }; |
248 | 253 |
249 } // namespace content | 254 } // namespace content |
250 | 255 |
251 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 256 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |