Remove usage of |#ifdef PR_LOGGING| from dom/security

RESOLVED FIXED in Firefox 41

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: erahm, Assigned: erahm)

Tracking

Trunk
mozilla41
Points:
---

Firefox Tracking Flags

(firefox40 affected, firefox41 fixed)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

4 years ago
In bug 1161238 we plan on removing |--disable-logging| which makes |#ifdef PR_LOGGING| redundant.
(Assignee)

Comment 1

4 years ago
Created attachment 8603643 [details] [diff] [review]
Part 1: Remove instances of #ifdef PR_LOGGING in dom/security

PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
Attachment #8603643 - Flags: review?(nfroyd)
(Assignee)

Updated

4 years ago
Assignee: nobody → erahm
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
Created attachment 8603644 [details] [diff] [review]
Part 1: Remove instances of #ifdef PR_LOGGING in dom/security

PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
Attachment #8603644 - Flags: review?(nfroyd)
(Assignee)

Updated

4 years ago
Attachment #8603643 - Attachment is obsolete: true
Attachment #8603643 - Flags: review?(nfroyd)
(Assignee)

Comment 3

4 years ago
Created attachment 8603645 [details] [diff] [review]
Part 2:  Wrap expensive calls in PR_LOG_TEST

Check that logging is enabled before performing potentially expensive
operations.
Attachment #8603645 - Flags: review?(nfroyd)
Attachment #8603644 - Flags: review?(nfroyd) → review+
Comment on attachment 8603645 [details] [diff] [review]
Part 2:  Wrap expensive calls in PR_LOG_TEST

Review of attachment 8603645 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/security/nsCSPContext.cpp
@@ +51,5 @@
>    return gCspContextPRLog;
>  }
>  
>  #define CSPCONTEXTLOG(args) PR_LOG(GetCspContextLog(), 4, args)
> +#define CSPCONTEXTLOGENABLED() PR_LOG_TEST(GetCspContextLog(), 4)

Uh.  While we're here, can we replace '4' with the actual constant (PR_LOG_DEBUG, maybe?) ?  And so on throughout the patch.
Attachment #8603645 - Flags: review?(nfroyd) → review+
(Assignee)

Comment 6

4 years ago
(In reply to Nathan Froyd [:froydnj] [:nfroyd] from comment #5)
> Comment on attachment 8603645 [details] [diff] [review]
> Part 2:  Wrap expensive calls in PR_LOG_TEST
> 
> Review of attachment 8603645 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/security/nsCSPContext.cpp
> @@ +51,5 @@
> >    return gCspContextPRLog;
> >  }
> >  
> >  #define CSPCONTEXTLOG(args) PR_LOG(GetCspContextLog(), 4, args)
> > +#define CSPCONTEXTLOGENABLED() PR_LOG_TEST(GetCspContextLog(), 4)
> 
> Uh.  While we're here, can we replace '4' with the actual constant
> (PR_LOG_DEBUG, maybe?) ?  And so on throughout the patch.

Hah, I was trying to avoid some blame :) I'll do a separate patch for that.
(Assignee)

Comment 7

4 years ago
Actually I'll just update before I push, I thought this was a different offender.
https://hg.mozilla.org/mozilla-central/rev/e24aa2dd0e9a
https://hg.mozilla.org/mozilla-central/rev/f86c4ccf1d17
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.