зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
6a07a42125
Коммит
d986dfc66d
|
@ -1099,9 +1099,9 @@ CompositeDataSourceImpl::GetAllCmds(nsIRDFResource* source,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CompositeDataSourceImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
CompositeDataSourceImpl::IsCommandEnabled(nsISupports/* nsIRDFResource container */* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports/* nsIRDFResource container */* aArguments,
|
||||
bool* aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -1123,9 +1123,9 @@ CompositeDataSourceImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/*
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CompositeDataSourceImpl::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
CompositeDataSourceImpl::DoCommand(nsISupports/* nsIRDFResource container */* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
|
||||
nsISupports/* nsIRDFResource container */* aArguments)
|
||||
{
|
||||
for (int32_t i = mDataSources.Count() - 1; i >= 0; --i) {
|
||||
nsresult rv = mDataSources[i]->DoCommand(aSources, aCommand, aArguments);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsISupportsArray.idl"
|
||||
#include "nsIRDFResource.idl"
|
||||
#include "nsIRDFNode.idl"
|
||||
#include "nsISimpleEnumerator.idl"
|
||||
|
@ -138,16 +137,16 @@ interface nsIRDFDataSource : nsISupports
|
|||
/**
|
||||
* Returns whether a given command is enabled for a set of sources.
|
||||
*/
|
||||
boolean IsCommandEnabled(in nsISupportsArray aSources,
|
||||
boolean IsCommandEnabled(in nsISupports aSources,
|
||||
in nsIRDFResource aCommand,
|
||||
in nsISupportsArray aArguments);
|
||||
in nsISupports aArguments);
|
||||
|
||||
/**
|
||||
* Perform the specified command on set of sources.
|
||||
*/
|
||||
void DoCommand(in nsISupportsArray aSources,
|
||||
void DoCommand(in nsISupports aSources,
|
||||
in nsIRDFResource aCommand,
|
||||
in nsISupportsArray aArguments);
|
||||
in nsISupports aArguments);
|
||||
|
||||
/**
|
||||
* Returns the set of all commands defined for a given source.
|
||||
|
|
|
@ -1584,21 +1584,20 @@ InMemoryDataSource::GetAllCmds(nsIRDFResource* source,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
InMemoryDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
InMemoryDataSource::IsCommandEnabled(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports* aArguments,
|
||||
bool* aResult)
|
||||
{
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
InMemoryDataSource::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
InMemoryDataSource::DoCommand(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
|
||||
nsISupports* aArguments)
|
||||
{
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -1883,7 +1882,7 @@ InMemoryDataSource::VisitAllSubjects(rdfITripleVisitor *aVisitor)
|
|||
// Lock datasource against writes
|
||||
++mReadCount;
|
||||
|
||||
// Enumerate all of our entries into an nsISupportsArray.
|
||||
// Enumerate all of our entries.
|
||||
nsresult rv = NS_OK;
|
||||
for (auto iter = mForwardArcs.Iter(); !iter.Done(); iter.Next()) {
|
||||
auto entry = static_cast<Entry*>(iter.Get());
|
||||
|
@ -1911,7 +1910,7 @@ InMemoryDataSource::VisitAllTriples(rdfITripleVisitor *aVisitor)
|
|||
// Lock datasource against writes
|
||||
++mReadCount;
|
||||
|
||||
// Enumerate all of our entries into an nsISupportsArray.
|
||||
// Enumerate all of our entries.
|
||||
nsresult rv = NS_OK;
|
||||
for (auto iter = mForwardArcs.Iter(); !iter.Done(); iter.Next()) {
|
||||
auto entry = static_cast<Entry*>(iter.Get());
|
||||
|
|
|
@ -249,19 +249,17 @@ public:
|
|||
return mInner->GetAllCmds(source, commands);
|
||||
}
|
||||
|
||||
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
NS_IMETHOD IsCommandEnabled(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports* aArguments,
|
||||
bool* aResult) override {
|
||||
return mInner->IsCommandEnabled(aSources, aCommand, aArguments, aResult);
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
NS_IMETHOD DoCommand(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments) override {
|
||||
// XXX Uh oh, this could cause problems wrt. the "dirty" flag
|
||||
// if it changes the in-memory store's internal state.
|
||||
return mInner->DoCommand(aSources, aCommand, aArguments);
|
||||
nsISupports* aArguments) override {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHOD BeginUpdateBatch() override {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <stdio.h>
|
||||
#include "nsArrayEnumerator.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIRDFDataSource.h"
|
||||
#include "nsIRDFObserver.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -801,9 +800,9 @@ FileSystemDataSource::GetAllCmds(nsIRDFResource* source,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
FileSystemDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
FileSystemDataSource::IsCommandEnabled(nsISupports/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports/*<nsIRDFResource>*/* aArguments,
|
||||
bool* aResult)
|
||||
{
|
||||
return(NS_ERROR_NOT_IMPLEMENTED);
|
||||
|
@ -812,9 +811,9 @@ FileSystemDataSource::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSo
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
FileSystemDataSource::DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
FileSystemDataSource::DoCommand(nsISupports/*<nsIRDFResource>*/* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments)
|
||||
nsISupports/*<nsIRDFResource>*/* aArguments)
|
||||
{
|
||||
return(NS_ERROR_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
|
|
@ -165,14 +165,14 @@ public:
|
|||
NS_IMETHOD GetAllCmds(nsIRDFResource* aSource,
|
||||
nsISimpleEnumerator/*<nsIRDFResource>*/** aCommands) override;
|
||||
|
||||
NS_IMETHOD IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
NS_IMETHOD IsCommandEnabled(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports* aArguments,
|
||||
bool* aResult) override;
|
||||
|
||||
NS_IMETHOD DoCommand(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
NS_IMETHOD DoCommand(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments) override;
|
||||
nsISupports* aArguments) override;
|
||||
|
||||
NS_IMETHOD BeginUpdateBatch() override {
|
||||
return mInner->BeginUpdateBatch();
|
||||
|
@ -441,22 +441,20 @@ LocalStoreImpl::GetAllCmds(nsIRDFResource* aSource,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocalStoreImpl::IsCommandEnabled(nsISupportsArray/*<nsIRDFResource>*/* aSources,
|
||||
LocalStoreImpl::IsCommandEnabled(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray/*<nsIRDFResource>*/* aArguments,
|
||||
nsISupports* aArguments,
|
||||
bool* aResult)
|
||||
{
|
||||
*aResult = true;
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocalStoreImpl::DoCommand(nsISupportsArray* aSources,
|
||||
LocalStoreImpl::DoCommand(nsISupports* aSources,
|
||||
nsIRDFResource* aCommand,
|
||||
nsISupportsArray* aArguments)
|
||||
nsISupports* aArguments)
|
||||
{
|
||||
// no-op
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -1188,27 +1188,17 @@ nsHTTPIndex::GetAllResources(nsISimpleEnumerator **_retval)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPIndex::IsCommandEnabled(nsISupportsArray *aSources, nsIRDFResource *aCommand,
|
||||
nsISupportsArray *aArguments, bool *_retval)
|
||||
nsHTTPIndex::IsCommandEnabled(nsISupports *aSources, nsIRDFResource *aCommand,
|
||||
nsISupports *aArguments, bool *_retval)
|
||||
{
|
||||
nsresult rv = NS_ERROR_UNEXPECTED;
|
||||
if (mInner)
|
||||
{
|
||||
rv = mInner->IsCommandEnabled(aSources, aCommand, aArguments, _retval);
|
||||
}
|
||||
return(rv);
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTTPIndex::DoCommand(nsISupportsArray *aSources, nsIRDFResource *aCommand,
|
||||
nsISupportsArray *aArguments)
|
||||
nsHTTPIndex::DoCommand(nsISupports *aSources, nsIRDFResource *aCommand,
|
||||
nsISupports *aArguments)
|
||||
{
|
||||
nsresult rv = NS_ERROR_UNEXPECTED;
|
||||
if (mInner)
|
||||
{
|
||||
rv = mInner->DoCommand(aSources, aCommand, aArguments);
|
||||
}
|
||||
return(rv);
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -443,18 +443,14 @@ NS_IMETHODIMP nsWindowDataSource::GetAllResources(nsISimpleEnumerator **_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindowDataSource::IsCommandEnabled(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, bool *_retval)
|
||||
NS_IMETHODIMP nsWindowDataSource::IsCommandEnabled(nsISupports *aSources, nsIRDFResource *aCommand, nsISupports *aArguments, bool *_retval)
|
||||
{
|
||||
if (mInner)
|
||||
return mInner->IsCommandEnabled(aSources, aCommand, aArguments, _retval);
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindowDataSource::DoCommand(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments)
|
||||
NS_IMETHODIMP nsWindowDataSource::DoCommand(nsISupports *aSources, nsIRDFResource *aCommand, nsISupports *aArguments)
|
||||
{
|
||||
if (mInner)
|
||||
return mInner->DoCommand(aSources, aCommand, aArguments);
|
||||
return NS_OK;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsWindowDataSource::GetAllCmds(nsIRDFResource *aSource, nsISimpleEnumerator **_retval)
|
||||
|
|
Загрузка…
Ссылка в новой задаче