Open Bug 1829892 Opened 2 years ago Updated 2 months ago

Use a dedicated CookieNowTime class to pass PR_Now() instead of int64_t

Categories

(Core :: Networking: Cookies, task, P2)

task

Tracking

()

People

(Reporter: valentin, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

It became apparent in bug 1827669 that we may inadvertently pass the wrong int64_t value where methods expect PR_Now() to be passed.

Having a dedicated class that can't be changed would be much better:

class CookieNowTime {
 public:
  CookieNowTime(): mCurrentTime(PR_Now()) {}
  operator int64_t() const { return mCurrentTime; }

 private:
  const int64_t mCurrentTime;
};
Blocks: 1932650
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: