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

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-06 (Monday) 14:22:16 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
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
12 #define WIN32_LEAN_AND_MEAN
13 #include <windows.h>
14 #include <ole2.h> 11 #include <ole2.h>
bungeman-skia 2016/06/06 18:45:56 This should probably just be objbase.h and winerro
hal.canary 2016/06/06 19:38:28 Done.
15 #include "SkAutoCoInitialize.h" 12 #include "SkAutoCoInitialize.h"
16 13
17 SkAutoCoInitialize::SkAutoCoInitialize() : 14 SkAutoCoInitialize::SkAutoCoInitialize() :
18 fHR( 15 fHR(
19 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DD E) 16 CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DD E)
20 ) 17 )
21 { } 18 { }
22 19
23 SkAutoCoInitialize::~SkAutoCoInitialize() { 20 SkAutoCoInitialize::~SkAutoCoInitialize() {
24 if (SUCCEEDED(this->fHR)) { 21 if (SUCCEEDED(this->fHR)) {
25 CoUninitialize(); 22 CoUninitialize();
26 } 23 }
27 } 24 }
28 25
29 bool SkAutoCoInitialize::succeeded() { 26 bool SkAutoCoInitialize::succeeded() {
30 return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR; 27 return SUCCEEDED(this->fHR) || RPC_E_CHANGED_MODE == this->fHR;
31 } 28 }
32 29
33 #endif//defined(SK_BUILD_FOR_WIN32) 30 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698