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

Unified Diff: chrome/app/scoped_ole_initializer.h

Issue 17426: remove chrome dependencies from win sandboxing headers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/app/scoped_ole_initializer.h
===================================================================
--- chrome/app/scoped_ole_initializer.h (revision 0)
+++ chrome/app/scoped_ole_initializer.h (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
+#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
+
+// Wraps OLE initialization in a cross-platform class meant to be used on the
+// stack so init/uninit is done with scoping. This class is ok for use by
+// non-windows platforms; it just doesn't do anything.
+
+#if defined(OS_WIN)
+
+class ScopedOleInitializer {
+ public:
+ ScopedOleInitializer() {
+ int ole_result = OleInitialize(NULL);
+ DCHECK(ole_result == S_OK);
+ }
+ ~ScopedOleInitializer() {
+ OleUninitialize();
+ }
+};
+
+#else
+
+class ScopedOleInitializer {
+ public:
+ // Empty, this class does nothing on non-win32 systems. Empty ctor is
+ // necessary to avoid "unused variable" warning on gcc.
+ ScopedOleInitializer() { };
brettw 2009/01/09 18:10:47 Nit: no semicolon.
+};
+
+#endif
+
+#endif // CHROME_APP_SCOPED_OLE_INITIALIZER_H_
Property changes on: chrome/app/scoped_ole_initializer.h
___________________________________________________________________
Name: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698