Bug 526545 - Crash reporter still can send wrong URL when crashing during pageload (r=bsmedberg)

This commit is contained in:
Dietrich Ayala 2009-11-16 16:51:07 -08:00
Родитель 1e89c6f628
Коммит 1b377e975a
2 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -48,6 +48,7 @@
# Paul OShannessy <paul@oshannessy.com>
# Nils Maier <maierman@web.de>
# Rob Arnold <robarnold@cmu.edu>
# Dietrich Ayala <dietrich@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -152,6 +153,12 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
return null;
});
#ifdef MOZ_CRASHREPORTER
XPCOMUtils.defineLazyServiceGetter(this, "gCrashReporter",
"@mozilla.org/xre/app-info;1",
"nsICrashReporter");
#endif
/**
* We can avoid adding multiple load event listeners and save some time by adding
* one listener that calls all real handlers.
@ -4318,6 +4325,12 @@ var TabsProgressListener = {
},
onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
if (!aRequest.URI)
aRequest.QueryInterface(Ci.nsIChannel);
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START &&
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_DOCUMENT) {
gCrashReporter.annotateCrashReport("URL", aRequest.URI.spec);
}
},
onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI) {

Просмотреть файл

@ -195,6 +195,7 @@ nsPluginArray::SetDocShell(nsIDocShell* aDocShell)
NS_IMETHODIMP
nsPluginArray::Refresh(PRBool aReloadDocuments)
{
PRTime then = PR_Now();
nsresult res = NS_OK;
if (!AllowPlugins())
return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA;
@ -203,21 +204,29 @@ nsPluginArray::Refresh(PRBool aReloadDocuments)
mPluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res);
}
printf("1XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
if(NS_FAILED(res)) {
return res;
}
printf("2XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
// NS_ERROR_PLUGINS_PLUGINSNOTCHANGED on reloading plugins indicates
// that plugins did not change and was not reloaded
PRBool pluginsNotChanged = PR_FALSE;
if(mPluginHost)
pluginsNotChanged = (NS_ERROR_PLUGINS_PLUGINSNOTCHANGED == mPluginHost->ReloadPlugins(aReloadDocuments));
printf("3XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
// no need to reload the page if plugins have not been changed
// in fact, if we do reload we can hit recursive load problem, see bug 93351
if(pluginsNotChanged)
return res;
printf("4XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mDocShell);
if (mPluginArray != nsnull) {
@ -230,12 +239,15 @@ nsPluginArray::Refresh(PRBool aReloadDocuments)
mPluginCount = 0;
mPluginArray = nsnull;
printf("5XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
if (mNavigator)
mNavigator->RefreshMIMEArray();
if (aReloadDocuments && webNav)
webNav->Reload(nsIWebNavigation::LOAD_FLAGS_NONE);
printf("6XXXXX %lld\n\n\n", (PR_Now() - then)/1000);
return res;
}