Closed Bug 1432403 Opened 7 years ago Closed 7 years ago

Remove PlacesUtils._uri

Categories

(Toolkit :: Places, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: standard8, Assigned: hemantsingh1612, Mentored)

References

()

Details

(Keywords: good-first-bug, Whiteboard: [fxsearch][lang=js])

Attachments

(1 file)

PlacesUtils._uri is a wrapper function around NetUtil.newURI. We should drop the wrapper function and just call NetUtil.newURI direct.
Note: probably best to wait for bug 1131491 to land first, since that removes some of the usages of it.
Depends on: 1131491
Keywords: good-first-bug
Whiteboard: [fxsearch] → [fxsearch][lang=js]
(In reply to Mark Banner (:standard8) from comment #0) > and just call NetUtil.newURI direct. Actually, we should use Services.io.newURI, unless we think we may be needing an nsIFileURI. NetUtil.newURI should indeed be avoided if that allows to avoid the NetUtil import.
I can see `NetUtil` is a javascript module, & it communicates with an interface `nsIIOService` which is defined in `@mozilla.org/network/io-service;1"`(contract). This should be providing networking capabilities .Am I right !
The point here is that NetUtil.newURI is only necessary when the expected uri could be either an nsIURI or an nsIFileURI, indeed it can generate both starting from the string. In Places case, 99% of the call points just want an nsIURI, thus NetUtil is not necessary. We can instead use Services.io.newURI. By looking at the code search I'm linking, I think all of those call points just want Services.io.newURI
(In reply to Marco Bonardo [::mak] from comment #4) > The point here is that NetUtil.newURI is only necessary when the expected > uri could be either an nsIURI or an nsIFileURI, indeed ihttps://bugzilla.mozilla.org/show_bug.cgi?id=1432403#c4t can generate both > starting from the string. > In Places case, 99% of the call points just want an nsIURI, thus NetUtil is > not necessary. We can instead use Services.io.newURI. > By looking at the code search I'm linking, I think all of those call points > just want Services.io.newURI Thanks. This was helpful.I will submit a patch soon.
Comment on attachment 8948358 [details] Bug 1432403 - Remove PlacesUtils._uri https://reviewboard.mozilla.org/r/217834/#review223840 This is looking great, however please can you also remove the actual `_uri` function in PlacesUtils that is no longer used.
Attachment #8948358 - Flags: review?(standard8)
Assignee: nobody → hemantsingh1612
Comment on attachment 8948358 [details] Bug 1432403 - Remove PlacesUtils._uri https://reviewboard.mozilla.org/r/217834/#review223890 Thanks, looks good, nice to get this cleaned up. r=Standard8
Attachment #8948358 - Flags: review?(standard8) → review+
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: