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

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

Issue 10968037: Fix the issue that any tab/window closing hotkey will crash the Pepper Flash Fullscreen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes in response to John's suggestion. Created 8 years, 3 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 d4e2e53fd5904e0d9a63ef0e59372f23a38b3b8a..0f45666a4f7e5b88979e949a42ead2f198a397a7 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -185,6 +185,9 @@ RenderWidgetHostImpl::~RenderWidgetHostImpl() {
surface_id_ = 0;
process_->Release(routing_id_);
+
+ if (delegate_)
+ delegate_->RenderWidgetDeleted(this);
}
// static
@@ -963,10 +966,6 @@ void RenderWidgetHostImpl::ForwardKeyboardEvent(
bool is_keyboard_shortcut = false;
// Only pre-handle the key event if it's not handled by the input method.
- // A delegate_ of NULL seems impossible but crash reports show that it
- // can happen (see http://crbug.com/134465). This doesn't seem to happen
- // with Chrome 22 and later, so checking the delegate_ here can be removed
- // once Chrome 22 goes to stable..
if (delegate_ && !key_event.skip_in_browser) {
// We need to set |suppress_next_char_events_| to true if
// PreHandleKeyboardEvent() returns true, but |this| may already be
@@ -1846,7 +1845,7 @@ void RenderWidgetHostImpl::ProcessKeyboardEventAck(int type, bool processed) {
// We only send unprocessed key event upwards if we are not hidden,
// because the user has moved away from us and no longer expect any effect
// of this key event.
- if (!processed && !is_hidden_ && !front_item.skip_in_browser) {
+ if (delegate_ && !processed && !is_hidden_ && !front_item.skip_in_browser) {
delegate_->HandleKeyboardEvent(front_item);
// WARNING: This RenderWidgetHostImpl can be deallocated at this point

Powered by Google App Engine
This is Rietveld 408576698