Bug 725015 - Always deliver category-change notifications asynchronously. This is required because extensions need the JavaScript-global-property category to work, but we always register contracts at the "end" of a chrome.manifest so that they will always be after the CIDs, but that means that they are after the categories are registered. r=bz
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 09 Feb 2012 10:41:16 -0500
changeset 86625 e550d86e3ee9cbf63a4bff2718a49830998972de
parent 86624 085725c8d753e20228d29f7bf27cadd6ae118b34
child 86626 24b776d91fdb3877142017c537d100ce1900e981
push id102
push userMs2ger@gmail.com
push dateFri, 10 Feb 2012 20:38:19 +0000
reviewersbz
bugs725015
milestone13.0a1
Bug 725015 - Always deliver category-change notifications asynchronously. This is required because extensions need the JavaScript-global-property category to work, but we always register contracts at the "end" of a chrome.manifest so that they will always be after the CIDs, but that means that they are after the categories are registered. r=bz
xpcom/components/nsCategoryManager.cpp
--- a/xpcom/components/nsCategoryManager.cpp
+++ b/xpcom/components/nsCategoryManager.cpp
@@ -551,22 +551,17 @@ nsCategoryManager::NotifyObservers( cons
     if (NS_FAILED(rv))
       return;
 
     r = new CategoryNotificationRunnable(entry, aTopic, aCategoryName);
   } else {
     r = new CategoryNotificationRunnable(this, aTopic, aCategoryName);
   }
 
-  if (NS_IsMainThread()) {
-    r->Run();
-  }
-  else {
-    NS_DispatchToMainThread(r);
-  }
+  NS_DispatchToMainThread(r);
 }
 
 NS_IMETHODIMP
 nsCategoryManager::GetCategoryEntry( const char *aCategoryName,
                                      const char *aEntryName,
                                      char **_retval )
 {
   NS_ENSURE_ARG_POINTER(aCategoryName);