1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/utils/win/SkAutoCoInitialize.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 Google Inc. 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 + 1.12 + 1.13 +#ifndef SkAutoCo_DEFINED 1.14 +#define SkAutoCo_DEFINED 1.15 + 1.16 +#define WIN32_LEAN_AND_MEAN 1.17 +#include <windows.h> 1.18 +#include "SkTemplates.h" 1.19 + 1.20 +/** 1.21 + * An instance of this class initializes COM on creation 1.22 + * and closes the COM library on destruction. 1.23 + */ 1.24 +class SkAutoCoInitialize : SkNoncopyable { 1.25 +private: 1.26 + HRESULT fHR; 1.27 +public: 1.28 + SkAutoCoInitialize(); 1.29 + ~SkAutoCoInitialize(); 1.30 + bool succeeded(); 1.31 +}; 1.32 + 1.33 +#endif