diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:19:26 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 21:19:26 +0000 |
commit | 1c6441400a2bdb71167809067fb42cf30bb5bfe5 (patch) | |
tree | 4727f42c6c5379e3ea4abf4c8c46b25c4d5ef04e /app | |
parent | 06dc32060d502c4341f61847f9f6054a110e15d5 (diff) | |
download | chromium_src-1c6441400a2bdb71167809067fb42cf30bb5bfe5.zip chromium_src-1c6441400a2bdb71167809067fb42cf30bb5bfe5.tar.gz chromium_src-1c6441400a2bdb71167809067fb42cf30bb5bfe5.tar.bz2 |
Fixed crash when GetClientRect fails.
There is a known race condition with windows being destroyed while the GPU process has a live handle to them. This change treats destroyed windows as having size zero rather than crashing.
TEST=try
BUG=58065
Review URL: http://codereview.chromium.org/3549018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/gfx/gl/gl_context_egl.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/gfx/gl/gl_context_egl.cc b/app/gfx/gl/gl_context_egl.cc index d264384..910a22e 100644 --- a/app/gfx/gl/gl_context_egl.cc +++ b/app/gfx/gl/gl_context_egl.cc @@ -179,7 +179,11 @@ bool NativeViewEGLContext::SwapBuffers() { gfx::Size NativeViewEGLContext::GetSize() { #if defined(OS_WIN) RECT rect; - CHECK(GetClientRect(static_cast<HWND>(window_), &rect)); + if (!GetClientRect(static_cast<HWND>(window_), &rect)) { + DCHECK(false) << "GetClientRect failed."; + return gfx::Size(); + } + return gfx::Size(rect.right - rect.left, rect.bottom - rect.top); #else // TODO(piman): This doesn't work correctly on Windows yet, the size doesn't |