Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: chrome/app/scoped_ole_initializer.h

Issue 9664069: Move scoped_ole_initializer.h to ui/base/win and clean up ole initialization/uninitialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
6 #define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
7 #pragma once
8
9 #include "base/logging.h"
10 #include "build/build_config.h"
11
12 // Wraps OLE initialization in a cross-platform class meant to be used on the
13 // stack so init/uninit is done with scoping. This class is ok for use by
14 // non-windows platforms; it just doesn't do anything.
15
16 #if defined(OS_WIN)
17
18 #include <ole2.h>
19
20 class ScopedOleInitializer {
21 public:
22 ScopedOleInitializer() {
23 int ole_result = OleInitialize(NULL);
24 DCHECK_EQ(S_OK, ole_result);
25 }
26 ~ScopedOleInitializer() {
27 OleUninitialize();
28 }
29 };
30
31 #else
32
33 class ScopedOleInitializer {
34 public:
35 // Empty, this class does nothing on non-win32 systems. Empty ctor is
36 // necessary to avoid "unused variable" warning on gcc.
37 ScopedOleInitializer() { }
38 };
39
40 #endif
41
42 #endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_exe.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698