Closed Bug 745396 Opened 13 years ago Closed 13 years ago

Refactor utils functions into {Common,Crypto}Utils

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: gps, Assigned: gps)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Attached patch Refactor utility functions, v1 (deleted) — Splinter Review
Moved a lot of code out of Util and into CommonUtils and a newly-created CryptoUtils. Installed proxies in the old Util so existing code doesn't need to be updated (that would make an obvious follow-up bug). I made some minor style changes along the way. Some functions could still use a lot of love though (again, a good follow-up bug). This isn't strictly required for AITC. But, there was a resource://services-sync/util.js reference for HTTP MAC that I didn't want to see. That required moving all the HMAC functions over. At that point, I went all in and moved all the crypto functions. I stopped short of getting rid of Svc.Crypto b/c I didn't want to touch record.js (or anything outside of the /utils?\.js/ files. The tests: they all pass!
Attachment #614983 - Flags: review?(rnewman)
Blocks: 745424
Hmm, perhaps it would be easier to roll in encodeBase64url from Utils to CommonUtils in this bug? Then we wouldn't need bug 745425 anymore.
Comment on attachment 614983 [details] [diff] [review] Refactor utility functions, v1 Review of attachment 614983 [details] [diff] [review]: ----------------------------------------------------------------- This looks good to me, albeit with a cursory review only. ::: services/common/utils.js @@ +141,5 @@ > } > }, > > + byteArrayToString: function byteArrayToString(bytes) { > + return [String.fromCharCode(byte) for each (byte in bytes)].join(""); Ugh.
Attachment #614983 - Flags: review?(rnewman) → review+
Assignee: nobody → gps
Whiteboard: [fixed in services]
[qa-] but I'll smoketest Sync to be certain nothing is broken.
Whiteboard: [fixed in services] → [fixed in services][qa-]
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in services][qa-] → [qa-]
Target Milestone: --- → mozilla15
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: