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

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: Added browser test + Fixed a silly initial loading bug :-) 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 905394d9e5328ca02d7c9b8c4e0d0f2a8f625cec..c0fee7b5c630469c0b5b11fd445166cc6fdb29c8 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -243,6 +243,35 @@ 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 gesture events work with a new renderer.
+ coalesced_gesture_events_.clear();
+ gesture_event_pending_ = false;
+
+ // 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());
@@ -1113,32 +1142,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 gesture events work with a new renderer.
- coalesced_gesture_events_.clear();
- gesture_event_pending_ = false;
-
- // 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