Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / base / win / scoped_ole_initializer.h
blobb2e81d22c419e14ec0ebc4719f851a3e47085889
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
3 // found in the LICENSE file.
5 #ifndef UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_
6 #define UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_
8 #include <ole2.h>
10 #include "base/basictypes.h"
11 #include "ui/base/ui_base_export.h"
13 namespace ui {
15 class UI_BASE_EXPORT ScopedOleInitializer {
16 public:
17 ScopedOleInitializer();
18 ~ScopedOleInitializer();
20 private:
21 #ifndef NDEBUG
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
24 // was initially created on. If that ever happens it can have bad
25 // consequences and the cause can be tricky to track down.
26 DWORD thread_id_;
27 #endif
28 HRESULT hr_;
30 DISALLOW_COPY_AND_ASSIGN(ScopedOleInitializer);
33 } // namespace
35 #endif // UI_BASE_WIN_SCOPED_OLE_INITIALIZER_H_