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

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: . 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..3e636154e2fedb3bf7bac4c886fc1ea41fbb6e5c 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
@@ -2057,4 +2056,8 @@ void RenderWidgetHostImpl::DelayedAutoResized() {
OnRenderAutoResized(new_size);
}
+void RenderWidgetHostImpl::DetachDelegate() {
+ delegate_ = NULL;
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698