| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // | 317 // |
| 318 // Note: when migrating BrowserThreads to TaskScheduler based | 318 // Note: when migrating BrowserThreads to TaskScheduler based |
| 319 // SequencedTaskRunners these map to base::OnTaskRunnerDeleter. | 319 // SequencedTaskRunners these map to base::OnTaskRunnerDeleter and |
| 320 // base::RefCountedDeleteOnSequence. |
| 320 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; | 321 struct DeleteOnUIThread : public DeleteOnThread<UI> { }; |
| 321 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; | 322 struct DeleteOnIOThread : public DeleteOnThread<IO> { }; |
| 322 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; | 323 struct DeleteOnFileThread : public DeleteOnThread<FILE> { }; |
| 323 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; | 324 struct DeleteOnDBThread : public DeleteOnThread<DB> { }; |
| 324 | 325 |
| 325 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. | 326 // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. |
| 326 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); | 327 static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); |
| 327 | 328 |
| 328 private: | 329 private: |
| 329 friend class BrowserThreadImpl; | 330 friend class BrowserThreadImpl; |
| 330 | 331 |
| 331 BrowserThread() {} | 332 BrowserThread() {} |
| 332 DISALLOW_COPY_AND_ASSIGN(BrowserThread); | 333 DISALLOW_COPY_AND_ASSIGN(BrowserThread); |
| 333 }; | 334 }; |
| 334 | 335 |
| 335 } // namespace content | 336 } // namespace content |
| 336 | 337 |
| 337 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ | 338 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_THREAD_H_ |
| OLD | NEW |