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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // get posted to the MessageLoop if it's still alive, or be deleted otherwise. | 102 // get posted to the MessageLoop if it's still alive, or be deleted otherwise. |
103 // They return true iff the thread existed and the task was posted. Note that | 103 // They return true iff the thread existed and the task was posted. Note that |
104 // even if the task is posted, there's no guarantee that it will run, since | 104 // even if the task is posted, there's no guarantee that it will run, since |
105 // the target thread may already have a Quit message in its queue. | 105 // the target thread may already have a Quit message in its queue. |
106 static bool PostTask(ID identifier, | 106 static bool PostTask(ID identifier, |
107 const tracked_objects::Location& from_here, | 107 const tracked_objects::Location& from_here, |
108 const base::Closure& task); | 108 const base::Closure& task); |
109 static bool PostDelayedTask(ID identifier, | 109 static bool PostDelayedTask(ID identifier, |
110 const tracked_objects::Location& from_here, | 110 const tracked_objects::Location& from_here, |
111 const base::Closure& task, | 111 const base::Closure& task, |
112 int64 delay_ms); | |
113 static bool PostDelayedTask(ID identifier, | |
114 const tracked_objects::Location& from_here, | |
115 const base::Closure& task, | |
116 base::TimeDelta delay); | 112 base::TimeDelta delay); |
117 static bool PostNonNestableTask(ID identifier, | 113 static bool PostNonNestableTask(ID identifier, |
118 const tracked_objects::Location& from_here, | 114 const tracked_objects::Location& from_here, |
119 const base::Closure& task); | 115 const base::Closure& task); |
120 static bool PostNonNestableDelayedTask( | 116 static bool PostNonNestableDelayedTask( |
121 ID identifier, | 117 ID identifier, |
122 const tracked_objects::Location& from_here, | 118 const tracked_objects::Location& from_here, |
123 const base::Closure& task, | 119 const base::Closure& task, |
124 int64 delay_ms); | |
125 static bool PostNonNestableDelayedTask( | |
126 ID identifier, | |
127 const tracked_objects::Location& from_here, | |
128 const base::Closure& task, | |
129 base::TimeDelta delay); | 120 base::TimeDelta delay); |
130 | 121 |
131 static bool PostTaskAndReply( | 122 static bool PostTaskAndReply( |
132 ID identifier, | 123 ID identifier, |
133 const tracked_objects::Location& from_here, | 124 const tracked_objects::Location& from_here, |
134 const base::Closure& task, | 125 const base::Closure& task, |
135 const base::Closure& reply); | 126 const base::Closure& reply); |
136 | 127 |
137 template <class T> | 128 template <class T> |
138 static bool DeleteSoon(ID identifier, | 129 static bool DeleteSoon(ID identifier, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 private: | 256 private: |
266 friend class BrowserThreadImpl; | 257 friend class BrowserThreadImpl; |
267 | 258 |
268 BrowserThread() {} | 259 BrowserThread() {} |
269 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 260 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
270 }; | 261 }; |
271 | 262 |
272 } // namespace content | 263 } // namespace content |
273 | 264 |
274 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 265 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |