Skip to content

Commit

Permalink
Backed out changeset 58dbd2146e24 (bug 944961) for bustage.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Dec 3, 2013
1 parent e51a2e7 commit 2fb3a52
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion rdf/base/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

UNIFIED_SOURCES += [
SOURCES += [
'nsCompositeDataSource.cpp',
'nsContainerEnumerator.cpp',
'nsDefaultResourceFactory.cpp',
Expand Down
2 changes: 2 additions & 0 deletions rdf/base/src/nsCompositeDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
PRLogModuleInfo* nsRDFLog = nullptr;
#endif

static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);

//----------------------------------------------------------------------
//
// CompositeDataSourceImpl
Expand Down
8 changes: 5 additions & 3 deletions rdf/base/src/nsContainerEnumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

////////////////////////////////////////////////////////////////////////

static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);

////////////////////////////////////////////////////////////////////////

class ContainerEnumeratorImpl : public nsISimpleEnumerator {
private:
// pseudo-constants
Expand Down Expand Up @@ -79,8 +84,6 @@ ContainerEnumeratorImpl::Init()
{
if (gRefCnt++ == 0) {
nsresult rv;

NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
nsCOMPtr<nsIRDFService> rdf = do_GetService(kRDFServiceCID);
NS_ASSERTION(rdf != nullptr, "unable to acquire resource manager");
if (! rdf)
Expand All @@ -90,7 +93,6 @@ ContainerEnumeratorImpl::Init()
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");
if (NS_FAILED(rv)) return rv;

NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
rv = CallGetService(kRDFContainerUtilsCID, &gRDFC);
if (NS_FAILED(rv)) return rv;
}
Expand Down
14 changes: 5 additions & 9 deletions rdf/base/src/nsInMemoryDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
#include "rdfIDataSource.h"
#include "rdfITripleVisitor.h"

#ifdef PR_LOGGING
static PRLogModuleInfo* gLog = nullptr;
#endif


// This struct is used as the slot value in the forward and reverse
// arcs hash tables.
//
Expand Down Expand Up @@ -360,17 +365,8 @@ class InMemoryDataSource : public nsIRDFDataSource,
#endif

bool mPropagateChanges;

private:
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
};

#ifdef PR_LOGGING
PRLogModuleInfo* InMemoryDataSource::gLog;
#endif

//----------------------------------------------------------------------
//
// InMemoryAssertionEnumeratorImpl
Expand Down
7 changes: 4 additions & 3 deletions rdf/base/src/nsRDFContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#include "nsXPIDLString.h"
#include "rdf.h"

static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI;

#define RDF_SEQ_LIST_LIMIT 8

class RDFContainerImpl : public nsIRDFContainer
Expand Down Expand Up @@ -377,7 +381,6 @@ RDFContainerImpl::Init()
if (gRefCnt++ == 0) {
nsresult rv;

NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
rv = CallGetService(kRDFServiceCID, &gRDFService);
if (NS_FAILED(rv)) {
NS_ERROR("unable to get RDF service");
Expand All @@ -388,7 +391,6 @@ RDFContainerImpl::Init()
&kRDF_nextVal);
if (NS_FAILED(rv)) return rv;

NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils);
if (NS_FAILED(rv)) {
NS_ERROR("unable to get RDF container utils service");
Expand Down Expand Up @@ -686,7 +688,6 @@ RDFContainerImpl::GetNextValue(nsIRDFResource** aResult)
}
}

static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI;
char buf[sizeof(kRDFNameSpaceURI) + 16];
nsFixedCString nextValStr(buf, sizeof(buf), 0);
nextValStr = kRDFNameSpaceURI;
Expand Down
7 changes: 4 additions & 3 deletions rdf/base/src/nsRDFContainerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include "rdf.h"
#include "rdfutil.h"

static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static const char kRDFNameSpaceURI[] = RDF_NAMESPACE_URI;

class RDFContainerUtilsImpl : public nsIRDFContainerUtils
{
public:
Expand Down Expand Up @@ -54,9 +57,9 @@ class RDFContainerUtilsImpl : public nsIRDFContainerUtils
static nsIRDFResource* kRDF_Seq;
static nsIRDFResource* kRDF_Alt;
static nsIRDFLiteral* kOne;
static const char kRDFNameSpaceURI[];
};


int32_t RDFContainerUtilsImpl::gRefCnt = 0;
nsIRDFService* RDFContainerUtilsImpl::gRDFService;
nsIRDFResource* RDFContainerUtilsImpl::kRDF_instanceOf;
Expand All @@ -65,7 +68,6 @@ nsIRDFResource* RDFContainerUtilsImpl::kRDF_Bag;
nsIRDFResource* RDFContainerUtilsImpl::kRDF_Seq;
nsIRDFResource* RDFContainerUtilsImpl::kRDF_Alt;
nsIRDFLiteral* RDFContainerUtilsImpl::kOne;
const char RDFContainerUtilsImpl::kRDFNameSpaceURI[] = RDF_NAMESPACE_URI;

////////////////////////////////////////////////////////////////////////
// nsISupports interface
Expand Down Expand Up @@ -323,7 +325,6 @@ RDFContainerUtilsImpl::RDFContainerUtilsImpl()
if (gRefCnt++ == 0) {
nsresult rv;

NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
rv = CallGetService(kRDFServiceCID, &gRDFService);

NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service");
Expand Down
37 changes: 20 additions & 17 deletions rdf/base/src/nsRDFContentSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,25 @@

using namespace mozilla;

////////////////////////////////////////////////////////////////////////
// XPCOM IIDs

static NS_DEFINE_IID(kIContentSinkIID, NS_ICONTENT_SINK_IID); // XXX grr...
static NS_DEFINE_IID(kIExpatSinkIID, NS_IEXPATSINK_IID);
static NS_DEFINE_IID(kIRDFServiceIID, NS_IRDFSERVICE_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIXMLContentSinkIID, NS_IXMLCONTENT_SINK_IID);
static NS_DEFINE_IID(kIRDFContentSinkIID, NS_IRDFCONTENTSINK_IID);

static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);

////////////////////////////////////////////////////////////////////////

#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif

///////////////////////////////////////////////////////////////////////

enum RDFContentSinkState {
Expand Down Expand Up @@ -225,11 +244,6 @@ class RDFContentSinkImpl : public nsIRDFContentSink,
nsAutoTArray<RDFContextStackElement, 8>* mContextStack;

nsIURI* mDocumentURL;

private:
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
};

int32_t RDFContentSinkImpl::gRefCnt = 0;
Expand All @@ -242,10 +256,6 @@ nsIRDFResource* RDFContentSinkImpl::kRDF_Bag;
nsIRDFResource* RDFContentSinkImpl::kRDF_Seq;
nsIRDFResource* RDFContentSinkImpl::kRDF_nextVal;

#ifdef PR_LOGGING
PRLogModuleInfo* RDFContentSinkImpl::gLog;
#endif

////////////////////////////////////////////////////////////////////////

#define RDF_ATOM(name_, value_) nsIAtom* RDFContentSinkImpl::name_;
Expand All @@ -272,7 +282,6 @@ RDFContentSinkImpl::RDFContentSinkImpl()
mDocumentURL(nullptr)
{
if (gRefCnt++ == 0) {
NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
nsresult rv = CallGetService(kRDFServiceCID, &gRDFService);

NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service");
Expand All @@ -291,7 +300,7 @@ RDFContentSinkImpl::RDFContentSinkImpl()
&kRDF_nextVal);
}

NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);

rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils);

NS_RegisterStaticAtoms(rdf_atoms);
Expand Down Expand Up @@ -372,12 +381,6 @@ RDFContentSinkImpl::QueryInterface(REFNSIID iid, void** result)
if (! result)
return NS_ERROR_NULL_POINTER;

NS_DEFINE_IID(kIContentSinkIID, NS_ICONTENT_SINK_IID);
NS_DEFINE_IID(kIExpatSinkIID, NS_IEXPATSINK_IID);
NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
NS_DEFINE_IID(kIXMLContentSinkIID, NS_IXMLCONTENT_SINK_IID);
NS_DEFINE_IID(kIRDFContentSinkIID, NS_IRDFCONTENTSINK_IID);

*result = nullptr;
if (iid.Equals(kIRDFContentSinkIID) ||
iid.Equals(kIXMLContentSinkIID) ||
Expand Down
8 changes: 4 additions & 4 deletions rdf/base/src/nsRDFService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ static NS_DEFINE_IID(kIRDFIntIID, NS_IRDFINT_IID);
static NS_DEFINE_IID(kIRDFNodeIID, NS_IRDFNODE_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);

#ifdef PR_LOGGING
static PRLogModuleInfo* gLog = nullptr;
#endif

class BlobImpl;

// These functions are copied from nsprpub/lib/ds/plhash.c, with one
Expand Down Expand Up @@ -724,10 +728,6 @@ IntImpl::EqualsInt(nsIRDFInt* intValue, bool* result)
////////////////////////////////////////////////////////////////////////
// RDFServiceImpl

#ifdef PR_LOGGING
PRLogModuleInfo* RDFServiceImpl::gLog;
#endif

RDFServiceImpl*
RDFServiceImpl::gRDFService;

Expand Down
5 changes: 0 additions & 5 deletions rdf/base/src/nsRDFService.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "nsString.h"

struct PLHashTable;
struct PRLogModuleInfo;
class nsIRDFLiteral;
class nsIRDFInt;
class nsIRDFDate;
Expand All @@ -37,10 +36,6 @@ class BlobImpl;
class RDFServiceImpl : public nsIRDFService,
public nsSupportsWeakReference
{
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif

protected:
PLHashTable* mNamedDataSources;
PLDHashTable mResources;
Expand Down
20 changes: 9 additions & 11 deletions rdf/base/src/nsRDFXMLDataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@

#include "rdfIDataSource.h"

//----------------------------------------------------------------------

static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);

#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif

//----------------------------------------------------------------------
//
// RDFXMLDataSourceImpl
Expand Down Expand Up @@ -132,10 +141,6 @@ class RDFXMLDataSourceImpl : public nsIRDFDataSource,
static int32_t gRefCnt;
static nsIRDFService* gRDFService;

#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif

nsresult Init();
RDFXMLDataSourceImpl(void);
virtual ~RDFXMLDataSourceImpl(void);
Expand Down Expand Up @@ -358,10 +363,6 @@ class RDFXMLDataSourceImpl : public nsIRDFDataSource,
int32_t RDFXMLDataSourceImpl::gRefCnt = 0;
nsIRDFService* RDFXMLDataSourceImpl::gRDFService;

#ifdef PR_LOGGING
PRLogModuleInfo* RDFXMLDataSourceImpl::gLog;
#endif

static const char kFileURIPrefix[] = "file:";
static const char kResourceURIPrefix[] = "resource:";

Expand Down Expand Up @@ -409,12 +410,10 @@ nsresult
RDFXMLDataSourceImpl::Init()
{
nsresult rv;
NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID);
mInner = do_CreateInstance(kRDFInMemoryDataSourceCID, &rv);
if (NS_FAILED(rv)) return rv;

if (gRefCnt++ == 0) {
NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
rv = CallGetService(kRDFServiceCID, &gRDFService);

NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get RDF service");
Expand Down Expand Up @@ -743,7 +742,6 @@ RDFXMLDataSourceImpl::rdfXMLFlush(nsIURI *aURI)
// we are, we're screwed: it's too late to serialize because
// many of the services that we'll need to acquire to properly
// write the file will be unaquirable.
NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
nsCOMPtr<nsIRDFService> dummy = do_GetService(kRDFServiceCID, &rv);
if (NS_FAILED(rv)) {
NS_WARNING("unable to Flush() dirty datasource during XPCOM shutdown");
Expand Down
2 changes: 1 addition & 1 deletion rdf/datasource/src/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

UNIFIED_SOURCES += [
SOURCES += [
'nsFileSystemDataSource.cpp',
'nsLocalStore.cpp',
]
Expand Down

0 comments on commit 2fb3a52

Please sign in to comment.