OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // get posted to the MessageLoop if it's still alive, or be deleted otherwise. | 103 // get posted to the MessageLoop if it's still alive, or be deleted otherwise. |
104 // They return true iff the thread existed and the task was posted. Note that | 104 // They return true iff the thread existed and the task was posted. Note that |
105 // even if the task is posted, there's no guarantee that it will run, since | 105 // even if the task is posted, there's no guarantee that it will run, since |
106 // the target thread may already have a Quit message in its queue. | 106 // the target thread may already have a Quit message in its queue. |
107 static bool PostTask(ID identifier, | 107 static bool PostTask(ID identifier, |
108 const tracked_objects::Location& from_here, | 108 const tracked_objects::Location& from_here, |
109 const base::Closure& task); | 109 const base::Closure& task); |
110 static bool PostDelayedTask(ID identifier, | 110 static bool PostDelayedTask(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 int64 delay_ms); | |
114 static bool PostDelayedTask(ID identifier, | |
115 const tracked_objects::Location& from_here, | |
116 const base::Closure& task, | |
117 base::TimeDelta delay); | 113 base::TimeDelta delay); |
118 static bool PostNonNestableTask(ID identifier, | 114 static bool PostNonNestableTask(ID identifier, |
119 const tracked_objects::Location& from_here, | 115 const tracked_objects::Location& from_here, |
120 const base::Closure& task); | 116 const base::Closure& task); |
121 static bool PostNonNestableDelayedTask( | 117 static bool PostNonNestableDelayedTask( |
122 ID identifier, | 118 ID identifier, |
123 const tracked_objects::Location& from_here, | 119 const tracked_objects::Location& from_here, |
124 const base::Closure& task, | 120 const base::Closure& task, |
125 int64 delay_ms); | |
126 static bool PostNonNestableDelayedTask( | |
127 ID identifier, | |
128 const tracked_objects::Location& from_here, | |
129 const base::Closure& task, | |
130 base::TimeDelta delay); | 121 base::TimeDelta delay); |
131 | 122 |
132 static bool PostTaskAndReply( | 123 static bool PostTaskAndReply( |
133 ID identifier, | 124 ID identifier, |
134 const tracked_objects::Location& from_here, | 125 const tracked_objects::Location& from_here, |
135 const base::Closure& task, | 126 const base::Closure& task, |
136 const base::Closure& reply); | 127 const base::Closure& reply); |
137 | 128 |
138 template <typename ReturnType> | 129 template <typename ReturnType> |
139 static bool PostTaskAndReplyWithResult( | 130 static bool PostTaskAndReplyWithResult( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 private: | 274 private: |
284 friend class BrowserThreadImpl; | 275 friend class BrowserThreadImpl; |
285 | 276 |
286 BrowserThread() {} | 277 BrowserThread() {} |
287 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 278 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
288 }; | 279 }; |
289 | 280 |
290 } // namespace content | 281 } // namespace content |
291 | 282 |
292 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 283 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |