Closed
Bug 1273712
Opened 8 years ago
Closed 8 years ago
Clean up Base64.{h,cpp}
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(2 files)
15.54 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
4.06 KB,
patch
|
erahm
:
review+
|
Details | Diff | Splinter Review |
I want to add a variant of Base64Encode() that will help fix bug 1273711. I'll also do some clean-up while I'm here.
Assignee | ||
Comment 1•8 years ago
|
||
The argument naming in Base64.{h,cpp} is horribly confused, with a lot of them gotten backwards. This patch fixes that, and also introduces a more consistent naming scheme for arguments and local variables: "binary" is used for binary data, and "base64" is used for base64-encoded data. This patch doesn't change any functionality.
Attachment #8753611 -
Flags: review?(erahm)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
This will be used in bug 1273711 to avoid an OOM. This also tweaks one of the existing overloadings of Base64Encode to return NS_ERROR_OUT_OF_MEMORY on OOM instead of NS_ERROR_INVALID_ARG.
Attachment #8753616 -
Flags: review?(erahm)
Comment 3•8 years ago
|
||
Comment on attachment 8753611 [details] [diff] [review] (part 1) - Rename arguments and variables in Base64.{h,cpp} Review of attachment 8753611 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for cleaning this up, it's much easier to follow now. ::: xpcom/io/Base64.cpp @@ -320,1 @@ > { Everything about this function makes me sad.
Attachment #8753611 -
Flags: review?(erahm) → review+
Comment 4•8 years ago
|
||
Comment on attachment 8753616 [details] [diff] [review] (part 2) - Add a new overloading of Base64Encode() Review of attachment 8753616 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, one suggestion. ::: xpcom/io/Base64.h @@ +24,5 @@ > uint32_t aCount, > uint32_t aOffset = 0); > > nsresult > +Base64Encode(const char* aBinary, uint32_t aBinaryLen, char** aBase64); Seems like we'd want to mark this as MUST_USE_RESULT or whatever it's called (probably the rest too, but that could be a follow up).
Attachment #8753616 -
Flags: review?(erahm) → review+
Assignee | ||
Comment 5•8 years ago
|
||
> Seems like we'd want to mark this as MUST_USE_RESULT or whatever it's called
> (probably the rest too, but that could be a follow up).
I tried that and there were missing checks. So, yes, follow-up! And thank you for reminding me to revisit that.
Assignee | ||
Comment 6•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e1e0b4154188baf39fddd20d7efcd00d1cf39cc Bug 1273712 (part 1) - Rename arguments and variables in Base64.{h,cpp}. r=erahm. https://hg.mozilla.org/integration/mozilla-inbound/rev/02dea57c6c0fa53dbd0752b3003b796d56f6b485 Bug 1273712 (part 2) - Add a new overloading of Base64Encode(). r=erahm.
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1e1e0b415418 https://hg.mozilla.org/mozilla-central/rev/02dea57c6c0f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•