mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1163194 - Part 1: Remove instances of #ifdef PR_LOGGING in dom/xul. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
This commit is contained in:
parent
6ae0c6c9d3
commit
e65499facc
@ -375,7 +375,6 @@ XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
|
||||
nsIStreamListener **aDocListener,
|
||||
bool aReset, nsIContentSink* aSink)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
@ -389,7 +388,6 @@ XULDocument::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// NOTE: If this ever starts calling nsDocument::StartDocumentLoad
|
||||
// we'll possibly need to reset our content type afterwards.
|
||||
mStillWalking = true;
|
||||
@ -561,7 +559,6 @@ XULDocument::EndLoad()
|
||||
}
|
||||
|
||||
OnPrototypeLoadDone(true);
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING)) {
|
||||
nsAutoCString urlspec;
|
||||
rv = uri->GetSpec(urlspec);
|
||||
@ -570,7 +567,6 @@ XULDocument::EndLoad()
|
||||
("xul: Finished loading document '%s'", urlspec.get()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -1893,10 +1889,8 @@ XULDocument::Init()
|
||||
Preferences::RegisterCallback(XULDocument::DirectionChanged,
|
||||
"intl.uidirection.", this);
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (! gXULLog)
|
||||
gXULLog = PR_NewLogModule("XULDocument");
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2277,7 +2271,6 @@ XULDocument::PrepareToWalk()
|
||||
nsXULPrototypeElement* proto = mCurrentPrototype->GetRootElement();
|
||||
|
||||
if (! proto) {
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_ERROR)) {
|
||||
nsCOMPtr<nsIURI> url = mCurrentPrototype->GetURI();
|
||||
|
||||
@ -2288,7 +2281,6 @@ XULDocument::PrepareToWalk()
|
||||
PR_LOG(gXULLog, PR_LOG_ERROR,
|
||||
("xul: error parsing '%s'", urlspec.get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2550,7 +2542,6 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic,
|
||||
*aShouldReturn = false;
|
||||
*aFailureFromContent = false;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_DEBUG)) {
|
||||
nsAutoCString urlspec;
|
||||
aURI->GetSpec(urlspec);
|
||||
@ -2565,7 +2556,6 @@ XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic,
|
||||
PR_LOG(gXULLog, PR_LOG_DEBUG,
|
||||
("xul: %s loading overlay %s", parentDoc.get(), urlspec.get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (aIsDynamic)
|
||||
mResolutionPhase = nsForwardReference::eStart;
|
||||
@ -3586,13 +3576,11 @@ XULDocument::CreateElementFromPrototype(nsXULPrototypeElement* aPrototype,
|
||||
*aResult = nullptr;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
|
||||
PR_LOG(gXULLog, PR_LOG_NOTICE,
|
||||
("xul: creating <%s> from prototype",
|
||||
NS_ConvertUTF16toUTF8(aPrototype->mNodeInfo->QualifiedName()).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
nsRefPtr<Element> result;
|
||||
|
||||
@ -3858,7 +3846,6 @@ XULDocument::OverlayForwardReference::Resolve()
|
||||
if (NS_FAILED(rv)) return eResolve_Error;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
|
||||
nsAutoCString idC;
|
||||
idC.AssignWithConversion(id);
|
||||
@ -3866,7 +3853,6 @@ XULDocument::OverlayForwardReference::Resolve()
|
||||
("xul: overlay resolved '%s'",
|
||||
idC.get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
mResolved = true;
|
||||
return eResolve_Succeeded;
|
||||
@ -4029,7 +4015,6 @@ XULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode,
|
||||
|
||||
XULDocument::OverlayForwardReference::~OverlayForwardReference()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
|
||||
nsAutoString id;
|
||||
mOverlay->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
|
||||
@ -4050,7 +4035,6 @@ XULDocument::OverlayForwardReference::~OverlayForwardReference()
|
||||
("xul: %s overlay failed to resolve '%s' in %s",
|
||||
urlspec.get(), idC.get(), parentDoc.get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -4074,7 +4058,6 @@ XULDocument::BroadcasterHookup::Resolve()
|
||||
|
||||
XULDocument::BroadcasterHookup::~BroadcasterHookup()
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_WARNING) && !mResolved) {
|
||||
// Tell the world we failed
|
||||
|
||||
@ -4099,7 +4082,6 @@ XULDocument::BroadcasterHookup::~BroadcasterHookup()
|
||||
attributeC.get(),
|
||||
broadcasteridC.get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -4294,7 +4276,6 @@ XULDocument::CheckBroadcasterHookup(Element* aElement,
|
||||
return domRv.StealNSResult();
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
// Tell the world we succeeded
|
||||
if (PR_LOG_TEST(gXULLog, PR_LOG_NOTICE)) {
|
||||
nsCOMPtr<nsIContent> content =
|
||||
@ -4313,7 +4294,6 @@ XULDocument::CheckBroadcasterHookup(Element* aElement,
|
||||
attributeC.get(),
|
||||
broadcasteridC.get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
*aNeedsHookup = false;
|
||||
*aDidResolve = true;
|
||||
|
@ -37,9 +37,7 @@
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo* gCommandLog;
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -47,10 +45,8 @@ nsXULCommandDispatcher::nsXULCommandDispatcher(nsIDocument* aDocument)
|
||||
: mDocument(aDocument), mUpdaters(nullptr)
|
||||
{
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (! gCommandLog)
|
||||
gCommandLog = PR_NewLogModule("nsXULCommandDispatcher");
|
||||
#endif
|
||||
}
|
||||
|
||||
nsXULCommandDispatcher::~nsXULCommandDispatcher()
|
||||
|
@ -57,9 +57,7 @@
|
||||
#include "nsIScriptError.h"
|
||||
#include "nsContentTypeParser.h"
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo* gContentSinkLog;
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@ -165,10 +163,8 @@ XULContentSinkImpl::XULContentSinkImpl()
|
||||
mState(eInProlog)
|
||||
{
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (! gContentSinkLog)
|
||||
gContentSinkLog = PR_NewLogModule("nsXULContentSink");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -743,7 +739,6 @@ XULContentSinkImpl::OpenRoot(const char16_t** aAttributes,
|
||||
rv = CreateElement(aNodeInfo, &element);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
|
||||
nsAutoString anodeC;
|
||||
aNodeInfo->GetName(anodeC);
|
||||
@ -752,7 +747,6 @@ XULContentSinkImpl::OpenRoot(const char16_t** aAttributes,
|
||||
NS_ConvertUTF16toUTF8(anodeC).get(),
|
||||
-1)); // XXX pass in line number
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -786,7 +780,6 @@ XULContentSinkImpl::OpenTag(const char16_t** aAttributes,
|
||||
rv = CreateElement(aNodeInfo, &element);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gContentSinkLog, PR_LOG_ERROR)) {
|
||||
nsAutoString anodeC;
|
||||
aNodeInfo->GetName(anodeC);
|
||||
@ -795,7 +788,6 @@ XULContentSinkImpl::OpenTag(const char16_t** aAttributes,
|
||||
NS_ConvertUTF16toUTF8(anodeC).get(),
|
||||
aLineNumber));
|
||||
}
|
||||
#endif
|
||||
|
||||
return rv;
|
||||
}
|
||||
@ -985,7 +977,6 @@ XULContentSinkImpl::AddAttributes(const char16_t** aAttributes,
|
||||
mDocumentURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gContentSinkLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString extraWhiteSpace;
|
||||
int32_t cnt = mContextStack.Depth();
|
||||
@ -1001,7 +992,6 @@ XULContentSinkImpl::AddAttributes(const char16_t** aAttributes,
|
||||
NS_ConvertUTF16toUTF8(qnameC).get(),
|
||||
NS_ConvertUTF16toUTF8(valueC).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -13,9 +13,7 @@
|
||||
#include "nsXULTemplateQueryProcessorRDF.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
nsIAtom* aRefVariable)
|
||||
@ -25,7 +23,6 @@ nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
mRefVariable(aRefVariable),
|
||||
mTag(nullptr)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString tag(NS_LITERAL_STRING("(none)"));
|
||||
if (mTag)
|
||||
@ -40,7 +37,6 @@ nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
this, NS_ConvertUTF16toUTF8(refvar).get(),
|
||||
NS_ConvertUTF16toUTF8(tag).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -8,19 +8,15 @@
|
||||
#include "nsXULTemplateQueryProcessorRDF.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
nsRDFQuery* aQuery)
|
||||
: mProcessor(aProcessor),
|
||||
mQuery(aQuery)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
("nsInstantiationNode[%p] query=%p", this, aQuery));
|
||||
#endif
|
||||
|
||||
MOZ_COUNT_CTOR(nsInstantiationNode);
|
||||
}
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsResourceSet.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
#include "nsXULContentUtils.h"
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
|
||||
@ -25,7 +24,6 @@ TestToString(nsRDFConInstanceTestNode::Test aTest) {
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
#endif
|
||||
|
||||
nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent,
|
||||
nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
@ -38,7 +36,6 @@ nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent,
|
||||
mContainer(aContainer),
|
||||
mEmpty(aEmpty)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoCString props;
|
||||
|
||||
@ -70,7 +67,6 @@ nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent,
|
||||
TestToString(aContainer),
|
||||
TestToString(aEmpty)));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -104,7 +100,6 @@ nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* container = "(unbound)";
|
||||
valueres->GetValueConst(&container);
|
||||
@ -113,7 +108,6 @@ nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations
|
||||
("nsRDFConInstanceTestNode[%p]::FilterInstantiations() container=[%s]",
|
||||
this, container));
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIRDFContainer> rdfcontainer;
|
||||
|
||||
@ -251,7 +245,6 @@ nsRDFConInstanceTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source;
|
||||
aSource->GetValueConst(&source);
|
||||
@ -267,7 +260,6 @@ nsRDFConInstanceTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
this, source, property, NS_ConvertUTF16toUTF8(target).get(),
|
||||
canpropagate ? "true" : "false"));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (canpropagate) {
|
||||
aInitialBindings.AddAssignment(mContainerVariable, aSource);
|
||||
|
@ -13,9 +13,7 @@
|
||||
#include "nsXULContentUtils.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent,
|
||||
nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
@ -26,7 +24,6 @@ nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent,
|
||||
mContainerVariable(aContainerVariable),
|
||||
mMemberVariable(aMemberVariable)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoCString props;
|
||||
|
||||
@ -61,7 +58,6 @@ nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent,
|
||||
NS_ConvertUTF16toUTF8(cvar).get(),
|
||||
NS_ConvertUTF16toUTF8(mvar).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -115,7 +111,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
hasMemberBinding = inst->mAssignments.GetAssignmentFor(mMemberVariable,
|
||||
getter_AddRefs(memberValue));
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* container = "(unbound)";
|
||||
if (hasContainerBinding)
|
||||
@ -129,7 +124,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
("nsRDFConMemberTestNode[%p]: FilterInstantiations() container=[%s] member=[%s]",
|
||||
this, container, NS_ConvertUTF16toUTF8(member).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hasContainerBinding && hasMemberBinding) {
|
||||
// it's a consistency check. see if we have a assignment that is consistent
|
||||
@ -221,7 +215,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
if (! node)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString member;
|
||||
nsXULContentUtils::GetTextForNode(node, member);
|
||||
@ -229,7 +222,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" member => %s", NS_ConvertUTF16toUTF8(member).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
Instantiation newinst = *inst;
|
||||
newinst.AddAssignment(mMemberVariable, node);
|
||||
@ -310,7 +302,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
if (! source)
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* container;
|
||||
source->GetValueConst(&container);
|
||||
@ -318,7 +309,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" container => %s", container));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add a new instantiation
|
||||
Instantiation newinst = *inst;
|
||||
@ -382,7 +372,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
NS_ASSERTION(value != nullptr, "member is not an nsIRDFNode");
|
||||
if (! value) continue;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString s;
|
||||
nsXULContentUtils::GetTextForNode(value, s);
|
||||
@ -390,7 +379,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" member => %s", NS_ConvertUTF16toUTF8(s).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
variable = mContainerVariable;
|
||||
@ -401,7 +389,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
|
||||
value = valueRes;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* s;
|
||||
valueRes->GetValueConst(&s);
|
||||
@ -409,7 +396,6 @@ nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" container => %s", s));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Copy the original instantiation, and add it to the
|
||||
@ -480,7 +466,6 @@ nsRDFConMemberTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source;
|
||||
aSource->GetValueConst(&source);
|
||||
@ -496,7 +481,6 @@ nsRDFConMemberTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
this, source, property, NS_ConvertUTF16toUTF8(target).get(),
|
||||
canpropagate ? "true" : "false"));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (canpropagate) {
|
||||
aInitialBindings.AddAssignment(mContainerVariable, aSource);
|
||||
|
@ -8,10 +8,8 @@
|
||||
#include "nsXULContentUtils.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#include "nsIRDFLiteral.h"
|
||||
#endif
|
||||
|
||||
nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
nsXULTemplateQueryProcessorRDF* aProcessor,
|
||||
@ -26,7 +24,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
mTargetVariable(aTargetVariable),
|
||||
mTarget(nullptr)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* prop = "(null)";
|
||||
if (aProperty)
|
||||
@ -44,7 +41,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
|
||||
this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(tvar).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +57,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
mTargetVariable(aTargetVariable),
|
||||
mTarget(nullptr)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source = "(null)";
|
||||
if (aSource)
|
||||
@ -79,7 +74,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
|
||||
this, aParent, source, prop, NS_ConvertUTF16toUTF8(tvar).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +90,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
mTargetVariable(0),
|
||||
mTarget(aTarget)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString svar(NS_LITERAL_STRING("(none)"));
|
||||
if (mSourceVariable)
|
||||
@ -113,7 +106,6 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
|
||||
("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
|
||||
this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(target).get()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +148,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
getter_AddRefs(targetValue));
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source = "(unbound)";
|
||||
if (hasSourceBinding)
|
||||
@ -170,7 +161,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
("nsRDFPropertyTestNode[%p]: FilterInstantiations() source=[%s] target=[%s]",
|
||||
this, source, NS_ConvertUTF16toUTF8(target).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (hasSourceBinding && hasTargetBinding) {
|
||||
// it's a consistency check. see if we have a assignment that is consistent
|
||||
@ -179,10 +169,8 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
true, &hasAssertion);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" consistency check => %s", hasAssertion ? "passed" : "failed"));
|
||||
#endif
|
||||
|
||||
if (hasAssertion) {
|
||||
// it's consistent.
|
||||
@ -241,7 +229,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
value = do_QueryInterface(isupports);
|
||||
NS_ASSERTION(value != nullptr, "target is not an nsIRDFNode");
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString s(NS_LITERAL_STRING("(none found)"));
|
||||
if (value)
|
||||
@ -250,7 +237,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" target => %s", NS_ConvertUTF16toUTF8(s).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! value) continue;
|
||||
|
||||
@ -262,7 +248,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
nsCOMPtr<nsIRDFResource> source = do_QueryInterface(isupports);
|
||||
NS_ASSERTION(source != nullptr, "source is not an nsIRDFResource");
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* s = "(none found)";
|
||||
if (source)
|
||||
@ -271,7 +256,6 @@ nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
(" source => %s", s));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! source) continue;
|
||||
|
||||
@ -337,7 +321,6 @@ nsRDFPropertyTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
result = true;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source;
|
||||
aSource->GetValueConst(&source);
|
||||
@ -353,7 +336,6 @@ nsRDFPropertyTestNode::CanPropagate(nsIRDFResource* aSource,
|
||||
this, source, property, NS_ConvertUTF16toUTF8(target).get(),
|
||||
result ? "true" : "false"));
|
||||
}
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -364,7 +346,6 @@ nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource,
|
||||
nsIRDFNode* aTarget) const
|
||||
{
|
||||
if (aProperty == mProperty.get()) {
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* source;
|
||||
aSource->GetValueConst(&source);
|
||||
@ -379,7 +360,6 @@ nsRDFPropertyTestNode::Retract(nsIRDFResource* aSource,
|
||||
("nsRDFPropertyTestNode[%p]: Retract([%s]==[%s]=>[%s])",
|
||||
this, source, property, NS_ConvertUTF16toUTF8(target).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
mProcessor->RetractElement(Element(aSource, aProperty, aTarget));
|
||||
}
|
||||
|
@ -21,15 +21,12 @@
|
||||
#include "plhash.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsXULContentUtils.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "nsRuleNetwork.h"
|
||||
#include "nsXULTemplateResultSetRDF.h"
|
||||
#include "nsRDFConMemberTestNode.h"
|
||||
|
@ -446,7 +446,6 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
||||
|
||||
nsresult rv;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
||||
("nsXULContentBuilder::BuildContentFromTemplate (is unique: %d)",
|
||||
@ -461,7 +460,6 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
||||
nsAtomCString(aResourceNode->NodeInfo()->NameAtom()).get(),
|
||||
nsAtomCString(aRealNode->NodeInfo()->NameAtom()).get(), NS_ConvertUTF16toUTF8(id).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Iterate through all of the template children, constructing
|
||||
// "real" content model nodes for each "template" child.
|
||||
@ -525,7 +523,6 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
||||
|
||||
nsIAtom *tag = tmplKid->NodeInfo()->NameAtom();
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
||||
("xultemplate[%p] building %s %s %s",
|
||||
@ -533,7 +530,6 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode,
|
||||
(isGenerationElement ? "[resource]" : ""),
|
||||
(isUnique ? "[unique]" : "")));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Set to true if the child we're trying to create now
|
||||
// already existed in the content model.
|
||||
@ -1077,7 +1073,6 @@ nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
|
||||
nsIContent** aContainer,
|
||||
int32_t* aNewIndexInContainer)
|
||||
{
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString id;
|
||||
aResult->GetId(id);
|
||||
@ -1085,7 +1080,6 @@ nsXULContentBuilder::CreateContainerContentsForQuerySet(nsIContent* aElement,
|
||||
("nsXULContentBuilder::CreateContainerContentsForQuerySet start for ref %s\n",
|
||||
NS_ConvertUTF16toUTF8(id).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (! mQueryProcessor)
|
||||
return NS_OK;
|
||||
|
@ -67,9 +67,7 @@ nsIRDFService* nsXULContentUtils::gRDF;
|
||||
nsIDateTimeFormat* nsXULContentUtils::gFormat;
|
||||
nsICollation *nsXULContentUtils::gCollation;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
#define XUL_RESOURCE(ident, uri) nsIRDFResource* nsXULContentUtils::ident
|
||||
#define XUL_LITERAL(ident, val) nsIRDFLiteral* nsXULContentUtils::ident
|
||||
|
@ -86,9 +86,7 @@ nsIScriptSecurityManager* nsXULTemplateBuilder::gScriptSecurityManager;
|
||||
nsIPrincipal* nsXULTemplateBuilder::gSystemPrincipal;
|
||||
nsIObserverService* nsXULTemplateBuilder::gObserverService;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
#define NS_QUERY_PROCESSOR_CONTRACTID_PREFIX "@mozilla.org/xul/xul-query-processor;1?name="
|
||||
|
||||
@ -167,10 +165,8 @@ nsXULTemplateBuilder::InitGlobals()
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (! gXULTemplateLog)
|
||||
gXULTemplateLog = PR_NewLogModule("nsXULTemplateBuilder");
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1714,11 +1710,9 @@ nsXULTemplateBuilder::CompileQueries()
|
||||
mFlags |= eLoggingEnabled;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
// always enable logging if the debug setting is used
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG))
|
||||
mFlags |= eLoggingEnabled;
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDOMNode> rootnode = do_QueryInterface(mRoot);
|
||||
nsresult rv =
|
||||
|
@ -26,9 +26,7 @@
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
class nsIContent;
|
||||
class nsIObserverService;
|
||||
|
@ -483,7 +483,6 @@ nsXULTemplateQueryProcessorRDF::GenerateResults(nsISupports* aDatasource,
|
||||
mLastRef = aRef;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
nsAutoString id;
|
||||
aRef->GetId(id);
|
||||
@ -499,7 +498,6 @@ nsXULTemplateQueryProcessorRDF::GenerateResults(nsISupports* aDatasource,
|
||||
NS_ConvertUTF16toUTF8(rvar).get(),
|
||||
NS_ConvertUTF16toUTF8(mvar).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (root) {
|
||||
// the seed is the initial instantiation, which has a single
|
||||
@ -865,7 +863,6 @@ nsXULTemplateQueryProcessorRDF::Propagate(nsIRDFResource* aSource,
|
||||
|
||||
ReteNodeSet livenodes;
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* sourceStr;
|
||||
aSource->GetValueConst(&sourceStr);
|
||||
@ -878,7 +875,6 @@ nsXULTemplateQueryProcessorRDF::Propagate(nsIRDFResource* aSource,
|
||||
("nsXULTemplateQueryProcessorRDF::Propagate: [%s] -> [%s] -> [%s]\n",
|
||||
sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
ReteNodeSet::Iterator last = mRDFTests.Last();
|
||||
@ -954,7 +950,6 @@ nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource,
|
||||
nsIRDFNode* aTarget)
|
||||
{
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
||||
const char* sourceStr;
|
||||
aSource->GetValueConst(&sourceStr);
|
||||
@ -967,7 +962,6 @@ nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource,
|
||||
("nsXULTemplateQueryProcessorRDF::Retract: [%s] -> [%s] -> [%s]\n",
|
||||
sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Retract any currently active rules that will no longer be matched.
|
||||
ReteNodeSet::ConstIterator lastnode = mRDFTests.Last();
|
||||
@ -1023,7 +1017,6 @@ nsXULTemplateQueryProcessorRDF::SynchronizeAll(nsIRDFResource* aSource,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsresult
|
||||
nsXULTemplateQueryProcessorRDF::Log(const char* aOperation,
|
||||
nsIRDFResource* aSource,
|
||||
@ -1060,7 +1053,6 @@ nsXULTemplateQueryProcessorRDF::Log(const char* aOperation,
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
nsXULTemplateQueryProcessorRDF::CheckContainer(nsIRDFResource* aResource,
|
||||
@ -1278,7 +1270,6 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
|
||||
rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult);
|
||||
}
|
||||
else {
|
||||
#ifdef PR_LOGGING
|
||||
nsAutoString tagstr;
|
||||
aTag->ToString(tagstr);
|
||||
|
||||
@ -1287,7 +1278,6 @@ nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
|
||||
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
||||
("xultemplate[%p] unrecognized condition test <%s>",
|
||||
this, tagstrC.get()));
|
||||
#endif
|
||||
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
@ -29,9 +29,7 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#include "prlog.h"
|
||||
#ifdef PR_LOGGING
|
||||
extern PRLogModuleInfo* gXULTemplateLog;
|
||||
#endif
|
||||
|
||||
class nsIContent;
|
||||
class nsXULTemplateResultRDF;
|
||||
@ -256,7 +254,6 @@ public:
|
||||
|
||||
nsResourceSet& ContainmentProperties() { return mContainmentProperties; }
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
nsresult
|
||||
Log(const char* aOperation,
|
||||
nsIRDFResource* aSource,
|
||||
@ -266,10 +263,6 @@ public:
|
||||
#define LOG(_op, _src, _prop, _targ) \
|
||||
Log(_op, _src, _prop, _targ)
|
||||
|
||||
#else
|
||||
#define LOG(_op, _src, _prop, _targ)
|
||||
#endif
|
||||
|
||||
protected:
|
||||
~nsXULTemplateQueryProcessorRDF();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user