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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 5172009: This adds some plumbing for propagating the reason for a renderer's death (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final review changes Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_host/render_widget_host.h" 5 #include "chrome/browser/renderer_host/render_widget_host.h"
6 6
7 #include "app/keyboard_codes.h" 7 #include "app/keyboard_codes.h"
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 // only handled by RenderView. 627 // only handled by RenderView.
628 } 628 }
629 629
630 #if defined(TOUCH_UI) 630 #if defined(TOUCH_UI)
631 void RenderWidgetHost::ForwardTouchEvent( 631 void RenderWidgetHost::ForwardTouchEvent(
632 const WebKit::WebTouchEvent& touch_event) { 632 const WebKit::WebTouchEvent& touch_event) {
633 ForwardInputEvent(touch_event, sizeof(WebKit::WebTouchEvent), false); 633 ForwardInputEvent(touch_event, sizeof(WebKit::WebTouchEvent), false);
634 } 634 }
635 #endif 635 #endif
636 636
637 void RenderWidgetHost::RendererExited() { 637 void RenderWidgetHost::RendererExited(base::TerminationStatus status,
638 int exit_code) {
638 // Clearing this flag causes us to re-create the renderer when recovering 639 // Clearing this flag causes us to re-create the renderer when recovering
639 // from a crashed renderer. 640 // from a crashed renderer.
640 renderer_initialized_ = false; 641 renderer_initialized_ = false;
641 642
642 // Must reset these to ensure that mouse move/wheel events work with a new 643 // Must reset these to ensure that mouse move/wheel events work with a new
643 // renderer. 644 // renderer.
644 mouse_move_pending_ = false; 645 mouse_move_pending_ = false;
645 next_mouse_move_.reset(); 646 next_mouse_move_.reset();
646 mouse_wheel_pending_ = false; 647 mouse_wheel_pending_ = false;
647 coalesced_mouse_wheel_events_.clear(); 648 coalesced_mouse_wheel_events_.clear();
648 649
649 // Must reset these to ensure that keyboard events work with a new renderer. 650 // Must reset these to ensure that keyboard events work with a new renderer.
650 key_queue_.clear(); 651 key_queue_.clear();
651 suppress_next_char_events_ = false; 652 suppress_next_char_events_ = false;
652 653
653 // Reset some fields in preparation for recovering from a crash. 654 // Reset some fields in preparation for recovering from a crash.
654 resize_ack_pending_ = false; 655 resize_ack_pending_ = false;
655 repaint_ack_pending_ = false; 656 repaint_ack_pending_ = false;
656 657
657 in_flight_size_.SetSize(0, 0); 658 in_flight_size_.SetSize(0, 0);
658 in_flight_reserved_rect_.SetRect(0, 0, 0, 0); 659 in_flight_reserved_rect_.SetRect(0, 0, 0, 0);
659 current_size_.SetSize(0, 0); 660 current_size_.SetSize(0, 0);
660 current_reserved_rect_.SetRect(0, 0, 0, 0); 661 current_reserved_rect_.SetRect(0, 0, 0, 0);
661 is_hidden_ = false; 662 is_hidden_ = false;
662 is_accelerated_compositing_active_ = false; 663 is_accelerated_compositing_active_ = false;
663 664
664 if (view_) { 665 if (view_) {
665 view_->RenderViewGone(); 666 view_->RenderViewGone(status, exit_code);
666 view_ = NULL; // The View should be deleted by RenderViewGone. 667 view_ = NULL; // The View should be deleted by RenderViewGone.
667 } 668 }
668 669
669 BackingStoreManager::RemoveBackingStore(this); 670 BackingStoreManager::RemoveBackingStore(this);
670 } 671 }
671 672
672 void RenderWidgetHost::UpdateTextDirection(WebTextDirection direction) { 673 void RenderWidgetHost::UpdateTextDirection(WebTextDirection direction) {
673 text_direction_updated_ = true; 674 text_direction_updated_ = true;
674 text_direction_ = direction; 675 text_direction_ = direction;
675 } 676 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (is_unresponsive_) { 762 if (is_unresponsive_) {
762 is_unresponsive_ = false; 763 is_unresponsive_ = false;
763 NotifyRendererResponsive(); 764 NotifyRendererResponsive();
764 } 765 }
765 } 766 }
766 767
767 void RenderWidgetHost::OnMsgRenderViewReady() { 768 void RenderWidgetHost::OnMsgRenderViewReady() {
768 WasResized(); 769 WasResized();
769 } 770 }
770 771
771 void RenderWidgetHost::OnMsgRenderViewGone() { 772 void RenderWidgetHost::OnMsgRenderViewGone(int status, int exit_code) {
772 // TODO(evanm): This synchronously ends up calling "delete this". 773 // TODO(evanm): This synchronously ends up calling "delete this".
773 // Is that really what we want in response to this message? I'm matching 774 // Is that really what we want in response to this message? I'm matching
774 // previous behavior of the code here. 775 // previous behavior of the code here.
775 Destroy(); 776 Destroy();
776 } 777 }
777 778
778 void RenderWidgetHost::OnMsgClose() { 779 void RenderWidgetHost::OnMsgClose() {
779 Shutdown(); 780 Shutdown();
780 } 781 }
781 782
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 return; 1232 return;
1232 1233
1233 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) { 1234 for (int i = 0; i < static_cast<int>(deferred_plugin_handles_.size()); i++) {
1234 #if defined(TOOLKIT_USES_GTK) 1235 #if defined(TOOLKIT_USES_GTK)
1235 view_->CreatePluginContainer(deferred_plugin_handles_[i]); 1236 view_->CreatePluginContainer(deferred_plugin_handles_[i]);
1236 #endif 1237 #endif
1237 } 1238 }
1238 1239
1239 deferred_plugin_handles_.clear(); 1240 deferred_plugin_handles_.clear();
1240 } 1241 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | chrome/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698