summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_widget_host.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 23:53:25 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 23:53:25 +0000
commit88b795b46f0236976a6699f7af7dc1da1605b291 (patch)
tree6775521c0e71e4570a090b3c7b7e68d4f22b42ef /chrome/browser/renderer_host/render_widget_host.cc
parente5d8b05f5f57390eab6bea89a35c5dc011df113a (diff)
downloadchromium_src-88b795b46f0236976a6699f7af7dc1da1605b291.zip
chromium_src-88b795b46f0236976a6699f7af7dc1da1605b291.tar.gz
chromium_src-88b795b46f0236976a6699f7af7dc1da1605b291.tar.bz2
Don't send resize messages until the renderer has been initialized.
[Retry of 14260 with fixed unit test.] 1) Moves renderer_initialized_ from RenderWidgetView into RenderWidgetHost (its parent). Should be identical semantics to before. 2) Test renderer_initialized_ in RWH::WasResized(). This also reverts r13725, which was another attempt at fixing this problem. BUG=9830,10659 TEST=From the Linux start page, click a link then click back -- should not get a gray page. From Google reader, click a link (which spawns a new tab within the same process) -- should not get a gray page. Review URL: http://codereview.chromium.org/93038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_host.cc')
-rw-r--r--chrome/browser/renderer_host/render_widget_host.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc
index dd14812..64fb609 100644
--- a/chrome/browser/renderer_host/render_widget_host.cc
+++ b/chrome/browser/renderer_host/render_widget_host.cc
@@ -47,7 +47,8 @@ static const int kHungRendererDelayMs = 20000;
RenderWidgetHost::RenderWidgetHost(RenderProcessHost* process,
int routing_id)
- : view_(NULL),
+ : renderer_initialized_(false),
+ view_(NULL),
process_(process),
routing_id_(routing_id),
is_loading_(false),
@@ -81,6 +82,8 @@ RenderWidgetHost::~RenderWidgetHost() {
void RenderWidgetHost::Init() {
DCHECK(process_->channel());
+ renderer_initialized_ = true;
+
// Send the ack along with the information on placement.
gfx::NativeView plugin_view = view_->GetPluginNativeView();
Send(new ViewMsg_CreatingNew_ACK(routing_id_,
@@ -159,8 +162,10 @@ void RenderWidgetHost::WasRestored() {
}
void RenderWidgetHost::WasResized() {
- if (resize_ack_pending_ || !process_->channel() || !view_)
+ if (resize_ack_pending_ || !process_->channel() || !view_ ||
+ !renderer_initialized_) {
return;
+ }
gfx::Rect view_bounds = view_->GetViewBounds();
gfx::Size new_size(view_bounds.width(), view_bounds.height());
@@ -347,6 +352,10 @@ void RenderWidgetHost::ForwardInputEvent(const WebInputEvent& input_event,
}
void RenderWidgetHost::RendererExited() {
+ // Clearing this flag causes us to re-create the renderer when recovering
+ // from a crashed renderer.
+ renderer_initialized_ = false;
+
// Must reset these to ensure that mouse move events work with a new renderer.
mouse_move_pending_ = false;
next_mouse_move_.reset();