Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit d986dfc

Browse files
committed
Bug 1309409 - Part 1: Remove nsISupportsArray usage from nsIRDFDataSource. r=Pike
This converts the usage of nsISupportsArray in nsIRDFDataSource to just nsISupports. Internally none of the params are used, all external usages in the addons repo appear to just be passthroughs. Regardless, any external implementors wanting to pass in an nsISupportsArray can still do so as it is derived from nsISupports. Additionally the |IsCommandEnabled| and |DoCommand| stubs are updated to just return NS_ERROR_NOT_IMPLEMENTED as this functionallity is currently not supported. MozReview-Commit-ID: JJSHAQKiLSZ
1 parent 6a07a42 commit d986dfc

8 files changed

Lines changed: 46 additions & 67 deletions

File tree

rdf/base/nsCompositeDataSource.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,9 @@ CompositeDataSourceImpl::GetAllCmds(nsIRDFResource* source,
10991099
}
11001100

11011101
NS_IMETHODIMP
1102-
CompositeDataSourceImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
1102+
CompositeDataSourceImpl::IsCommandEnabled(nsISupports/* nsIRDFResource container */* aSources,
11031103
nsIRDFResource* aCommand,
1104-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
1104+
nsISupports/* nsIRDFResource container */* aArguments,
11051105
bool* aResult)
11061106
{
11071107
nsresult rv;
@@ -1123,9 +1123,9 @@ CompositeDataSourceImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/*
11231123
}
11241124

11251125
NS_IMETHODIMP
1126-
CompositeDataSourceImpl::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
1126+
CompositeDataSourceImpl::DoCommand(nsISupports/* nsIRDFResource container */* aSources,
11271127
nsIRDFResource* aCommand,
1128-
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
1128+
nsISupports/* nsIRDFResource container */* aArguments)
11291129
{
11301130
for (int32_t i = mDataSources.Count() - 1; i >= 0; --i) {
11311131
nsresult rv = mDataSources[i]->DoCommand(aSources, aCommand, aArguments);

rdf/base/nsIRDFDataSource.idl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

66
#include "nsISupports.idl"
7-
#include "nsISupportsArray.idl"
87
#include "nsIRDFResource.idl"
98
#include "nsIRDFNode.idl"
109
#include "nsISimpleEnumerator.idl"
@@ -138,16 +137,16 @@ interface nsIRDFDataSource : nsISupports
138137
/**
139138
* Returns whether a given command is enabled for a set of sources.
140139
*/
141-
boolean IsCommandEnabled(in nsISupportsArray aSources,
140+
boolean IsCommandEnabled(in nsISupports aSources,
142141
in nsIRDFResource aCommand,
143-
in nsISupportsArray aArguments);
142+
in nsISupports aArguments);
144143

145144
/**
146145
* Perform the specified command on set of sources.
147146
*/
148-
void DoCommand(in nsISupportsArray aSources,
147+
void DoCommand(in nsISupports aSources,
149148
in nsIRDFResource aCommand,
150-
in nsISupportsArray aArguments);
149+
in nsISupports aArguments);
151150

152151
/**
153152
* Returns the set of all commands defined for a given source.

rdf/base/nsInMemoryDataSource.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,21 +1584,20 @@ InMemoryDataSource::GetAllCmds(nsIRDFResource* source,
15841584
}
15851585

15861586
NS_IMETHODIMP
1587-
InMemoryDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
1587+
InMemoryDataSource::IsCommandEnabled(nsISupports* aSources,
15881588
nsIRDFResource* aCommand,
1589-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
1589+
nsISupports* aArguments,
15901590
bool* aResult)
15911591
{
1592-
*aResult = false;
1593-
return NS_OK;
1592+
return NS_ERROR_NOT_IMPLEMENTED;
15941593
}
15951594

15961595
NS_IMETHODIMP
1597-
InMemoryDataSource::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
1596+
InMemoryDataSource::DoCommand(nsISupports* aSources,
15981597
nsIRDFResource* aCommand,
1599-
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
1598+
nsISupports* aArguments)
16001599
{
1601-
return NS_OK;
1600+
return NS_ERROR_NOT_IMPLEMENTED;
16021601
}
16031602

16041603
NS_IMETHODIMP
@@ -1883,7 +1882,7 @@ InMemoryDataSource::VisitAllSubjects(rdfITripleVisitor *aVisitor)
18831882
// Lock datasource against writes
18841883
++mReadCount;
18851884

1886-
// Enumerate all of our entries into an nsISupportsArray.
1885+
// Enumerate all of our entries.
18871886
nsresult rv = NS_OK;
18881887
for (auto iter = mForwardArcs.Iter(); !iter.Done(); iter.Next()) {
18891888
auto entry = static_cast<Entry*>(iter.Get());
@@ -1911,7 +1910,7 @@ InMemoryDataSource::VisitAllTriples(rdfITripleVisitor *aVisitor)
19111910
// Lock datasource against writes
19121911
++mReadCount;
19131912

1914-
// Enumerate all of our entries into an nsISupportsArray.
1913+
// Enumerate all of our entries.
19151914
nsresult rv = NS_OK;
19161915
for (auto iter = mForwardArcs.Iter(); !iter.Done(); iter.Next()) {
19171916
auto entry = static_cast<Entry*>(iter.Get());

rdf/base/nsRDFXMLDataSource.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,17 @@ class RDFXMLDataSourceImpl : public nsIRDFDataSource,
249249
return mInner->GetAllCmds(source, commands);
250250
}
251251

252-
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
252+
NS_IMETHOD IsCommandEnabled(nsISupports* aSources,
253253
nsIRDFResource* aCommand,
254-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
254+
nsISupports* aArguments,
255255
bool* aResult) override {
256-
return mInner->IsCommandEnabled(aSources, aCommand, aArguments, aResult);
256+
return NS_ERROR_NOT_IMPLEMENTED;
257257
}
258258

259-
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
259+
NS_IMETHOD DoCommand(nsISupports* aSources,
260260
nsIRDFResource* aCommand,
261-
nsISupportsArray/*<nsIRDFResource>*/* aArguments) override {
262-
// XXX Uh oh, this could cause problems wrt. the "dirty" flag
263-
// if it changes the in-memory store's internal state.
264-
return mInner->DoCommand(aSources, aCommand, aArguments);
261+
nsISupports* aArguments) override {
262+
return NS_ERROR_NOT_IMPLEMENTED;
265263
}
266264

267265
NS_IMETHOD BeginUpdateBatch() override {

rdf/datasource/nsFileSystemDataSource.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <stdio.h>
1414
#include "nsArrayEnumerator.h"
1515
#include "nsCOMArray.h"
16-
#include "nsISupportsArray.h"
1716
#include "nsIRDFDataSource.h"
1817
#include "nsIRDFObserver.h"
1918
#include "nsIServiceManager.h"
@@ -801,9 +800,9 @@ FileSystemDataSource::GetAllCmds(nsIRDFResource* source,
801800

802801

803802
NS_IMETHODIMP
804-
FileSystemDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
803+
FileSystemDataSource::IsCommandEnabled(nsISupports/*<nsIRDFResource>*/* aSources,
805804
nsIRDFResource* aCommand,
806-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
805+
nsISupports/*<nsIRDFResource>*/* aArguments,
807806
bool* aResult)
808807
{
809808
return(NS_ERROR_NOT_IMPLEMENTED);
@@ -812,9 +811,9 @@ FileSystemDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSo
812811

813812

814813
NS_IMETHODIMP
815-
FileSystemDataSource::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
814+
FileSystemDataSource::DoCommand(nsISupports/*<nsIRDFResource>*/* aSources,
816815
nsIRDFResource* aCommand,
817-
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
816+
nsISupports/*<nsIRDFResource>*/* aArguments)
818817
{
819818
return(NS_ERROR_NOT_IMPLEMENTED);
820819
}

rdf/datasource/nsLocalStore.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ class LocalStoreImpl : public nsILocalStore,
165165
NS_IMETHOD GetAllCmds(nsIRDFResource* aSource,
166166
nsISimpleEnumerator/*<nsIRDFResource>*/** aCommands) override;
167167

168-
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
168+
NS_IMETHOD IsCommandEnabled(nsISupports* aSources,
169169
nsIRDFResource* aCommand,
170-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
170+
nsISupports* aArguments,
171171
bool* aResult) override;
172172

173-
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
173+
NS_IMETHOD DoCommand(nsISupports* aSources,
174174
nsIRDFResource* aCommand,
175-
nsISupportsArray/*<nsIRDFResource>*/* aArguments) override;
175+
nsISupports* aArguments) override;
176176

177177
NS_IMETHOD BeginUpdateBatch() override {
178178
return mInner->BeginUpdateBatch();
@@ -441,22 +441,20 @@ LocalStoreImpl::GetAllCmds(nsIRDFResource* aSource,
441441
}
442442

443443
NS_IMETHODIMP
444-
LocalStoreImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
444+
LocalStoreImpl::IsCommandEnabled(nsISupports* aSources,
445445
nsIRDFResource* aCommand,
446-
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
446+
nsISupports* aArguments,
447447
bool* aResult)
448448
{
449-
*aResult = true;
450-
return NS_OK;
449+
return NS_ERROR_NOT_IMPLEMENTED;
451450
}
452451

453452
NS_IMETHODIMP
454-
LocalStoreImpl::DoCommand(nsISupportsArray* aSources,
453+
LocalStoreImpl::DoCommand(nsISupports* aSources,
455454
nsIRDFResource* aCommand,
456-
nsISupportsArray* aArguments)
455+
nsISupports* aArguments)
457456
{
458-
// no-op
459-
return NS_OK;
457+
return NS_ERROR_NOT_IMPLEMENTED;
460458
}
461459

462460
NS_IMETHODIMP

xpfe/components/directory/nsDirectoryViewer.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,27 +1188,17 @@ nsHTTPIndex::GetAllResources(nsISimpleEnumerator **_retval)
11881188
}
11891189

11901190
NS_IMETHODIMP
1191-
nsHTTPIndex::IsCommandEnabled(nsISupportsArray *aSources, nsIRDFResource *aCommand,
1192-
nsISupportsArray *aArguments, bool *_retval)
1191+
nsHTTPIndex::IsCommandEnabled(nsISupports *aSources, nsIRDFResource *aCommand,
1192+
nsISupports *aArguments, bool *_retval)
11931193
{
1194-
nsresult rv = NS_ERROR_UNEXPECTED;
1195-
if (mInner)
1196-
{
1197-
rv = mInner->IsCommandEnabled(aSources, aCommand, aArguments, _retval);
1198-
}
1199-
return(rv);
1194+
return NS_ERROR_NOT_IMPLEMENTED;
12001195
}
12011196

12021197
NS_IMETHODIMP
1203-
nsHTTPIndex::DoCommand(nsISupportsArray *aSources, nsIRDFResource *aCommand,
1204-
nsISupportsArray *aArguments)
1198+
nsHTTPIndex::DoCommand(nsISupports *aSources, nsIRDFResource *aCommand,
1199+
nsISupports *aArguments)
12051200
{
1206-
nsresult rv = NS_ERROR_UNEXPECTED;
1207-
if (mInner)
1208-
{
1209-
rv = mInner->DoCommand(aSources, aCommand, aArguments);
1210-
}
1211-
return(rv);
1201+
return NS_ERROR_NOT_IMPLEMENTED;
12121202
}
12131203

12141204
NS_IMETHODIMP

xpfe/components/windowds/nsWindowDataSource.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,18 +443,14 @@ NS_IMETHODIMP nsWindowDataSource::GetAllResources(nsISimpleEnumerator **_retval)
443443
return NS_OK;
444444
}
445445

446-
NS_IMETHODIMP nsWindowDataSource::IsCommandEnabled(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, bool *_retval)
446+
NS_IMETHODIMP nsWindowDataSource::IsCommandEnabled(nsISupports *aSources, nsIRDFResource *aCommand, nsISupports *aArguments, bool *_retval)
447447
{
448-
if (mInner)
449-
return mInner->IsCommandEnabled(aSources, aCommand, aArguments, _retval);
450-
return NS_OK;
448+
return NS_ERROR_NOT_IMPLEMENTED;
451449
}
452450

453-
NS_IMETHODIMP nsWindowDataSource::DoCommand(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
451+
NS_IMETHODIMP nsWindowDataSource::DoCommand(nsISupports *aSources, nsIRDFResource *aCommand, nsISupports *aArguments)
454452
{
455-
if (mInner)
456-
return mInner->DoCommand(aSources, aCommand, aArguments);
457-
return NS_OK;
453+
return NS_ERROR_NOT_IMPLEMENTED;
458454
}
459455

460456
NS_IMETHODIMP nsWindowDataSource::GetAllCmds(nsIRDFResource *aSource, nsISimpleEnumerator **_retval)

0 commit comments

Comments
 (0)