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 UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ | 5 #ifndef UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ |
6 #define UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ | 6 #define UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ |
7 | 7 |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_base_export.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 | 14 |
15 class UI_EXPORT ScopedOleInitializer { | 15 class UI_BASE_EXPORT ScopedOleInitializer { |
16 public: | 16 public: |
17 ScopedOleInitializer(); | 17 ScopedOleInitializer(); |
18 ~ScopedOleInitializer(); | 18 ~ScopedOleInitializer(); |
19 | 19 |
20 private: | 20 private: |
21 #ifndef NDEBUG | 21 #ifndef NDEBUG |
22 // In debug builds we use this variable to catch a potential bug where a | 22 // In debug builds we use this variable to catch a potential bug where a |
23 // ScopedOleInitializer instance is deleted on a different thread than it | 23 // ScopedOleInitializer instance is deleted on a different thread than it |
24 // was initially created on. If that ever happens it can have bad | 24 // was initially created on. If that ever happens it can have bad |
25 // consequences and the cause can be tricky to track down. | 25 // consequences and the cause can be tricky to track down. |
26 DWORD thread_id_; | 26 DWORD thread_id_; |
27 #endif | 27 #endif |
28 HRESULT hr_; | 28 HRESULT hr_; |
29 | 29 |
30 DISALLOW_COPY_AND_ASSIGN(ScopedOleInitializer); | 30 DISALLOW_COPY_AND_ASSIGN(ScopedOleInitializer); |
31 }; | 31 }; |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 #endif // UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ | 35 #endif // UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_ |
OLD | NEW |