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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 564153003: Browser Plugin: Don't crash browser when reloading crashed webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update BrowserPluginGuest state even if NULL Created 6 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
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/shim/main.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 569c9deb00e379b37ee29622aeca7049ee56eb7e..847eff8c2c661d9d5ad3f9d988a4f9d664f08cdb 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -109,13 +109,16 @@ base::WeakPtr<BrowserPluginGuest> BrowserPluginGuest::AsWeakPtr() {
void BrowserPluginGuest::SetFocus(RenderWidgetHost* rwh, bool focused) {
focused_ = focused;
+ if (!rwh)
+ return;
+
rwh->Send(new InputMsg_SetFocus(rwh->GetRoutingID(), focused));
if (!focused && mouse_locked_)
OnUnlockMouse();
// Restore the last seen state of text input to the view.
RenderWidgetHostViewBase* rwhv = static_cast<RenderWidgetHostViewBase*>(
- web_contents()->GetRenderWidgetHostView());
+ rwh->GetView());
if (rwhv) {
ViewHostMsg_TextInputState_Params params;
params.type = last_text_input_type_;
@@ -718,9 +721,8 @@ void BrowserPluginGuest::OnResizeGuest(
void BrowserPluginGuest::OnSetFocus(int browser_plugin_instance_id,
bool focused) {
-
- RenderWidgetHost* rwh = web_contents()->GetRenderWidgetHostView()->
- GetRenderWidgetHost();
+ RenderWidgetHostView* rwhv = web_contents()->GetRenderWidgetHostView();
+ RenderWidgetHost* rwh = rwhv ? rwhv->GetRenderWidgetHost() : NULL;
lazyboy 2014/09/12 20:56:36 Could this be causing Shim_TestEventName failures?
Fady Samuel 2014/09/12 20:59:52 Possibly but I'm not sure.
SetFocus(rwh, focused);
}
« no previous file with comments | « chrome/test/data/extensions/platform_apps/web_view/shim/main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698