Bug 568691 - register chrome/*.manifest in addition to components/*.manifest files, chrome appears to work in xpcshell again.

This commit is contained in:
Benjamin Smedberg
2010-06-21 13:49:38 -04:00
parent 726d0cfc47
commit 7e70e07911
3 changed files with 46 additions and 21 deletions

View File

@@ -49,6 +49,8 @@
#include <gtk/gtk.h>
#endif
#include "mozilla/Services.h"
#include "nsTextFormatter.h"
#include "nsUnicharUtils.h"
#include "nsVersionComparator.h"
@@ -463,9 +465,19 @@ ParseManifest(NSLocationType aType, nsILocalFile* aFile, char* buf)
if (!ok || stApp == eBad || stAppVersion == eBad || stOs == eBad || stOsVersion == eBad)
continue;
if (directive->ischrome)
if (directive->ischrome) {
if (!nsChromeRegistry::gChromeRegistry) {
nsCOMPtr<nsIChromeRegistry> cr =
mozilla::services::GetChromeRegistryService();
if (!nsChromeRegistry::gChromeRegistry) {
LogMessageWithContext(aFile, line, "Chrome registry isn't available yet.");
continue;
}
}
(nsChromeRegistry::gChromeRegistry->*(directive->regfunc))
(chromecx, line, argv, platform, contentAccessible);
}
else
(nsComponentManagerImpl::gComponentManager->*(directive->mgrfunc))
(mgrcx, line, argv);