Add hasUserPass attribute to nsIURI
Categories
(Core :: Networking, enhancement, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox121 | --- | fixed |
People
(Reporter: daisuke, Assigned: daisuke)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files)
This bug is a spin-off of bug 130327.
In the bug 130327, we will remove the user and pass from the URL for Places Histories and Favicons using nsIOService::CreateExposableURI(), store them to the database. And, for Favicons, we will also read them.
Therefore, as the frequency of calling CreateExposableURI() will be higher, we want to optimize it.
Currently, CreateExposableURI() gets/copies the String of UserPass to check whether there is user and pass in the URL, and its copying is waste. To prevent it, implement hasUserPass in nsIURI, and refer to it instead.
Also, use hasUserPass instead of user and password which are only used to check if there is user pass in the URL.
- https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/netwerk/base/nsIOService.cpp#1021-1023
- https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/dom/xhr/XMLHttpRequestMainThread.cpp#3798-3815
- https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/netwerk/base/nsNetUtil.cpp#3401-3408
- https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp#1217-1227
- https://searchfox.org/mozilla-central/source/devtools/client/shared/vendor/whatwg-url.js#2337
- https://searchfox.org/mozilla-central/rev/21001eee69767de5db95952154d49f01b72318ba/devtools/client/shared/vendor/whatwg-url.js#1653
| Assignee | ||
Comment 1•2 years ago
|
||
Looks like whatwg-urll.js on DevTools was introduced from https://github.com/jsdom/whatwg-url and it defined own URL. So, it seems that we don' have to change it.
| Assignee | ||
Comment 2•2 years ago
|
||
We will remove the user and pass from the URL for Histories and Favicons using
nsIOService::CreateExposableURI()[1], then store them to the database. And, for
Favicons. And, for Favicons, we will also read them. Therefore, as the
frequency calling CreateExposableURI() will be higher, we want to optimize it.
Currently, CreateExposableURI() gets/copies the String of UserPass to check whether there is a user pass info in the URL[2]. Its copying will be waste. To
prevent it, implement hasUserPass in nsIURI, and refer to it instead.
[1] https://searchfox.org/mozilla-central/rev/90dce6b0223b4dc17bb10f1125b44f70951585f9/netwerk/base/nsIOService.cpp#1031
[2] https://searchfox.org/mozilla-central/rev/90dce6b0223b4dc17bb10f1125b44f70951585f9/netwerk/base/nsIOService.cpp#1017
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D193623
Updated•2 years ago
|
Comment 5•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/10a60139ccb5
https://hg.mozilla.org/mozilla-central/rev/47a07f8f9794
Description
•