Bug 1162740 - Part 1: Remove instances of #ifdef PR_LOGGING in rdf. r=froydnj

PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
Eric Rahm 2015-05-08 09:33:17 -07:00
parent a5d9a23786
commit de288a64dc
5 changed files with 0 additions and 56 deletions

View File

@ -42,12 +42,10 @@
#include "nsEnumeratorUtils.h"
#ifdef PR_LOGGING
#include "prlog.h"
#include "prprf.h"
#include <stdio.h>
PRLogModuleInfo* nsRDFLog = nullptr;
#endif
//----------------------------------------------------------------------
//
@ -492,10 +490,8 @@ CompositeDataSourceImpl::CompositeDataSourceImpl(void)
mCoalesceDuplicateArcs(true),
mUpdateBatchNest(0)
{
#ifdef PR_LOGGING
if (nsRDFLog == nullptr)
nsRDFLog = PR_NewLogModule("RDF");
#endif
}
//----------------------------------------------------------------------

View File

@ -359,26 +359,20 @@ public:
}
}
#ifdef PR_LOGGING
void
LogOperation(const char* aOperation,
nsIRDFResource* asource,
nsIRDFResource* aProperty,
nsIRDFNode* aTarget,
bool aTruthValue = true);
#endif
bool mPropagateChanges;
private:
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
};
#ifdef PR_LOGGING
PRLogModuleInfo* InMemoryDataSource::gLog;
#endif
//----------------------------------------------------------------------
//
@ -790,10 +784,8 @@ InMemoryDataSource::Init()
PL_DHashTableInit(&mForwardArcs, PL_DHashGetStubOps(), sizeof(Entry));
PL_DHashTableInit(&mReverseArcs, PL_DHashGetStubOps(), sizeof(Entry));
#ifdef PR_LOGGING
if (! gLog)
gLog = PR_NewLogModule("InMemoryDataSource");
#endif
return NS_OK;
}
@ -866,7 +858,6 @@ NS_INTERFACE_MAP_END
////////////////////////////////////////////////////////////////////////
#ifdef PR_LOGGING
void
InMemoryDataSource::LogOperation(const char* aOperation,
nsIRDFResource* aSource,
@ -915,7 +906,6 @@ InMemoryDataSource::LogOperation(const char* aOperation,
(" -->(unknown-type)\n");
}
}
#endif
NS_IMETHODIMP
@ -1125,9 +1115,7 @@ InMemoryDataSource::LockedAssert(nsIRDFResource* aSource,
nsIRDFNode* aTarget,
bool aTruthValue)
{
#ifdef PR_LOGGING
LogOperation("ASSERT", aSource, aProperty, aTarget, aTruthValue);
#endif
Assertion* next = GetForwardArcs(aSource);
Assertion* prev = next;
@ -1265,9 +1253,7 @@ InMemoryDataSource::LockedUnassert(nsIRDFResource* aSource,
nsIRDFResource* aProperty,
nsIRDFNode* aTarget)
{
#ifdef PR_LOGGING
LogOperation("UNASSERT", aSource, aProperty, aTarget);
#endif
Assertion* next = GetForwardArcs(aSource);
Assertion* prev = next;
@ -1811,9 +1797,7 @@ InMemoryDataSource::Mark(nsIRDFResource* aSource,
as->Mark();
*aDidMark = true;
#ifdef PR_LOGGING
LogOperation("MARK", aSource, aProperty, aTarget, aTruthValue);
#endif
return NS_OK;
}
@ -1835,9 +1819,7 @@ InMemoryDataSource::Mark(nsIRDFResource* aSource,
as->Mark();
*aDidMark = true;
#ifdef PR_LOGGING
LogOperation("MARK", aSource, aProperty, aTarget, aTruthValue);
#endif
return NS_OK;
}
@ -1864,9 +1846,7 @@ InMemoryDataSource::Sweep()
// Now do the notification.
Assertion* as = info.mUnassertList;
while (as) {
#ifdef PR_LOGGING
LogOperation("SWEEP", as->mSource, as->u.as.mProperty, as->u.as.mTarget, as->u.as.mTruthValue);
#endif
if (!(as->mHashEntry))
{
for (int32_t i = int32_t(mNumObservers) - 1; mPropagateChanges && i >= 0; --i) {

View File

@ -226,9 +226,7 @@ protected:
nsIURI* mDocumentURL;
private:
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
};
int32_t RDFContentSinkImpl::gRefCnt = 0;
@ -241,9 +239,7 @@ nsIRDFResource* RDFContentSinkImpl::kRDF_Bag;
nsIRDFResource* RDFContentSinkImpl::kRDF_Seq;
nsIRDFResource* RDFContentSinkImpl::kRDF_nextVal;
#ifdef PR_LOGGING
PRLogModuleInfo* RDFContentSinkImpl::gLog;
#endif
////////////////////////////////////////////////////////////////////////
@ -296,10 +292,8 @@ RDFContentSinkImpl::RDFContentSinkImpl()
NS_RegisterStaticAtoms(rdf_atoms);
}
#ifdef PR_LOGGING
if (! gLog)
gLog = PR_NewLogModule("nsRDFContentSink");
#endif
}
@ -326,7 +320,6 @@ RDFContentSinkImpl::~RDFContentSinkImpl()
RDFContentSinkParseMode parseMode;
PopContext(resource, state, parseMode);
#ifdef PR_LOGGING
// print some fairly useless debugging info
// XXX we should save line numbers on the context stack: this'd
// be about 1000x more helpful.
@ -336,7 +329,6 @@ RDFContentSinkImpl::~RDFContentSinkImpl()
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml: uri=%s", (const char*) uri));
}
#endif
NS_IF_RELEASE(resource);
}
@ -446,7 +438,6 @@ RDFContentSinkImpl::HandleEndElement(const char16_t *aName)
nsIRDFResource* resource;
if (NS_FAILED(PopContext(resource, mState, mParseMode))) {
// XXX parser didn't catch unmatched tags?
#ifdef PR_LOGGING
if (PR_LOG_TEST(gLog, PR_LOG_WARNING)) {
nsAutoString tagStr(aName);
char* tagCStr = ToNewCString(tagStr);
@ -457,7 +448,6 @@ RDFContentSinkImpl::HandleEndElement(const char16_t *aName)
free(tagCStr);
}
#endif
return NS_ERROR_UNEXPECTED; // XXX
}

View File

@ -70,9 +70,7 @@ 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;
@ -755,10 +753,8 @@ RDFServiceImpl::Init()
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get default resource factory");
if (NS_FAILED(rv)) return rv;
#ifdef PR_LOGGING
if (! gLog)
gLog = PR_NewLogModule("nsRDFService");
#endif
return NS_OK;
}

View File

@ -134,9 +134,7 @@ protected:
static int32_t gRefCnt;
static nsIRDFService* gRDFService;
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
nsresult Init();
RDFXMLDataSourceImpl(void);
@ -360,9 +358,7 @@ protected:
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:";
@ -400,10 +396,8 @@ RDFXMLDataSourceImpl::RDFXMLDataSourceImpl(void)
mIsDirty(false),
mLoadState(eLoadState_Unloaded)
{
#ifdef PR_LOGGING
if (! gLog)
gLog = PR_NewLogModule("nsRDFXMLDataSource");
#endif
}
@ -833,12 +827,10 @@ RDFXMLDataSourceImpl::Flush(void)
if (! mURL)
return NS_ERROR_NOT_INITIALIZED;
#ifdef PR_LOGGING
nsAutoCString spec;
mURL->GetSpec(spec);
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] flush(%s)", this, spec.get()));
#endif
nsresult rv;
if (NS_SUCCEEDED(rv = rdfXMLFlush(mURL)))
@ -913,14 +905,12 @@ RDFXMLDataSourceImpl::AsyncOnChannelRedirect(nsIChannel *aOldChannel,
NS_IMETHODIMP
RDFXMLDataSourceImpl::Refresh(bool aBlocking)
{
#ifdef PR_LOGGING
nsAutoCString spec;
if (mURL) {
mURL->GetSpec(spec);
}
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] refresh(%s) %sblocking", this, spec.get(), (aBlocking ? "" : "non")));
#endif
// If an asynchronous load is already pending, then just let it do
// the honors.
@ -977,14 +967,12 @@ RDFXMLDataSourceImpl::Refresh(bool aBlocking)
NS_IMETHODIMP
RDFXMLDataSourceImpl::BeginLoad(void)
{
#ifdef PR_LOGGING
nsAutoCString spec;
if (mURL) {
mURL->GetSpec(spec);
}
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] begin-load(%s)", this, spec.get()));
#endif
mLoadState = eLoadState_Loading;
for (int32_t i = mObservers.Count() - 1; i >= 0; --i) {
@ -1003,14 +991,12 @@ RDFXMLDataSourceImpl::BeginLoad(void)
NS_IMETHODIMP
RDFXMLDataSourceImpl::Interrupt(void)
{
#ifdef PR_LOGGING
nsAutoCString spec;
if (mURL) {
mURL->GetSpec(spec);
}
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] interrupt(%s)", this, spec.get()));
#endif
for (int32_t i = mObservers.Count() - 1; i >= 0; --i) {
// Make sure to hold a strong reference to the observer so
@ -1028,14 +1014,12 @@ RDFXMLDataSourceImpl::Interrupt(void)
NS_IMETHODIMP
RDFXMLDataSourceImpl::Resume(void)
{
#ifdef PR_LOGGING
nsAutoCString spec;
if (mURL) {
mURL->GetSpec(spec);
}
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] resume(%s)", this, spec.get()));
#endif
for (int32_t i = mObservers.Count() - 1; i >= 0; --i) {
// Make sure to hold a strong reference to the observer so
@ -1053,14 +1037,12 @@ RDFXMLDataSourceImpl::Resume(void)
NS_IMETHODIMP
RDFXMLDataSourceImpl::EndLoad(void)
{
#ifdef PR_LOGGING
nsAutoCString spec;
if (mURL) {
mURL->GetSpec(spec);
}
PR_LOG(gLog, PR_LOG_NOTICE,
("rdfxml[%p] end-load(%s)", this, spec.get()));
#endif
mLoadState = eLoadState_Loaded;