| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // provides sequencing between tasks with the same sequence token name. | 156 // provides sequencing between tasks with the same sequence token name. |
| 157 // | 157 // |
| 158 // These tasks are guaranteed to run before shutdown. | 158 // These tasks are guaranteed to run before shutdown. |
| 159 // | 159 // |
| 160 // If you need to provide different shutdown semantics (like you have | 160 // If you need to provide different shutdown semantics (like you have |
| 161 // something slow and noncritical that doesn't need to block shutdown), | 161 // something slow and noncritical that doesn't need to block shutdown), |
| 162 // or you want to manually provide a sequence token (which saves a map | 162 // or you want to manually provide a sequence token (which saves a map |
| 163 // lookup and is guaranteed unique without you having to come up with a | 163 // lookup and is guaranteed unique without you having to come up with a |
| 164 // unique string), you can access the sequenced worker pool directly via | 164 // unique string), you can access the sequenced worker pool directly via |
| 165 // GetBlockingPool(). | 165 // GetBlockingPool(). |
| 166 // |
| 167 // If you need to PostTaskAndReplyWithResult, use |
| 168 // base::PostTaskAndReplyWithResult() with GetBlockingPool() as the task |
| 169 // runner. |
| 166 static bool PostBlockingPoolTask(const tracked_objects::Location& from_here, | 170 static bool PostBlockingPoolTask(const tracked_objects::Location& from_here, |
| 167 const base::Closure& task); | 171 const base::Closure& task); |
| 168 static bool PostBlockingPoolTaskAndReply( | 172 static bool PostBlockingPoolTaskAndReply( |
| 169 const tracked_objects::Location& from_here, | 173 const tracked_objects::Location& from_here, |
| 170 const base::Closure& task, | 174 const base::Closure& task, |
| 171 const base::Closure& reply); | 175 const base::Closure& reply); |
| 172 static bool PostBlockingPoolSequencedTask( | 176 static bool PostBlockingPoolSequencedTask( |
| 173 const std::string& sequence_token_name, | 177 const std::string& sequence_token_name, |
| 174 const tracked_objects::Location& from_here, | 178 const tracked_objects::Location& from_here, |
| 175 const base::Closure& task); | 179 const base::Closure& task); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 private: | 269 private: |
| 266 friend class BrowserThreadImpl; | 270 friend class BrowserThreadImpl; |
| 267 | 271 |
| 268 BrowserThread() {} | 272 BrowserThread() {} |
| 269 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 273 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
| 270 }; | 274 }; |
| 271 | 275 |
| 272 } // namespace content | 276 } // namespace content |
| 273 | 277 |
| 274 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 278 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
| OLD | NEW |