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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // | 307 // |
308 // ... | 308 // ... |
309 // private: | 309 // private: |
310 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 310 // friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
311 // friend class base::DeleteHelper<Foo>; | 311 // friend class base::DeleteHelper<Foo>; |
312 // | 312 // |
313 // ~Foo(); | 313 // ~Foo(); |
314 // | 314 // |
315 // Sample usage with scoped_ptr: | 315 // Sample usage with scoped_ptr: |
316 // std::unique_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr; | 316 // std::unique_ptr<Foo, BrowserThread::DeleteOnIOThread> ptr; |
| 317 // |
| 318 // Note: when migrating BrowserThreads to TaskScheduler based |
| 319 // SequencedTaskRunners these map to base::OnTaskRunnerDeleter. |
317 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; | 320 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; |
318 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; | 321 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; |
319 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; | 322 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; |
320 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; | 323 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; |
321 | 324 |
322 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. | 325 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. |
323 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); | 326 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); |
324 | 327 |
325 private: | 328 private: |
326 friend class BrowserThreadImpl; | 329 friend class BrowserThreadImpl; |
327 | 330 |
328 BrowserThread() {} | 331 BrowserThread() {} |
329 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 332 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
330 }; | 333 }; |
331 | 334 |
332 } // namespace content | 335 } // namespace content |
333 | 336 |
334 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 337 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
OLD | NEW |