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_BROWSER_BROWSER_THREAD_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
7 | 7 |
8 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
| 15 // Very few users should use this directly. To mock BrowserThreads, tests should |
| 16 // use TestBrowserThreadBundle instead. |
15 class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, | 17 class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, |
16 public base::Thread { | 18 public base::Thread { |
17 public: | 19 public: |
18 // Construct a BrowserThreadImpl with the supplied identifier. It is an error | 20 // Construct a BrowserThreadImpl with the supplied identifier. It is an error |
19 // to construct a BrowserThreadImpl that already exists. | 21 // to construct a BrowserThreadImpl that already exists. |
20 explicit BrowserThreadImpl(BrowserThread::ID identifier); | 22 explicit BrowserThreadImpl(BrowserThread::ID identifier); |
21 | 23 |
22 // Special constructor for the main (UI) thread and unittests. If a | 24 // Special constructor for the main (UI) thread and unittests. If a |
23 // |message_loop| is provied, we use a dummy thread here since the main | 25 // |message_loop| is provied, we use a dummy thread here since the main |
24 // thread already exists. | 26 // thread already exists. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 static void FlushThreadPoolHelperForTesting(); | 71 static void FlushThreadPoolHelperForTesting(); |
70 | 72 |
71 // The identifier of this thread. Only one thread can exist with a given | 73 // The identifier of this thread. Only one thread can exist with a given |
72 // identifier at a given time. | 74 // identifier at a given time. |
73 ID identifier_; | 75 ID identifier_; |
74 }; | 76 }; |
75 | 77 |
76 } // namespace content | 78 } // namespace content |
77 | 79 |
78 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ | 80 #endif // CONTENT_BROWSER_BROWSER_THREAD_IMPL_H_ |
OLD | NEW |