Fixing bug 384796, Call to |nsIStringBundleOverride| always beats the embedding calls. r=mento, sr=roc, 1.9approval=dsicore. Trunk only.

This commit is contained in:
nick.kreeger%park.edu 2007-08-28 19:48:47 +00:00
Родитель ece9a7639e
Коммит 475863749b
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -584,6 +584,7 @@ nsStringBundleService::Init()
os->AddObserver(this, "memory-pressure", PR_TRUE);
os->AddObserver(this, "profile-do-change", PR_TRUE);
os->AddObserver(this, "chrome-flush-caches", PR_TRUE);
os->AddObserver(this, "xpcom-category-entry-added", PR_TRUE);
}
// instantiate the override service, if there is any.
@ -602,7 +603,15 @@ nsStringBundleService::Observe(nsISupports* aSubject,
if (strcmp("memory-pressure", aTopic) == 0 ||
strcmp("profile-do-change", aTopic) == 0 ||
strcmp("chrome-flush-caches", aTopic) == 0)
{
flushBundleCache();
}
else if (strcmp("xpcom-category-entry-added", aTopic) == 0 &&
NS_LITERAL_STRING("xpcom-autoregistration").Equals(aSomeData))
{
mOverrideStrings = do_GetService(NS_STRINGBUNDLETEXTOVERRIDE_CONTRACTID);
}
return NS_OK;
}