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

Unified Diff: printing/emf_win.cc

Issue 605563002: Remove implicit HANDLE conversions from printing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « printing/backend/win_helper.cc ('k') | printing/image_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/emf_win.cc
diff --git a/printing/emf_win.cc b/printing/emf_win.cc
index f042b2997f73a41fa89447401710c04ceae0520c..e959911484c5d9fc63043893fa807850951adcc7 100644
--- a/printing/emf_win.cc
+++ b/printing/emf_win.cc
@@ -95,33 +95,33 @@ class RasterBitmap {
explicit RasterBitmap(const gfx::Size& raster_size)
: saved_object_(NULL) {
context_.Set(::CreateCompatibleDC(NULL));
- if (!context_) {
+ if (!context_.IsValid()) {
NOTREACHED() << "Bitmap DC creation failed";
return;
}
- ::SetGraphicsMode(context_, GM_ADVANCED);
+ ::SetGraphicsMode(context_.Get(), GM_ADVANCED);
void* bits = NULL;
gfx::Rect bitmap_rect(raster_size);
gfx::CreateBitmapHeader(raster_size.width(), raster_size.height(),
&header_.bmiHeader);
- bitmap_.Set(::CreateDIBSection(context_, &header_, DIB_RGB_COLORS, &bits,
- NULL, 0));
+ bitmap_.Set(::CreateDIBSection(context_.Get(), &header_, DIB_RGB_COLORS,
+ &bits, NULL, 0));
if (!bitmap_)
NOTREACHED() << "Raster bitmap creation for printing failed";
- saved_object_ = ::SelectObject(context_, bitmap_);
+ saved_object_ = ::SelectObject(context_.Get(), bitmap_);
RECT rect = bitmap_rect.ToRECT();
- ::FillRect(context_, &rect,
+ ::FillRect(context_.Get(), &rect,
static_cast<HBRUSH>(::GetStockObject(WHITE_BRUSH)));
}
~RasterBitmap() {
- ::SelectObject(context_, saved_object_);
+ ::SelectObject(context_.Get(), saved_object_);
}
HDC context() const {
- return context_;
+ return context_.Get();
}
base::win::ScopedCreateDC context_;
« no previous file with comments | « printing/backend/win_helper.cc ('k') | printing/image_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698