summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:32:21 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:32:21 +0000
commit12636df0dcf36c769c8a5940d6a0c0b6b6a6647c (patch)
tree5ff7eccca7457afe24c47a277286c834108e825c /chrome/renderer/render_view.h
parentca3f22c070a6b61a3ec40ace07244890bbdd6ebe (diff)
downloadchromium_src-12636df0dcf36c769c8a5940d6a0c0b6b6a6647c.zip
chromium_src-12636df0dcf36c769c8a5940d6a0c0b6b6a6647c.tar.gz
chromium_src-12636df0dcf36c769c8a5940d6a0c0b6b6a6647c.tar.bz2
Fix deadlock when plugin puts an alert and right afterwards the browser process makes a win32 call that ends up waiting on the plugin. Since the plugin thread is blocked, the Windows message doesn't get dispatched and the browser ui thread deadlocks. The message from the renderer would make the plugin run a nested message loop but it doesn't get run on the browser ui thread since it's blocked. The fix is to set the event that runs nested message loop in the renderer process.
BUG=23147 TEST=ui tests already cover nested message loops and plugins. This particular scenario is hard to write a test case for because it's a race condition involving the browser. Review URL: http://codereview.chromium.org/243018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.h')
-rw-r--r--chrome/renderer/render_view.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index aeb4562..fd8c981 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -114,17 +114,14 @@ class RenderView : public RenderWidget,
};
// Creates a new RenderView. The parent_hwnd specifies a HWND to use as the
- // parent of the WebView HWND that will be created. The modal_dialog_event
- // is set by the RenderView whenever a modal dialog alert is shown, so that
- // the renderer and plugin processes know to pump window messages. If this
- // is a constrained popup or as a new tab, opener_id is the routing ID of the
- // RenderView responsible for creating this RenderView (corresponding to the
- // parent_hwnd). |counter| is either a currently initialized counter, or NULL
- // (in which case we treat this RenderView as a top level window).
+ // parent of the WebView HWND that will be created. If this is a constrained
+ // popup or as a new tab, opener_id is the routing ID of the RenderView
+ // responsible for creating this RenderView (corresponding to parent_hwnd).
+ // |counter| is either a currently initialized counter, or NULL (in which case
+ // we treat this RenderView as a top level window).
static RenderView* Create(
RenderThreadBase* render_thread,
gfx::NativeViewId parent_hwnd,
- base::WaitableEvent* modal_dialog_event, // takes ownership
int32 opener_id,
const RendererPreferences& renderer_prefs,
const WebPreferences& webkit_prefs,
@@ -430,6 +427,9 @@ class RenderView : public RenderWidget,
return webkit_preferences_;
}
+ // Sends a message and runs a nested message loop.
+ bool SendAndRunNestedMessageLoop(IPC::SyncMessage* message);
+
protected:
// RenderWidget override.
virtual void OnResize(const gfx::Size& new_size,
@@ -460,7 +460,6 @@ class RenderView : public RenderWidget,
// set to 'MSG_ROUTING_NONE' if the true ID is not yet known. In this case,
// CompleteInit must be called later with the true ID.
void Init(gfx::NativeViewId parent,
- base::WaitableEvent* modal_dialog_event, // takes ownership
int32 opener_id,
const RendererPreferences& renderer_prefs,
SharedRenderViewCounter* counter,
@@ -825,6 +824,10 @@ class RenderView : public RenderWidget,
// check this to know if they should pump messages/tasks then.
scoped_ptr<base::WaitableEvent> modal_dialog_event_;
+ // Multiple dialog boxes can be shown before the first one is finished,
+ // so we keep a counter to know when we can reset the modal dialog event.
+ int modal_dialog_count_;
+
// Provides access to this renderer from the remote Inspector UI.
scoped_ptr<DevToolsAgent> devtools_agent_;