Closed Bug 1163118 Opened 8 years ago Closed 8 years ago

Cache User Agent detection during app startup

Categories

(Firefox for iOS :: General, defect)

Other
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fennec + ---

People

(Reporter: st3fan, Assigned: fluffyemily, Mentored)

References

Details

(Whiteboard: [good first bug][lang=swift])

Attachments

(1 file)

47 bytes, text/x-github-pull-request
st3fan
: review+
Details | Review
Suggestion to shave of ~ 90ms

Every time at app startup we create a UIWebView to get the User Agent and then modify it to include our own unique string. This is an expensive operation. We can assume that the User Agent only changes as part of an iOS upgrade so we should remember the current iOS version and user agent, compare the iOS version and skip the UIWebView creation if it is the same.
Mentor: sarentz
Whiteboard: [good first bug][lang=swift]
Assignee: nobody → sleroux
tracking-fennec: ? → +
Would this be a good bug to save for Karim to work on?
We'll let emily get her feet wet with this.
Assignee: sleroux → etoop
Attached file Pull request
Attachment #8611230 - Flags: review?(sarentz)
Comment on attachment 8611230 [details] [review]
Pull request

LGTM - Keep picking up Swift idioms. The most important for stable code are `if et`, optionals, try to never use `!`. And no more semicolons :-)
Attachment #8611230 - Flags: review?(sarentz) → review+
https://github.com/mozilla/firefox-ios/commit/d7b1c0494fa72c689154bccfcd98915752bff559
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.