| 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; | 18 class AcceleratedPresenter; |
| 19 class BrowserProcessImpl; | 19 class BrowserProcessImpl; |
| 20 class HistogramSynchronizer; | 20 class HistogramSynchronizer; |
| 21 class GpuChannelHost; | 21 class GpuChannelHost; |
| 22 class MetricsService; | 22 class MetricsService; |
| 23 class NativeBackendKWallet; | 23 class NativeBackendKWallet; |
| 24 class RenderWidgetHelper; | |
| 25 class TestingAutomationProvider; | 24 class TestingAutomationProvider; |
| 26 class TextInputClientMac; | 25 class TextInputClientMac; |
| 27 | 26 |
| 28 namespace browser_sync { | 27 namespace browser_sync { |
| 29 class NonFrontendDataTypeController; | 28 class NonFrontendDataTypeController; |
| 30 class UIModelWorker; | 29 class UIModelWorker; |
| 31 } | 30 } |
| 32 namespace chromeos { | 31 namespace chromeos { |
| 33 class AudioMixerAlsa; | 32 class AudioMixerAlsa; |
| 34 class BlockingMethodCaller; | 33 class BlockingMethodCaller; |
| 35 namespace system { | 34 namespace system { |
| 36 class StatisticsProviderImpl; | 35 class StatisticsProviderImpl; |
| 37 } | 36 } |
| 38 } | 37 } |
| 39 namespace chrome_browser_net { | 38 namespace chrome_browser_net { |
| 40 class Predictor; | 39 class Predictor; |
| 41 } | 40 } |
| 42 namespace content { | 41 namespace content { |
| 43 class BrowserGpuChannelHostFactory; | 42 class BrowserGpuChannelHostFactory; |
| 44 class GLHelper; | 43 class GLHelper; |
| 44 class RenderWidgetHelper; |
| 45 } | 45 } |
| 46 namespace dbus { | 46 namespace dbus { |
| 47 class Bus; | 47 class Bus; |
| 48 } | 48 } |
| 49 namespace disk_cache { | 49 namespace disk_cache { |
| 50 class BackendImpl; | 50 class BackendImpl; |
| 51 class InFlightIO; | 51 class InFlightIO; |
| 52 } | 52 } |
| 53 namespace media { | 53 namespace media { |
| 54 class AudioOutputController; | 54 class AudioOutputController; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 static void AssertIOAllowed() {} | 152 static void AssertIOAllowed() {} |
| 153 static bool SetSingletonAllowed(bool allowed) { return true; } | 153 static bool SetSingletonAllowed(bool allowed) { return true; } |
| 154 static void AssertSingletonAllowed() {} | 154 static void AssertSingletonAllowed() {} |
| 155 static void DisallowWaiting() {} | 155 static void DisallowWaiting() {} |
| 156 static void AssertWaitAllowed() {} | 156 static void AssertWaitAllowed() {} |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 // DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to jam or brettw first. | 160 // DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to jam or brettw first. |
| 161 // BEGIN ALLOWED USAGE. | 161 // BEGIN ALLOWED USAGE. |
| 162 friend class content::RenderWidgetHelper; |
| 162 friend class ::HistogramSynchronizer; | 163 friend class ::HistogramSynchronizer; |
| 163 friend class ::RenderWidgetHelper; | |
| 164 friend class ::TestingAutomationProvider; | 164 friend class ::TestingAutomationProvider; |
| 165 friend class SequencedWorkerPool; | 165 friend class SequencedWorkerPool; |
| 166 friend class SimpleThread; | 166 friend class SimpleThread; |
| 167 friend class Thread; | 167 friend class Thread; |
| 168 friend class ThreadTestHelper; | 168 friend class ThreadTestHelper; |
| 169 // END ALLOWED USAGE. | 169 // END ALLOWED USAGE. |
| 170 // BEGIN USAGE THAT NEEDS TO BE FIXED. | 170 // BEGIN USAGE THAT NEEDS TO BE FIXED. |
| 171 friend class ::chromeos::AudioMixerAlsa; // http://crbug.com/125206 | 171 friend class ::chromeos::AudioMixerAlsa; // http://crbug.com/125206 |
| 172 friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 | 172 friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360 |
| 173 friend class ::chromeos::system::StatisticsProviderImpl; // http://crbug.com/
125385 | 173 friend class ::chromeos::system::StatisticsProviderImpl; // http://crbug.com/
125385 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 DISALLOW_COPY_AND_ASSIGN(ScopedAllowWait); | 214 DISALLOW_COPY_AND_ASSIGN(ScopedAllowWait); |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); | 217 DISALLOW_IMPLICIT_CONSTRUCTORS(ThreadRestrictions); |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 } // namespace base | 220 } // namespace base |
| 221 | 221 |
| 222 #endif // BASE_THREADING_THREAD_RESTRICTIONS_H_ | 222 #endif // BASE_THREADING_THREAD_RESTRICTIONS_H_ |
| OLD | NEW |