Closed Bug 271386 Opened 20 years ago Closed 3 years ago

nsHttpResponseHead: Some functions can be made private...

Categories

(Core :: Networking: HTTP, defect, P5)

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: alfredkayser, Assigned: sd2187)

Details

(Keywords: good-first-bug, Whiteboard: [necko-would-take])

Attachments

(1 file)

Functions like ParseDateHeader GetDateValue, etc, are only used by nsHttpResponseHead.cpp itself, so these can be made private, which allows the compiler to further optimize these. http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpResponseHead.h#125 125 // these return failure if the header does not exist. 126 nsresult ParseDateHeader(nsHttpAtom header, PRUint32 *result); 127 nsresult GetAgeValue(PRUint32 *result); 128 nsresult GetMaxAgeValue(PRUint32 *result); 129 nsresult GetDateValue(PRUint32 *result) { return ParseDateHeader(nsHttp::Date, result); } 130 nsresult GetExpiresValue(PRUint32 *result); 131 nsresult GetLastModifiedValue(PRUint32 *result) { return ParseDateHeader(nsHttp::Last_Modified, result); }
How does marking them private improve compiler optimization? Marking them NS_HIDDEN would certainly help.
At least they will be hidden from misuse by others, and let's use NS_HIDDEN if that will help
Assignee: darin → nobody
Note that GetDateValue and GetLastModifiedValues are both 'one liners' inline defined in the class definition, so if they are private the compiler can then really inline them if the compiler wants to do so. Also GetAgeValue and GetMaxAgeValue are relatively short functions, and only used in one location, so if they are private the compiler can inline them in the code if it helps optimization. So, by just defining these as 'private' will help the compiler to do its optimization job.
Whiteboard: [necko-would-take][good first bug]
I'd like to take this one if possible.
Assignee: nobody → swlaabs
Status: NEW → ASSIGNED
Priority: -- → P5
Keywords: good-first-bug
Whiteboard: [necko-would-take][good first bug] → [necko-would-take]

This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: swlaabs → nobody
Status: ASSIGNED → NEW

Hello,
I am Somdatta and I am an outreachy applicant.I wanted to know whether this bug has been resolved or not.If not,I would like to work on it.
Thanks

While some of the functions changed slightly, the general intent seems still valuable here, IMHO. Dragana, wdyt?

Flags: needinfo?(dd.mozilla)

Please take it and ping me if you need help.

Flags: needinfo?(dd.mozilla)
Flags: needinfo?(sd2187)

Okay.I am working on it then.
One question,who should I submit a patch for review to?

Flags: needinfo?(sd2187) → needinfo?(dd.mozilla)

Please follow this guide on how to submit a patch with moz-phab. As reviewer you can put r?#necko-reviewers into the commit message. Thanks!

Flags: needinfo?(dd.mozilla)

okay

Make the following functions private because they are only used in nsHttpResponseHead.cpp for compiler optimization-
GetDateValue,GetAgeValue,GetMaxAgeValue,GetExpiresValue.
GetLastModifiedValue cannot be made private since it is being used in CachePushChecker.cpp and ParseDateHeader is already private.

Assignee: nobody → sd2187
Status: NEW → ASSIGNED
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a747b8d10c6b Make some functions private in nsHttpResponseHead r=necko-reviewers,kershaw

Just wanted to confirm..the submitted patch has been landed right?

(In reply to Somdatta from comment #15)

Just wanted to confirm..the submitted patch has been landed right?

It is not yet in central. Now automated tests and other behind the scenes verification is running. You will see a second message here once it is there.

okay

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: