Closed Bug 384225 Opened 18 years ago Closed 18 years ago

remove nsInt64 usage from cookies

Categories

(Core :: Networking: Cookies, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dwitte, Assigned: dwitte)

Details

Attachments

(1 file, 2 obsolete files)

nsInt64 is deprecated, so we can switch back to plain ol' PRInt64/PRUint64 here.
Attached patch patch v1 (obsolete) — Splinter Review
lots of simple one-line changes. removes usages of nsInt64, and also tweaks some API's to use PRUint64 instead of PRInt64 where appropriate.
Attachment #268212 - Flags: superreview?(cbiesinger)
Attachment #268212 - Flags: review?(cbiesinger)
Attached patch patch v1 supplement (obsolete) — Splinter Review
whoops, missed an instance.
Attachment #268213 - Flags: superreview?(cbiesinger)
Attachment #268213 - Flags: review?(cbiesinger)
Comment on attachment 268212 [details] [diff] [review] patch v1 shouldn't expiry allow negative values so that it can handle servers that send a pre-1970 date?
you're right, that was an oversight. for some reason i thought PRTime was a PRUint64, but it's signed, so we could get negative values. new patch coming in a few hours.
Attachment #268212 - Flags: superreview?(cbiesinger)
Attachment #268212 - Flags: review?(cbiesinger)
Attachment #268213 - Flags: superreview?(cbiesinger)
Attachment #268213 - Flags: review?(cbiesinger)
Attached patch v2Splinter Review
back to PRInt64.
Attachment #268212 - Attachment is obsolete: true
Attachment #268213 - Attachment is obsolete: true
Attachment #268705 - Flags: superreview?(cbiesinger)
Attachment #268705 - Flags: review?(cbiesinger)
Comment on attachment 268705 [details] [diff] [review] v2 netwerk/cookie/public/nsICookie.idl + * @status DEPRECATED - see nsICookie2.expiry. Doxygen has an @deprecated command, which is probably more appropriate here (http://www.stack.nl/~dimitri/doxygen/commands.html#cmddeprecated) netwerk/cookie/src/nsCookieService.cpp - const PRBool newCookie = ParseAttributes(aCookieHeader, cookieAttributes); + PRBool newCookie = ParseAttributes(aCookieHeader, cookieAttributes); why remove the const? - const nsInt64 currentTimeInUsec = NOW_IN_MICROSECONDS; + PRInt64 currentTimeInUsec = PR_Now(); here too
Attachment #268705 - Flags: superreview?(cbiesinger)
Attachment #268705 - Flags: superreview+
Attachment #268705 - Flags: review?(cbiesinger)
Attachment #268705 - Flags: review+
btw, why does some of this code use PRTime values (µsec), while other code uses seconds since 1970?
neat; i'll use the @deprecated instead. re the const, it looked a little weird to me, and any compiler worth its salt will realize it's not modified after assignment anyway. re usec vs sec, expiry is stored as seconds (by convention). creationtime was introduced (actually it's still future tense, since i haven't checked it in yet) with the storage work, and is stored as microseconds. this is because it doubles as a unique id for each cookie in the database, so usec is more appropriate since it's more likely to be unique. (note that we do check for collisions in order to guarantee that.) so it's a little confusing that we use sec and usec, but i've tried to make it clearer in the code, by naming variables either |currentTime| or |currentTimeInUsec| :/ thanks biesi!
fixed on trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: