Closed
Bug 1432403
Opened 7 years ago
Closed 7 years ago
Remove PlacesUtils._uri
Categories
(Toolkit :: Places, enhancement, P3)
Toolkit
Places
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.
Reporter | ||
Comment 1•7 years ago
|
||
Note: probably best to wait for bug 1131491 to land first, since that removes some of the usages of it.
Comment 2•7 years ago
|
||
(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.
Assignee | ||
Comment 3•7 years ago
|
||
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 !
Comment 4•7 years ago
|
||
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
Assignee | ||
Comment 5•7 years ago
|
||
(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 hidden (mozreview-request) |
Reporter | ||
Comment 7•7 years ago
|
||
mozreview-review |
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)
Reporter | ||
Updated•7 years ago
|
Assignee: nobody → hemantsingh1612
Comment hidden (mozreview-request) |
Reporter | ||
Comment 9•7 years ago
|
||
mozreview-review |
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+
Comment 10•7 years ago
|
||
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/963786109ed2
Remove PlacesUtils._uri r=standard8
Updated•7 years ago
|
Comment 11•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•