diff options
Diffstat (limited to 'net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch')
-rw-r--r-- | net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch b/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch new file mode 100644 index 000000000000..78f5eeb5a437 --- /dev/null +++ b/net-www/mozilla/files/1.3/mozilla-1.3-provider-shutdown.patch @@ -0,0 +1,123 @@ +Index: embedding/browser/gtk/src/EmbedPrivate.cpp +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedPrivate.cpp,v +retrieving revision 1.30 +diff -u -r1.30 EmbedPrivate.cpp +--- embedding/browser/gtk/src/EmbedPrivate.cpp 9 Nov 2002 19:38:31 -0000 1.30 ++++ embedding/browser/gtk/src/EmbedPrivate.cpp 11 Feb 2003 00:11:18 -0000 +@@ -78,6 +78,7 @@ + GtkWidget *EmbedPrivate::sOffscreenWindow = 0; + GtkWidget *EmbedPrivate::sOffscreenFixed = 0; + nsIDirectoryServiceProvider *EmbedPrivate::sAppFileLocProvider = nsnull; ++nsProfileDirServiceProvider *EmbedPrivate::sProfileDirServiceProvider = nsnull; + + EmbedPrivate::EmbedPrivate(void) + { +@@ -796,16 +797,14 @@ + NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(locProvider)); + if (!locProvider) + return NS_ERROR_FAILURE; +- +- // Directory service holds an strong reference to any +- // provider that is registered with it. Let it hold the +- // only ref. locProvider won't die when we leave this scope. + rv = locProvider->Register(); + if (NS_FAILED(rv)) + return rv; + rv = locProvider->SetProfileDir(profileDir); + if (NS_FAILED(rv)) + return rv; ++ // Keep a ref so we can shut it down. ++ NS_ADDREF(sProfileDirServiceProvider = locProvider); + + // get prefs + nsCOMPtr<nsIPref> pref; +@@ -822,6 +821,11 @@ + void + EmbedPrivate::ShutdownProfile(void) + { ++ if (sProfileDirServiceProvider) { ++ sProfileDirServiceProvider->Shutdown(); ++ NS_RELEASE(sProfileDirServiceProvider); ++ sProfileDirServiceProvider = 0; ++ } + if (sPrefs) { + NS_RELEASE(sPrefs); + sPrefs = 0; +Index: embedding/browser/gtk/src/EmbedPrivate.h +=================================================================== +RCS file: /cvsroot/mozilla/embedding/browser/gtk/src/EmbedPrivate.h,v +retrieving revision 1.16 +diff -u -r1.16 EmbedPrivate.h +--- embedding/browser/gtk/src/EmbedPrivate.h 29 Jan 2002 21:39:30 -0000 1.16 ++++ embedding/browser/gtk/src/EmbedPrivate.h 11 Feb 2003 00:11:18 -0000 +@@ -46,6 +46,7 @@ + + class nsPIDOMWindow; + class nsIDirectoryServiceProvider; ++class nsProfileDirServiceProvider; + + class EmbedPrivate { + +@@ -134,6 +135,7 @@ + static char *sProfileDir; + static char *sProfileName; + // for profiles ++ static nsProfileDirServiceProvider *sProfileDirServiceProvider; + static nsIPref *sPrefs; + + static nsIDirectoryServiceProvider * sAppFileLocProvider; +Index: profile/dirserviceprovider/public/nsProfileDirServiceProvider.h +=================================================================== +RCS file: /cvsroot/mozilla/profile/dirserviceprovider/public/nsProfileDirServiceProvider.h,v +retrieving revision 1.1 +diff -u -r1.1 nsProfileDirServiceProvider.h +--- profile/dirserviceprovider/public/nsProfileDirServiceProvider.h 9 Nov 2002 19:38:23 -0000 1.1 ++++ profile/dirserviceprovider/public/nsProfileDirServiceProvider.h 11 Feb 2003 00:11:54 -0000 +@@ -79,6 +79,16 @@ + + virtual nsresult Register(); + ++ /** ++ * Shutdown ++ * ++ * This method must be called before shutting down XPCOM if this object ++ * was created with aNotifyObservers == PR_TRUE. If this object was ++ * created with aNotifyObservers == PR_FALSE, this method is a no-op. ++ */ ++ ++ virtual nsresult Shutdown(); ++ + protected: + nsProfileDirServiceProvider(PRBool aNotifyObservers = PR_TRUE); + virtual ~nsProfileDirServiceProvider(); +Index: profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp +=================================================================== +RCS file: /cvsroot/mozilla/profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp,v +retrieving revision 1.3 +diff -u -r1.3 nsProfileDirServiceProvider.cpp +--- profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp 8 Jan 2003 22:41:35 -0000 1.3 ++++ profile/dirserviceprovider/src/nsProfileDirServiceProvider.cpp 11 Feb 2003 00:11:54 -0000 +@@ -155,6 +155,22 @@ + return directoryService->RegisterProvider(this); + } + ++nsresult ++nsProfileDirServiceProvider::Shutdown() ++{ ++ if (!mNotifyObservers) ++ return NS_OK; ++ ++ nsCOMPtr<nsIObserverService> observerService = ++ do_GetService("@mozilla.org/observer-service;1"); ++ if (!observerService) ++ return NS_ERROR_FAILURE; ++ ++ NS_NAMED_LITERAL_STRING(context, "shutdown-persist"); ++ observerService->NotifyObservers(nsnull, "profile-before-change", context.get()); ++ return NS_OK; ++} ++ + //***************************************************************************** + // nsProfileDirServiceProvider::nsISupports + //***************************************************************************** |