OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 IOS_WEB_PUBLIC_WEB_THREAD_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_THREAD_H_ |
6 #define IOS_WEB_PUBLIC_WEB_THREAD_H_ | 6 #define IOS_WEB_PUBLIC_WEB_THREAD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 const base::Closure& reply); | 167 const base::Closure& reply); |
168 static bool PostBlockingPoolSequencedTask( | 168 static bool PostBlockingPoolSequencedTask( |
169 const std::string& sequence_token_name, | 169 const std::string& sequence_token_name, |
170 const tracked_objects::Location& from_here, | 170 const tracked_objects::Location& from_here, |
171 const base::Closure& task); | 171 const base::Closure& task); |
172 | 172 |
173 // Returns the thread pool used for blocking file I/O. Use this object to | 173 // Returns the thread pool used for blocking file I/O. Use this object to |
174 // perform random blocking operations such as file writes. | 174 // perform random blocking operations such as file writes. |
175 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT; | 175 static base::SequencedWorkerPool* GetBlockingPool() WARN_UNUSED_RESULT; |
176 | 176 |
177 // Returns a pointer to the thread's message loop, which will become | |
178 // invalid during shutdown, so you probably shouldn't hold onto it. | |
179 // | |
180 // This must not be called before the thread is started, or after | |
181 // the thread is stopped, or it will DCHECK. | |
182 // | |
183 // Ownership remains with the WebThread implementation, so you must not | |
184 // delete the pointer. | |
185 static base::MessageLoop* UnsafeGetMessageLoopForThread(ID identifier); | |
186 | |
187 // Callable on any thread. Returns whether the given well-known thread is | 177 // Callable on any thread. Returns whether the given well-known thread is |
188 // initialized. | 178 // initialized. |
189 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT; | 179 static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT; |
190 | 180 |
191 // Callable on any thread. Returns whether execution is currently on the | 181 // Callable on any thread. Returns whether execution is currently on the |
192 // given thread. To DCHECK this, use the DCHECK_CURRENTLY_ON() macro above. | 182 // given thread. To DCHECK this, use the DCHECK_CURRENTLY_ON() macro above. |
193 static bool CurrentlyOn(ID identifier) WARN_UNUSED_RESULT; | 183 static bool CurrentlyOn(ID identifier) WARN_UNUSED_RESULT; |
194 | 184 |
195 // Callable on any thread. Returns whether the threads message loop is valid. | 185 // Callable on any thread. Returns whether the threads message loop is valid. |
196 // If this returns false it means the thread is in the process of shutting | 186 // If this returns false it means the thread is in the process of shutting |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 private: | 259 private: |
270 friend class WebThreadImpl; | 260 friend class WebThreadImpl; |
271 | 261 |
272 WebThread() {} | 262 WebThread() {} |
273 DISALLOW_COPY_AND_ASSIGN(WebThread); | 263 DISALLOW_COPY_AND_ASSIGN(WebThread); |
274 }; | 264 }; |
275 | 265 |
276 } // namespace web | 266 } // namespace web |
277 | 267 |
278 #endif // IOS_WEB_PUBLIC_WEB_THREAD_H_ | 268 #endif // IOS_WEB_PUBLIC_WEB_THREAD_H_ |
OLD | NEW |