Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10560022: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Address some of creis@'s comments. Handing off to Istiaque as I head for vacation. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 3d44fc4bfa42b90b42563c67cd31ede38d71f9e5..8d96dcfd18cf468ddaab38e5a588221eae8c7fd4 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -235,6 +235,38 @@ void RenderWidgetHostImpl::CompositingSurfaceUpdated() {
process_->SurfaceUpdated(surface_id_);
}
+void RenderWidgetHostImpl::ResetFlags() {
+ // Must reset these to ensure that mouse move/wheel events work with a new
+ // renderer.
+ mouse_move_pending_ = false;
+ next_mouse_move_.reset();
+ mouse_wheel_pending_ = false;
+ coalesced_mouse_wheel_events_.clear();
+
+ // Must reset these to ensure that SelectRange works with a new renderer.
+ select_range_pending_ = false;
+ next_selection_range_.reset();
+
+ // Must reset these to ensure that gesture events work with a new renderer.
+ gesture_event_filter_->Reset();
+
+ // Must reset these to ensure that keyboard events work with a new renderer.
+ key_queue_.clear();
+ suppress_next_char_events_ = false;
+
+ // Reset some fields in preparation for recovering from a crash.
+ resize_ack_pending_ = false;
+ repaint_ack_pending_ = false;
+
+ in_flight_size_.SetSize(0, 0);
+ current_size_.SetSize(0, 0);
+ is_hidden_ = false;
+ is_accelerated_compositing_active_ = false;
+
+ // Reset this to ensure the hung renderer mechanism is working properly.
+ in_flight_event_count_ = 0;
+}
+
void RenderWidgetHostImpl::Init() {
DCHECK(process_->HasConnection());
@@ -1078,35 +1110,7 @@ void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status,
// from a crashed renderer.
renderer_initialized_ = false;
- // Must reset these to ensure that mouse move/wheel events work with a new
- // renderer.
- mouse_move_pending_ = false;
- next_mouse_move_.reset();
- mouse_wheel_pending_ = false;
- coalesced_mouse_wheel_events_.clear();
-
- // Must reset these to ensure that SelectRange works with a new renderer.
- select_range_pending_ = false;
- next_selection_range_.reset();
-
- // Must reset these to ensure that gesture events work with a new renderer.
- gesture_event_filter_->Reset();
-
- // Must reset these to ensure that keyboard events work with a new renderer.
- key_queue_.clear();
- suppress_next_char_events_ = false;
-
- // Reset some fields in preparation for recovering from a crash.
- resize_ack_pending_ = false;
- repaint_ack_pending_ = false;
-
- in_flight_size_.SetSize(0, 0);
- current_size_.SetSize(0, 0);
- is_hidden_ = false;
- is_accelerated_compositing_active_ = false;
-
- // Reset this to ensure the hung renderer mechanism is working properly.
- in_flight_event_count_ = 0;
+ ResetFlags();
if (view_) {
GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id_,

Powered by Google App Engine
This is Rietveld 408576698