diff options
Diffstat (limited to 'chrome/browser/renderer_host')
5 files changed, 20 insertions, 20 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index aa1b78c..76b8d5a 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -92,7 +92,6 @@ RenderViewHost::RenderViewHost(SiteInstance* instance, : RenderWidgetHost(instance->GetProcess(), routing_id), instance_(instance), delegate_(delegate), - renderer_initialized_(false), waiting_for_drag_context_response_(false), debugger_attached_(false), enabled_bindings_(0), @@ -200,11 +199,6 @@ bool RenderViewHost::IsRenderViewLive() const { return process()->channel() && renderer_initialized_; } -void RenderViewHost::Init() { - RenderWidgetHost::Init(); - renderer_initialized_ = true; -} - void RenderViewHost::NavigateToEntry(const NavigationEntry& entry, bool is_reload) { ViewMsg_Navigate_Params params; @@ -866,13 +860,9 @@ void RenderViewHost::OnMsgRenderViewReady() { } void RenderViewHost::OnMsgRenderViewGone() { - // Our base class RenderWidgetHouse needs to reset some stuff. + // Our base class RenderWidgetHost needs to reset some stuff. RendererExited(); - // Clearing this flag causes us to re-create the renderer when recovering - // from a crashed renderer. - renderer_initialized_ = false; - delegate_->RenderViewGone(this); OnDebugDisconnect(); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index e6e7ad11..976a434 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -424,7 +424,6 @@ class RenderViewHost : public RenderWidgetHost { void WindowMoveOrResizeStarted(); // RenderWidgetHost public overrides. - virtual void Init(); virtual void Shutdown(); virtual bool IsRenderView() { return true; } virtual void OnMessageReceived(const IPC::Message& msg); @@ -592,11 +591,6 @@ class RenderViewHost : public RenderWidgetHost { HostPersonalization personalization_; #endif - // true if a renderer has once been valid. We use this flag to display a sad - // tab only when we lose our renderer and not if a paint occurs during - // initialization. - bool renderer_initialized_; - // true if we are currently waiting for a response for drag context // information. bool waiting_for_drag_context_response_; 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(); diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index b6fd4d0..ad81ad8 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -142,7 +142,7 @@ class RenderWidgetHost : public IPC::Channel::Listener { // Called when a renderer object already been created for this host, and we // just need to be attached to it. Used for window.open, <select> dropdown // menus, and other times when the renderer initiates creating an object. - virtual void Init(); + void Init(); // Tells the renderer to die and then calls Destroy(). virtual void Shutdown(); @@ -282,6 +282,12 @@ class RenderWidgetHost : public IPC::Channel::Listener { virtual void NotifyRendererUnresponsive() {} virtual void NotifyRendererResponsive() {} + protected: + // true if a renderer has once been valid. We use this flag to display a sad + // tab only when we lose our renderer and not if a paint occurs during + // initialization. + bool renderer_initialized_; + private: FRIEND_TEST(RenderWidgetHostTest, Resize); FRIEND_TEST(RenderWidgetHostTest, HiddenPaint); diff --git a/chrome/browser/renderer_host/render_widget_host_unittest.cc b/chrome/browser/renderer_host/render_widget_host_unittest.cc index 7ebb8e8..0711e3d 100644 --- a/chrome/browser/renderer_host/render_widget_host_unittest.cc +++ b/chrome/browser/renderer_host/render_widget_host_unittest.cc @@ -161,6 +161,7 @@ class RenderWidgetHostTest : public testing::Test { host_.reset(new MockRenderWidgetHost(process_, 1)); view_.reset(new TestView); host_->set_view(view_.get()); + host_->Init(); } void TearDown() { view_.reset(); |