From 84bf540501c18c8bfde6966982e361cbebff713d Mon Sep 17 00:00:00 2001 From: "bent.mozilla%gmail.com" Date: Thu, 26 Apr 2007 13:53:48 +0000 Subject: [PATCH] Bug 377995 - "Move nsCategoryCache to the XPCOM Glue". nsCategoryCache was initially created as part of Bug 315598 by Christian Biesinger . r=bsmedberg. git-svn-id: svn://10.0.0.236/trunk@225089 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/components/Makefile.in | 2 -- mozilla/xpcom/ds/nsObserverService.h | 1 - mozilla/xpcom/glue/Makefile.in | 1 + mozilla/xpcom/{components => glue}/nsCategoryCache.cpp | 8 ++++---- mozilla/xpcom/{components => glue}/nsCategoryCache.h | 2 +- mozilla/xpcom/glue/objs.mk | 1 + 6 files changed, 7 insertions(+), 8 deletions(-) rename mozilla/xpcom/{components => glue}/nsCategoryCache.cpp (96%) rename mozilla/xpcom/{components => glue}/nsCategoryCache.h (98%) diff --git a/mozilla/xpcom/components/Makefile.in b/mozilla/xpcom/components/Makefile.in index 2e1fb7bb4f2..3bcc7b20038 100644 --- a/mozilla/xpcom/components/Makefile.in +++ b/mozilla/xpcom/components/Makefile.in @@ -53,7 +53,6 @@ REQUIRES = string \ CPPSRCS = \ nsCategoryManager.cpp \ - nsCategoryCache.cpp \ nsComponentManager.cpp \ nsNativeComponentLoader.cpp \ nsStaticComponentLoader.cpp \ @@ -62,7 +61,6 @@ CPPSRCS = \ EXPORTS = \ nsCategoryManagerUtils.h \ - nsCategoryCache.h \ nsIServiceManagerObsolete.h \ nsModule.h \ nsObsoleteModuleLoading.h \ diff --git a/mozilla/xpcom/ds/nsObserverService.h b/mozilla/xpcom/ds/nsObserverService.h index 1f30b79c14a..0727c2244a0 100644 --- a/mozilla/xpcom/ds/nsObserverService.h +++ b/mozilla/xpcom/ds/nsObserverService.h @@ -42,7 +42,6 @@ #include "nsObserverList.h" #include "nsTHashtable.h" -#define NS_OBSERVERSERVICE_CONTRACTID "@mozilla.org/observer-service;1" #define NS_OBSERVERSERVICE_CLASSNAME "Observer Service" // {D07F5195-E3D1-11d2-8ACD-00105A1B8860} diff --git a/mozilla/xpcom/glue/Makefile.in b/mozilla/xpcom/glue/Makefile.in index b0883d54d9a..9e1756d1824 100644 --- a/mozilla/xpcom/glue/Makefile.in +++ b/mozilla/xpcom/glue/Makefile.in @@ -74,6 +74,7 @@ SDK_HEADERS = \ nsArrayUtils.h \ nsAutoLock.h \ nsBaseHashtable.h \ + nsCategoryCache.h \ nsCOMArray.h \ nsCRTGlue.h \ nsClassHashtable.h \ diff --git a/mozilla/xpcom/components/nsCategoryCache.cpp b/mozilla/xpcom/glue/nsCategoryCache.cpp similarity index 96% rename from mozilla/xpcom/components/nsCategoryCache.cpp rename to mozilla/xpcom/glue/nsCategoryCache.cpp index 45f0544c402..1ce55aefa65 100644 --- a/mozilla/xpcom/components/nsCategoryCache.cpp +++ b/mozilla/xpcom/glue/nsCategoryCache.cpp @@ -39,7 +39,6 @@ #include "nsISupportsPrimitives.h" #include "nsXPCOMCID.h" -#include "nsObserverService.h" #include "nsCategoryCache.h" @@ -74,7 +73,7 @@ nsCategoryObserver::nsCategoryObserver(const char* aCategory, nsCAutoString categoryEntry; rv = entryName->GetData(categoryEntry); - nsXPIDLCString entryValue; + nsCString entryValue; catMan->GetCategoryEntry(aCategory, categoryEntry.get(), getter_Copies(entryValue)); @@ -132,7 +131,8 @@ nsCategoryObserver::Observe(nsISupports* aSubject, const char* aTopic, return NS_OK; } - if (!aData || !nsDependentString(aData).EqualsASCII(mCategory.get())) + if (!aData || + !nsDependentString(aData).Equals(NS_ConvertASCIItoUTF16(mCategory))) return NS_OK; nsCAutoString str; @@ -146,7 +146,7 @@ nsCategoryObserver::Observe(nsISupports* aSubject, const char* aTopic, if (!catMan) return NS_OK; - nsXPIDLCString entryValue; + nsCString entryValue; catMan->GetCategoryEntry(mCategory.get(), str.get(), getter_Copies(entryValue)); diff --git a/mozilla/xpcom/components/nsCategoryCache.h b/mozilla/xpcom/glue/nsCategoryCache.h similarity index 98% rename from mozilla/xpcom/components/nsCategoryCache.h rename to mozilla/xpcom/glue/nsCategoryCache.h index c7bfdaaa346..d72e99b4e43 100644 --- a/mozilla/xpcom/components/nsCategoryCache.h +++ b/mozilla/xpcom/glue/nsCategoryCache.h @@ -62,7 +62,7 @@ class NS_NO_VTABLE nsCategoryListener { virtual void CategoryCleared() = 0; }; -class NS_COM nsCategoryObserver : public nsIObserver { +class NS_COM_GLUE nsCategoryObserver : public nsIObserver { public: nsCategoryObserver(const char* aCategory, nsCategoryListener* aCategoryListener); diff --git a/mozilla/xpcom/glue/objs.mk b/mozilla/xpcom/glue/objs.mk index b8bc5da43be..ed6d865ed49 100644 --- a/mozilla/xpcom/glue/objs.mk +++ b/mozilla/xpcom/glue/objs.mk @@ -43,6 +43,7 @@ XPCOM_GLUE_SRC_CSRCS = $(addprefix $(topsrcdir)/xpcom/glue/, $(XPCOM_GLUE_SRC_LC XPCOM_GLUE_SRC_LCPPSRCS = \ nsArrayEnumerator.cpp \ nsArrayUtils.cpp \ + nsCategoryCache.cpp \ nsCOMPtr.cpp \ nsCOMArray.cpp \ nsCRTGlue.cpp \