From 63ea79bddeb91ef4741ed12a300dea3618b6b9eb Mon Sep 17 00:00:00 2001 From: "kbr@google.com" Date: Tue, 7 Jul 2009 00:42:14 +0000 Subject: Worked around infinite loop seen in Chrome on Windows when raising and dismissing JavaScript alert over O3D view Review URL: http://codereview.chromium.org/155119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20002 0039d316-1c4b-4281-b951-d872f2087c98 --- o3d/plugin/win/main_win.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'o3d/plugin') diff --git a/o3d/plugin/win/main_win.cc b/o3d/plugin/win/main_win.cc index 90f8d44..57623d2 100644 --- a/o3d/plugin/win/main_win.cc +++ b/o3d/plugin/win/main_win.cc @@ -472,6 +472,10 @@ WindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_PAINT: { if (reentrance_count.get() > 1) { + // In Chrome, alert dialogs raised from JavaScript cause + // reentrant WM_PAINT messages to be dispatched and 100% CPU + // to be consumed unless we call this + ::ValidateRect(hWnd, NULL); break; // Ignore this message; we're reentrant. } PAINTSTRUCT paint_struct; -- cgit v1.1