Bug 1489690, part 1 - Remove the registration for the sort service r=bzbarsky

This is only used in a single place, so having a service for it is overkill.

Differential Revision: https://phabricator.services.mozilla.com/D5591

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew McCreight 2018-09-13 18:37:44 +00:00
Родитель 84ee6e9599
Коммит 4a93f15458
6 изменённых файлов: 22 добавлений и 45 удалений

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

@ -113,11 +113,6 @@
#define NS_XULCONTROLLERS_CID \
{ 0x1f5c1721, 0x7dc3, 0x11d3, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
// {BFD05264-834C-11d2-8EAC-00805F29F371}
#define NS_XULSORTSERVICE_CID \
{ 0xbfd05264, 0x834c, 0x11d2, { 0x8e, 0xac, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x71 } }
// {3D262D00-8B5A-11d2-8EB0-00805F29F370}
#define NS_XULTEMPLATEBUILDER_CID \
{ 0x3d262d00, 0x8b5a, 0x11d2, { 0x8e, 0xb0, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }

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

@ -18,6 +18,7 @@ if CONFIG['MOZ_XUL']:
EXPORTS += [
'nsXULCommandDispatcher.h',
'nsXULElement.h',
'nsXULSortService.h',
]
EXPORTS.mozilla.dom += [

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

@ -353,11 +353,3 @@ XULSortServiceImpl::Sort(Element* aNode,
return rv;
}
nsresult
NS_NewXULSortService(nsIXULSortService** sortService)
{
*sortService = new XULSortServiceImpl();
NS_ADDREF(*sortService);
return NS_OK;
}

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

@ -67,14 +67,12 @@ struct contentSortInfo {
//
class XULSortServiceImpl : public nsIXULSortService
{
protected:
public:
XULSortServiceImpl(void) {}
protected:
virtual ~XULSortServiceImpl(void) {}
friend nsresult NS_NewXULSortService(nsIXULSortService** mgr);
private:
public:
// nsISupports
NS_DECL_ISUPPORTS

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

@ -116,7 +116,6 @@ class nsIDocumentLoaderFactory;
#ifdef MOZ_XUL
#include "XULDocument.h"
#include "nsIXULSortService.h"
#endif
static void Shutdown();
@ -341,7 +340,6 @@ MAKE_CTOR(CreateXHTMLContentSerializer, nsIContentSerializer, NS_NewXHT
MAKE_CTOR(CreatePlainTextSerializer, nsIContentSerializer, NS_NewPlainTextSerializer)
MAKE_CTOR(CreateContentPolicy, nsIContentPolicy, NS_NewContentPolicy)
#ifdef MOZ_XUL
MAKE_CTOR(CreateXULSortService, nsIXULSortService, NS_NewXULSortService)
MAKE_CTOR(CreateXULDocument, nsIDocument, NS_NewXULDocument)
// NS_NewXULControllers
#endif
@ -467,7 +465,6 @@ NS_DEFINE_NAMED_CID(NS_DATADOCUMENTCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_NODATAPROTOCOLCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_XULCONTROLLERS_CID);
#ifdef MOZ_XUL
NS_DEFINE_NAMED_CID(NS_XULSORTSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_XULDOCUMENT_CID);
#endif
NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
@ -562,7 +559,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_NODATAPROTOCOLCONTENTPOLICY_CID, false, nullptr, nsNoDataProtocolContentPolicyConstructor },
{ &kNS_XULCONTROLLERS_CID, false, nullptr, NS_NewXULControllers },
#ifdef MOZ_XUL
{ &kNS_XULSORTSERVICE_CID, false, nullptr, CreateXULSortService },
{ &kNS_XULDOCUMENT_CID, false, nullptr, CreateXULDocument },
#endif
{ &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, nullptr, CreateContentDLF },
@ -654,9 +650,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, &kNS_DATADOCUMENTCONTENTPOLICY_CID },
{ NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, &kNS_NODATAPROTOCOLCONTENTPOLICY_CID },
{ "@mozilla.org/xul/xul-controllers;1", &kNS_XULCONTROLLERS_CID },
#ifdef MOZ_XUL
{ "@mozilla.org/xul/xul-sort-service;1", &kNS_XULSORTSERVICE_CID },
#endif
{ CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
{ NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
{ PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },

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

@ -11,7 +11,7 @@
#include "nsTreeContentView.h"
#include "ChildIterator.h"
#include "nsError.h"
#include "nsIXULSortService.h"
#include "nsXULSortService.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
#include "mozilla/ErrorResult.h"
@ -660,26 +660,24 @@ nsTreeContentView::CycleHeader(nsTreeColumn& aColumn, ErrorResult& aError)
nsAutoString sort;
column->GetAttr(kNameSpaceID_None, nsGkAtoms::sort, sort);
if (!sort.IsEmpty()) {
nsCOMPtr<nsIXULSortService> xs = do_GetService("@mozilla.org/xul/xul-sort-service;1");
if (xs) {
nsAutoString sortdirection;
static Element::AttrValuesArray strings[] =
{&nsGkAtoms::ascending, &nsGkAtoms::descending, nullptr};
switch (column->FindAttrValueIn(kNameSpaceID_None,
nsGkAtoms::sortDirection,
strings, eCaseMatters)) {
case 0: sortdirection.AssignLiteral("descending"); break;
case 1: sortdirection.AssignLiteral("natural"); break;
default: sortdirection.AssignLiteral("ascending"); break;
}
nsAutoString hints;
column->GetAttr(kNameSpaceID_None, nsGkAtoms::sorthints, hints);
sortdirection.Append(' ');
sortdirection += hints;
xs->Sort(mRoot, sort, sortdirection);
nsCOMPtr<nsIXULSortService> xs = new XULSortServiceImpl();
nsAutoString sortdirection;
static Element::AttrValuesArray strings[] =
{&nsGkAtoms::ascending, &nsGkAtoms::descending, nullptr};
switch (column->FindAttrValueIn(kNameSpaceID_None,
nsGkAtoms::sortDirection,
strings, eCaseMatters)) {
case 0: sortdirection.AssignLiteral("descending"); break;
case 1: sortdirection.AssignLiteral("natural"); break;
default: sortdirection.AssignLiteral("ascending"); break;
}
nsAutoString hints;
column->GetAttr(kNameSpaceID_None, nsGkAtoms::sorthints, hints);
sortdirection.Append(' ');
sortdirection += hints;
xs->Sort(mRoot, sort, sortdirection);
}
}