Hi Alex, On Fri, Aug 28, 2020 at 11:45 AM Shuo Xiang <shuo.xi...@gmail.com> wrote:
> Dear mozilla.dev.builds: > > Recently I have been doing some experimentation with a private build of > Firefox running on my Ubuntu 19.10. However I seem to have hit a bit of a > stumbling block while I am trying to hack the Init method of the > HttpBaseChannel class (mozilla-unified/netwerk/protocol/http). > > The Init method is passed the parameter nsIURI* aURI, which is then > assigned to both mURI and mOriginalURI. Consulting with the Mozilla > interface documentation I've learned about nsIURI's "host" and "asciiHost" > attributes. However, I do not seem to be able to modify these attributes as > they seem to be read-only. I attempted to use "SetHost" or "SetAsciiHost" > but these do not seem to exist. (The "GetAsciiHost" on the other hand does > exist). > > So I attempted to construct a new nsIURI object from right within the Init > code, however, repeated attempts to construct a new nsIURI object are met > with compiler errors about attempting to initialize an abstract class. > You can take your nsIURI and call `.mutate()` to get a mutator that can be then `.finalize()`-d into a concrete class: see https://searchfox.org/mozilla-central/rev/d54712b9644b49cec6cc90a9e0c325fdfab04e7c/netwerk/base/nsIURI.idl#312-318 . It's my understanding that this can be done safely on any thread now, whereas in the past this had to be done on the main thread. Somebody correct me if I'm wrong! > I am at my wit's end and so have come to this newsgroup for some help from > you. If this is not the most appropriate newsgroup please let me know what > would be an appropriate newsgroup for me to make this post. > This is more appropriate for dev-platform, so I've CCed it there, and moved dev-builds to the BCC list. In general you may get more help with these types of questions asking in #developers on Matrix: https://chat.mozilla.org/#/room/#developers:mozilla.org. Nick _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform