| Index: base/win/scoped_hdc.h
|
| ===================================================================
|
| --- base/win/scoped_hdc.h (revision 140592)
|
| +++ base/win/scoped_hdc.h (working copy)
|
| @@ -21,8 +21,15 @@
|
| explicit ScopedGetDC(HWND hwnd)
|
| : hwnd_(hwnd),
|
| hdc_(GetDC(hwnd)) {
|
| - DCHECK(!hwnd_ || IsWindow(hwnd_));
|
| - DCHECK(hdc_);
|
| + 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() {
|
|
|