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

Unified Diff: base/win/scoped_hdc.h

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win/scoped_handle.cc ('k') | base/win/scoped_hglobal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/scoped_hdc.h
diff --git a/base/win/scoped_hdc.h b/base/win/scoped_hdc.h
deleted file mode 100644
index 2452067dfb32c7a45ad6f44f8ce7fbcdf87d9d3a..0000000000000000000000000000000000000000
--- a/base/win/scoped_hdc.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_WIN_SCOPED_HDC_H_
-#define BASE_WIN_SCOPED_HDC_H_
-
-#include <windows.h>
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-#include "base/win/scoped_handle.h"
-
-namespace base {
-namespace win {
-
-// Like ScopedHandle but for HDC. Only use this on HDCs returned from
-// GetDC.
-class ScopedGetDC {
- public:
- explicit ScopedGetDC(HWND hwnd)
- : hwnd_(hwnd),
- hdc_(GetDC(hwnd)) {
- if (hwnd_) {
- DCHECK(IsWindow(hwnd_));
- DCHECK(hdc_);
- } else {
- // If GetDC(NULL) returns NULL, something really bad has happened, like
- // GDI handle exhaustion. In this case Chrome is going to behave badly no
- // matter what, so we may as well just force a crash now.
- CHECK(hdc_);
- }
- }
-
- ~ScopedGetDC() {
- if (hdc_)
- ReleaseDC(hwnd_, hdc_);
- }
-
- operator HDC() { return hdc_; }
-
- private:
- HWND hwnd_;
- HDC hdc_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedGetDC);
-};
-
-// Like ScopedHandle but for HDC. Only use this on HDCs returned from
-// CreateCompatibleDC, CreateDC and CreateIC.
-class CreateDCTraits {
- public:
- typedef HDC Handle;
-
- static bool CloseHandle(HDC handle) {
- return ::DeleteDC(handle) != FALSE;
- }
-
- static bool IsHandleValid(HDC handle) {
- return handle != NULL;
- }
-
- static HDC NullHandle() {
- return NULL;
- }
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(CreateDCTraits);
-};
-
-typedef GenericScopedHandle<CreateDCTraits, DummyVerifierTraits> ScopedCreateDC;
-
-} // namespace win
-} // namespace base
-
-#endif // BASE_WIN_SCOPED_HDC_H_
« no previous file with comments | « base/win/scoped_handle.cc ('k') | base/win/scoped_hglobal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698