Bug 1489018 - Remove the XPCOM component registration for nsCollation; r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D5110
This commit is contained in:
Ehsan Akhgari 2018-09-06 01:31:54 -04:00
parent b9fb0fb155
commit e85d8f7ebd
4 changed files with 4 additions and 23 deletions

View File

@ -19,14 +19,12 @@ NS_DEFINE_NAMED_CID(MOZ_LOCALESERVICE_CID);
NS_DEFINE_NAMED_CID(MOZ_OSPREFERENCES_CID);
NS_DEFINE_NAMED_CID(NS_STRINGBUNDLESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_COLLATIONFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_COLLATION_CID);
static const mozilla::Module::CIDEntry kIntlCIDs[] = {
{ &kMOZ_LOCALESERVICE_CID, false, nullptr, mozilla::intl::LocaleServiceConstructor },
{ &kMOZ_OSPREFERENCES_CID, false, nullptr, mozilla::intl::OSPreferencesConstructor },
{ &kNS_STRINGBUNDLESERVICE_CID, false, nullptr, nsStringBundleServiceConstructor },
{ &kNS_COLLATIONFACTORY_CID, false, nullptr, nsCollationFactoryConstructor },
{ &kNS_COLLATION_CID, false, nullptr, nsCollationConstructor },
{ nullptr }
};
@ -35,7 +33,6 @@ static const mozilla::Module::ContractIDEntry kIntlContracts[] = {
{ MOZ_OSPREFERENCES_CONTRACTID, &kMOZ_OSPREFERENCES_CID },
{ NS_STRINGBUNDLE_CONTRACTID, &kNS_STRINGBUNDLESERVICE_CID },
{ NS_COLLATIONFACTORY_CONTRACTID, &kNS_COLLATIONFACTORY_CID },
{ NS_COLLATION_CONTRACTID, &kNS_COLLATION_CID },
{ nullptr }
};

View File

@ -9,13 +9,6 @@
#include "nscore.h"
#include "nsISupports.h"
// {AA13E4A0-A5AC-11d2-9119-006008A6EDF6}
#define NS_COLLATION_CID \
{ 0xaa13e4a0, 0xa5ac, 0x11d2, \
{ 0x91, 0x19, 0x0, 0x60, 0x8, 0xa6, 0xed, 0xf6 } }
#define NS_COLLATION_CONTRACTID "@mozilla.org/intl/collation;1"
// {A1B72850-A999-11d2-9119-006008A6EDF6}
#define NS_COLLATIONFACTORY_CID \
{ 0xa1b72850, 0xa999, 0x11d2, \

View File

@ -4,14 +4,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsCollationFactory.h"
#include "nsCollationCID.h"
#include "nsCollation.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/intl/LocaleService.h"
////////////////////////////////////////////////////////////////////////////////
NS_DEFINE_CID(kCollationCID, NS_COLLATION_CID);
NS_IMPL_ISUPPORTS(nsCollationFactory, nsICollationFactory)
nsresult nsCollationFactory::CreateCollation(nsICollation** instancePtr)
@ -27,17 +25,11 @@ nsCollationFactory::CreateCollationForLocale(const nsACString& locale, nsICollat
{
// Create a collation interface instance.
//
nsICollation *inst;
nsresult res;
res = CallCreateInstance(kCollationCID, &inst);
if (NS_FAILED(res)) {
return res;
}
nsCOMPtr<nsICollation> inst = new nsCollation();
inst->Initialize(locale);
*instancePtr = inst;
inst.forget(instancePtr);
return res;
return NS_OK;
}

View File

@ -30,7 +30,6 @@ ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollation)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCollationFactory)
namespace mozilla {