OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_AT_EXIT_H_ | 5 #ifndef BASE_AT_EXIT_H_ |
6 #define BASE_AT_EXIT_H_ | 6 #define BASE_AT_EXIT_H_ |
7 | 7 |
8 #include <stack> | 8 #include <stack> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
11 #include "base/basictypes.h" | |
12 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 | 16 |
17 // This class provides a facility similar to the CRT atexit(), except that | 17 // This class provides a facility similar to the CRT atexit(), except that |
18 // we control when the callbacks are executed. Under Windows for a DLL they | 18 // we control when the callbacks are executed. Under Windows for a DLL they |
19 // happen at a really bad time and under the loader lock. This facility is | 19 // happen at a really bad time and under the loader lock. This facility is |
20 // mostly used by base::Singleton. | 20 // mostly used by base::Singleton. |
21 // | 21 // |
22 // The usage is simple. Early in the main() or WinMain() scope create an | 22 // The usage is simple. Early in the main() or WinMain() scope create an |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #if defined(UNIT_TEST) | 67 #if defined(UNIT_TEST) |
68 class ShadowingAtExitManager : public AtExitManager { | 68 class ShadowingAtExitManager : public AtExitManager { |
69 public: | 69 public: |
70 ShadowingAtExitManager() : AtExitManager(true) {} | 70 ShadowingAtExitManager() : AtExitManager(true) {} |
71 }; | 71 }; |
72 #endif // defined(UNIT_TEST) | 72 #endif // defined(UNIT_TEST) |
73 | 73 |
74 } // namespace base | 74 } // namespace base |
75 | 75 |
76 #endif // BASE_AT_EXIT_H_ | 76 #endif // BASE_AT_EXIT_H_ |
OLD | NEW |