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 BASE_THREADING_THREAD_RESTRICTIONS_H_ | 5 #ifndef BASE_THREADING_THREAD_RESTRICTIONS_H_ |
6 #define BASE_THREADING_THREAD_RESTRICTIONS_H_ | 6 #define BASE_THREADING_THREAD_RESTRICTIONS_H_ |
7 | 7 |
8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 | 10 |
11 // See comment at top of thread_checker.h | 11 // See comment at top of thread_checker.h |
12 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) | 12 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) |
13 #define ENABLE_THREAD_RESTRICTIONS 1 | 13 #define ENABLE_THREAD_RESTRICTIONS 1 |
14 #else | 14 #else |
15 #define ENABLE_THREAD_RESTRICTIONS 0 | 15 #define ENABLE_THREAD_RESTRICTIONS 0 |
16 #endif | 16 #endif |
17 | 17 |
18 class AcceleratedPresenter; | |
19 class BrowserProcessImpl; | 18 class BrowserProcessImpl; |
20 class HistogramSynchronizer; | 19 class HistogramSynchronizer; |
21 class NativeBackendKWallet; | 20 class NativeBackendKWallet; |
22 class ScopedAllowWaitForLegacyWebViewApi; | 21 class ScopedAllowWaitForLegacyWebViewApi; |
23 class TestingAutomationProvider; | 22 class TestingAutomationProvider; |
24 | 23 |
25 namespace browser_sync { | |
26 class NonFrontendDataTypeController; | |
27 class UIModelWorker; | |
28 } | |
29 namespace cc { | 24 namespace cc { |
30 class CompletionEvent; | 25 class CompletionEvent; |
31 } | 26 } |
32 namespace chromeos { | 27 namespace chromeos { |
33 class AudioMixerAlsa; | |
34 class BlockingMethodCaller; | 28 class BlockingMethodCaller; |
35 namespace system { | 29 namespace system { |
36 class StatisticsProviderImpl; | 30 class StatisticsProviderImpl; |
37 } | 31 } |
38 } | 32 } |
39 namespace chrome_browser_net { | 33 namespace chrome_browser_net { |
40 class Predictor; | 34 class Predictor; |
41 } | 35 } |
42 namespace content { | 36 namespace content { |
43 class BrowserGpuChannelHostFactory; | 37 class BrowserGpuChannelHostFactory; |
44 class BrowserGpuMemoryBufferManager; | 38 class BrowserGpuMemoryBufferManager; |
45 class BrowserShutdownProfileDumper; | 39 class BrowserShutdownProfileDumper; |
46 class BrowserTestBase; | 40 class BrowserTestBase; |
47 class GLHelper; | |
48 class GpuChannelHost; | 41 class GpuChannelHost; |
49 class NestedMessagePumpAndroid; | 42 class NestedMessagePumpAndroid; |
50 class RenderWidgetResizeHelper; | 43 class RenderWidgetResizeHelper; |
51 class ScopedAllowWaitForAndroidLayoutTests; | 44 class ScopedAllowWaitForAndroidLayoutTests; |
52 class TextInputClientMac; | 45 class TextInputClientMac; |
53 } | 46 } |
54 namespace dbus { | 47 namespace dbus { |
55 class Bus; | 48 class Bus; |
56 } | 49 } |
57 namespace disk_cache { | 50 namespace disk_cache { |
58 class BackendImpl; | 51 class BackendImpl; |
59 class InFlightIO; | 52 class InFlightIO; |
60 } | 53 } |
61 namespace media { | |
62 class AudioOutputController; | |
63 } | |
64 namespace metrics { | |
65 class MetricsService; | |
66 } | |
67 namespace mojo { | 54 namespace mojo { |
68 namespace common { | 55 namespace common { |
69 class WatcherThreadManager; | 56 class WatcherThreadManager; |
70 } | 57 } |
71 } | 58 } |
72 namespace net { | 59 namespace net { |
73 class FileStreamPosix; | |
74 class FileStreamWin; | |
75 namespace internal { | 60 namespace internal { |
76 class AddressTrackerLinux; | 61 class AddressTrackerLinux; |
77 } | 62 } |
78 } | 63 } |
79 | 64 |
80 namespace remoting { | 65 namespace remoting { |
81 class AutoThread; | 66 class AutoThread; |
82 } | 67 } |
83 | 68 |
84 namespace base { | 69 namespace base { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 friend class MessagePumpDefault; | 184 friend class MessagePumpDefault; |
200 friend class SequencedWorkerPool; | 185 friend class SequencedWorkerPool; |
201 friend class SimpleThread; | 186 friend class SimpleThread; |
202 friend class Thread; | 187 friend class Thread; |
203 friend class ThreadTestHelper; | 188 friend class ThreadTestHelper; |
204 friend class PlatformThread; | 189 friend class PlatformThread; |
205 friend class android::JavaHandlerThread; | 190 friend class android::JavaHandlerThread; |
206 | 191 |
207 // END ALLOWED USAGE. | 192 // END ALLOWED USAGE. |
208 // BEGIN USAGE THAT NEEDS TO BE FIXED. | 193 // BEGIN USAGE THAT NEEDS TO BE FIXED. |
209 friend class ::chromeos::AudioMixerAlsa; // http://crbug.com/125206 | |
210 friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 | 194 friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 |
211 friend class ::chromeos::system::StatisticsProviderImpl; // http://crbug.com/
125385 | 195 friend class ::chromeos::system::StatisticsProviderImpl; // http://crbug.com/
125385 |
212 friend class browser_sync::NonFrontendDataTypeController; // http://crbug.com
/19757 | |
213 friend class browser_sync::UIModelWorker; // http://crbug.com/19757 | |
214 friend class chrome_browser_net::Predictor; // http://crbug.com/78451 | 196 friend class chrome_browser_net::Predictor; // http://crbug.com/78451 |
215 friend class | 197 friend class |
216 content::BrowserGpuChannelHostFactory; // http://crbug.com/125248 | 198 content::BrowserGpuChannelHostFactory; // http://crbug.com/125248 |
217 friend class | 199 friend class |
218 content::BrowserGpuMemoryBufferManager; // http://crbug.com/420368 | 200 content::BrowserGpuMemoryBufferManager; // http://crbug.com/420368 |
219 friend class content::GLHelper; // http://crbug.com/125415 | |
220 friend class content::GpuChannelHost; // http://crbug.com/125264 | 201 friend class content::GpuChannelHost; // http://crbug.com/125264 |
221 friend class content::TextInputClientMac; // http://crbug.com/121917 | 202 friend class content::TextInputClientMac; // http://crbug.com/121917 |
222 friend class dbus::Bus; // http://crbug.com/125222 | 203 friend class dbus::Bus; // http://crbug.com/125222 |
223 friend class disk_cache::BackendImpl; // http://crbug.com/74623 | 204 friend class disk_cache::BackendImpl; // http://crbug.com/74623 |
224 friend class disk_cache::InFlightIO; // http://crbug.com/74623 | 205 friend class disk_cache::InFlightIO; // http://crbug.com/74623 |
225 friend class media::AudioOutputController; // http://crbug.com/120973 | |
226 friend class net::FileStreamPosix; // http://crbug.com/115067 | |
227 friend class net::FileStreamWin; // http://crbug.com/115067 | |
228 friend class net::internal::AddressTrackerLinux; // http://crbug.com/125097 | 206 friend class net::internal::AddressTrackerLinux; // http://crbug.com/125097 |
229 friend class ::AcceleratedPresenter; // http://crbug.com/125391 | |
230 friend class ::BrowserProcessImpl; // http://crbug.com/125207 | 207 friend class ::BrowserProcessImpl; // http://crbug.com/125207 |
231 friend class metrics::MetricsService; // http://crbug.com/124954 | |
232 friend class ::NativeBackendKWallet; // http://crbug.com/125331 | 208 friend class ::NativeBackendKWallet; // http://crbug.com/125331 |
233 // END USAGE THAT NEEDS TO BE FIXED. | 209 // END USAGE THAT NEEDS TO BE FIXED. |
234 | 210 |
235 #if ENABLE_THREAD_RESTRICTIONS | 211 #if ENABLE_THREAD_RESTRICTIONS |
236 static bool SetWaitAllowed(bool allowed); | 212 static bool SetWaitAllowed(bool allowed); |
237 #else | 213 #else |
238 static bool SetWaitAllowed(bool allowed) { return true; } | 214 static bool SetWaitAllowed(bool allowed) { return true; } |
239 #endif | 215 #endif |
240 | 216 |
241 // Constructing a ScopedAllowWait temporarily allows waiting on the current | 217 // Constructing a ScopedAllowWait temporarily allows waiting on the current |
(...skipping 11 matching lines...) Expand all Loading... |
253 | 229 |
254 DISALLOW_COPY_AND_ASSIGN(ScopedAllowWait); | 230 DISALLOW_COPY_AND_ASSIGN(ScopedAllowWait); |
255 }; | 231 }; |
256 | 232 |
257 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); | 233 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); |
258 }; | 234 }; |
259 | 235 |
260 } // namespace base | 236 } // namespace base |
261 | 237 |
262 #endif // BASE_THREADING_THREAD_RESTRICTIONS_H_ | 238 #endif // BASE_THREADING_THREAD_RESTRICTIONS_H_ |
OLD | NEW |