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

Side by Side Diff: base/scoped_handle_win.h

Issue 17246: Add V8 bindings for Worker (Part I). (Closed) Base URL: http://src.chromium.org/svn/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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_SCOPED_HANDLE_WIN_H_ 5 #ifndef BASE_SCOPED_HANDLE_WIN_H_
6 #define BASE_SCOPED_HANDLE_WIN_H_ 6 #define BASE_SCOPED_HANDLE_WIN_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 void Set(HDC h) { 124 void Set(HDC h) {
125 Close(); 125 Close();
126 hdc_ = h; 126 hdc_ = h;
127 } 127 }
128 128
129 operator HDC() { return hdc_; } 129 operator HDC() { return hdc_; }
130 130
131 private: 131 private:
132 void Close() { 132 void Close() {
133 #ifdef NOGDI
134 assert(false);
135 #else
133 if (hdc_) 136 if (hdc_)
134 DeleteDC(hdc_); 137 DeleteDC(hdc_);
138 #endif // NOGDI
135 } 139 }
136 140
137 HDC hdc_; 141 HDC hdc_;
138 DISALLOW_EVIL_CONSTRUCTORS(ScopedHDC); 142 DISALLOW_EVIL_CONSTRUCTORS(ScopedHDC);
139 }; 143 };
140 144
141 // Like ScopedHandle but for GDI objects. 145 // Like ScopedHandle but for GDI objects.
142 template<class T> 146 template<class T>
143 class ScopedGDIObject { 147 class ScopedGDIObject {
144 public: 148 public:
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 private: 209 private:
206 HGLOBAL glob_; 210 HGLOBAL glob_;
207 211
208 T* data_; 212 T* data_;
209 213
210 DISALLOW_EVIL_CONSTRUCTORS(ScopedHGlobal); 214 DISALLOW_EVIL_CONSTRUCTORS(ScopedHGlobal);
211 }; 215 };
212 216
213 #endif // BASE_SCOPED_HANDLE_WIN_H_ 217 #endif // BASE_SCOPED_HANDLE_WIN_H_
214 218
OLDNEW
« no previous file with comments | « no previous file | base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698