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

Side by Side Diff: src/utils/win/SkAutoCoInitialize.cpp

Issue 2041943002: SkLeanWindows.h: #include "Windows.h" fewer places (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-06-07 (Tuesday) 11:28:42 EDT Created 4 years, 6 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
« no previous file with comments | « src/utils/SkThreadUtils_win.h ('k') | src/utils/win/SkIStream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
11 #include "SkAutoCoInitialize.h"
11 12
12 #define WIN32_LEAN_AND_MEAN 13 #include <objbase.h>
13 #include <windows.h> 14 #include <winerror.h>
14 #include <ole2.h>
15 #include "SkAutoCoInitialize.h"
16 15
17 SkAutoCoInitialize::SkAutoCoInitialize() : 16 SkAutoCoInitialize::SkAutoCoInitialize() :
18 fHR( 17 fHR(
19 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DD E) 18 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DD E)
20 ) 19 )
21 { } 20 { }
22 21
23 SkAutoCoInitialize::~SkAutoCoInitialize() { 22 SkAutoCoInitialize::~SkAutoCoInitialize() {
24 if (SUCCEEDED(this->fHR)) { 23 if (SUCCEEDED(this->fHR)) {
25 CoUninitialize(); 24 CoUninitialize();
26 } 25 }
27 } 26 }
28 27
29 bool SkAutoCoInitialize::succeeded() { 28 bool SkAutoCoInitialize::succeeded() {
30 return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR; 29 return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR;
31 } 30 }
32 31
33 #endif//defined(SK_BUILD_FOR_WIN32) 32 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/utils/SkThreadUtils_win.h ('k') | src/utils/win/SkIStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698