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

Side by Side Diff: include/utils/win/SkTScopedComPtr.h

Issue 1488813002: CMake, include/: changes to make fiddle 2.0 better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: whitespace change for reed@ Created 5 years 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 | « include/utils/win/SkIStream.h ('k') | no next file » | 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 #ifndef SkTScopedComPtr_DEFINED 8 #ifndef SkTScopedComPtr_DEFINED
9 #define SkTScopedComPtr_DEFINED 9 #define SkTScopedComPtr_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 12
13 #ifdef SK_BUILD_FOR_WIN
14
13 template<typename T> 15 template<typename T>
14 class SkBlockComRef : public T { 16 class SkBlockComRef : public T {
15 private: 17 private:
16 virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; 18 virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0;
17 virtual ULONG STDMETHODCALLTYPE Release(void) = 0; 19 virtual ULONG STDMETHODCALLTYPE Release(void) = 0;
18 }; 20 };
19 21
20 template<typename T> T* SkRefComPtr(T* ptr) { 22 template<typename T> T* SkRefComPtr(T* ptr) {
21 ptr->AddRef(); 23 ptr->AddRef();
22 return ptr; 24 return ptr;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 that.fPtr = temp; 66 that.fPtr = temp;
65 } 67 }
66 68
67 T* release() { 69 T* release() {
68 T* temp = this->fPtr; 70 T* temp = this->fPtr;
69 this->fPtr = NULL; 71 this->fPtr = NULL;
70 return temp; 72 return temp;
71 } 73 }
72 }; 74 };
73 75
74 #endif 76 #endif // SK_BUILD_FOR_WIN
77 #endif // SkTScopedComPtr_DEFINED
OLDNEW
« no previous file with comments | « include/utils/win/SkIStream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698