diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:37:48 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:37:48 +0000 |
commit | d1e3919f516564922e569a886fd7a3b52254ac67 (patch) | |
tree | 675d9d368a00fe1ff780a8a46de1cde43b6d440c /chrome/browser/extensions | |
parent | 0e630ddf7997443e4aa9160ef243a2ab7328abcf (diff) | |
download | chromium_src-d1e3919f516564922e569a886fd7a3b52254ac67.zip chromium_src-d1e3919f516564922e569a886fd7a3b52254ac67.tar.gz chromium_src-d1e3919f516564922e569a886fd7a3b52254ac67.tar.bz2 |
Fixing a crash in RenderViewGone.
If I start Chrome and shut it down quickly RenderViewHost
receives an IPC ViewHostMsg_RenderViewGone. We respond in
ExtensionHost::RenderViewGone by putting up an info bar on
the selected tab contents saying that an extension
crashed.
Only problem is that ExtensionHost::GetBrowser() can
return NULL during startup and shutdown, as documented
in the function and so we should not try to put up the
Infobar if the browser is going away.
BUG=None
TEST=Open Chrome with extensions enabled and an extension
loaded and shut Chrome down as soon as it launches. It
should not crash. Might take a few trys to repro.
Review URL: http://codereview.chromium.org/149205
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 2169a80..f54cf5f 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -154,10 +154,13 @@ void ExtensionHost::UpdatePreferredWidth(int pref_width) { void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host) { DCHECK_EQ(render_view_host_, render_view_host); - TabContents* current_tab = GetBrowser()->GetSelectedTabContents(); - if (current_tab) { - current_tab->AddInfoBar( - new CrashedExtensionInfobarDelegate(current_tab, this)); + Browser* browser = GetBrowser(); + if (browser) { + TabContents* current_tab = browser->GetSelectedTabContents(); + if (current_tab) { + current_tab->AddInfoBar( + new CrashedExtensionInfobarDelegate(current_tab, this)); + } } NotificationService::current()->Notify( NotificationType::EXTENSION_PROCESS_CRASHED, |