Investigate if we can remove Context argument from Channel methods
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: jkt, Assigned: jkt)
References
Details
Attachments
(4 files)
With the move from AsyncOpen
and Open
having a Context
argument we should investigate if it can also be removed from OnProgress
, OnStartRequest
, OnStopRequest
, AsyncConvertData
etc
This would largely simplify code auditing given that these arguments aren't consistently passed through the code base or just dropped within some class implementations.
Example https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/dom/plugins/base/nsPluginStreamListenerPeer.cpp#357 sPluginStreamListenerPeer::OnStopRequest(
doesn't use the argument however the other implementation of this method passes it.
Other cases like TRR just pass nullptr around as it's unused, it appears from all I have seen that it was only needed when the Open methods had a context.
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D20769
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D20770
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
Hey Both,
Minus the windows fail to build and the ESLint fails that I have since fixed, it looks like this is all possible: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9ad4f6654a60200e7e27c885dc6e9e64933c5275
What do you both think, this seems totally possible and with the removal from OnDataReceived too I think the mContext member can be removed.
Kind regards
Jonathan
Comment 5•4 years ago
|
||
(In reply to Jonathan Kingston [:jkt] from comment #4)
What do you both think, this seems totally possible and with the removal from OnDataReceived too I think the mContext member can be removed.
Sounds good to me. 👍
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D20771
Assignee | ||
Comment 7•4 years ago
|
||
Ok I have managed to get a clean test run on OnStartRequest and OnEndRequest. I think soon as I get one for OnDataAvailable we should try and land due to how fast this will bitrot.
There will be a follow up task to remove it from other functions and also remove mContext from the classes themselves but I think that is much smaller anyway.
Comment 8•4 years ago
|
||
Great job with this bug! Those are some huge patches 😊
Assignee | ||
Comment 9•4 years ago
|
||
Thanks for the review! I'll land straight away before they bit-rot, hopefully we caught it all. Thanks again
Comment 10•4 years ago
|
||
Pushed by jkingston@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/84ca79bd2dc3 Removing context from OnStartRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/6d73418988d4 Removing context from OnStopRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/1d318d5c6b98 Changing js to remove context from onStartRequest and onStopRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/b73f033efb41 Removing context from OnDataAvailable r=valentin
Comment 11•4 years ago
|
||
Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=230205156&repo=autoland&lineNumber=1778
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=229928968&revision=b73f033efb41e21920b61fb97690fc3499d3f64b
Backout:
https://hg.mozilla.org/integration/autoland/rev/d5643033fdd801efda790a2836a3e196e7ba442e
Assignee | ||
Comment 12•4 years ago
|
||
The error appears to be with:
*** error running SJS at /builds/worker/workspace/build/tests/mochitest/tests/dom/base/test/send_gzip_content.sjs: [Exception... "Not enough arguments [nsIStreamListener.onDataAvailable]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: file:///builds/worker/workspace/build/tests/mochitest/tests/dom/base/test/send_gzip_content.sjs :: gzipCompressString :: line 14" data: no] on line -2516
I have tried fixing this with try by touching the CLOBBER file, changing the uuid of the interfaces I am trying the NetCID. It appears that sjs xpcshell for Android isn't being updated. Failing the NetCID change I think I will disable the test for Android as it's clearly working else it wouldn't compile and I'm pretty sure sjs isn't critical path to getting a working Android.
I spent several hours trying to hunt down anything else that might be the cause too and there really isn't anything that would change the argument number for this interface.
Final try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d7609bf3eb53a63e1e5019bb33a194e5fe17ce27
Comment 13•4 years ago
|
||
Maybe you will have to update host utilities?
https://wiki.mozilla.org/Packaging_Android_host_utilities
Assignee | ||
Comment 14•4 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1525319#c13 does sound like it is the issue, do I just request release engineering to make this change as part of the patch?
Reissuing a uuid and a clobber didn't help anyway.
Comment 15•4 years ago
|
||
I think so. Geoff, can you help with updating hostutils?
![]() |
||
Comment 16•4 years ago
|
||
:aerickson is taking care of host-utils updates now.
Updated•4 years ago
|
Comment 17•4 years ago
|
||
OK, I'll update hostutils. I've created https://bugzilla.mozilla.org/show_bug.cgi?id=1530546 for tracking.
Assignee | ||
Comment 18•4 years ago
|
||
Does this happen before this patch lands or after? Sorry I'm not familiar with the build process here.
Comment 19•4 years ago
|
||
The version of hostutils used for builds/tests is stored in manifest files inside the repo. We build a new version, make a review with the new versions, test it, then land it. Once landed, you should rebase and then your code will use the new version of hostutils.
Assignee | ||
Comment 20•4 years ago
|
||
I perhaps don't understand enough about host utils but I would expect them to break in a different way if they have a different function signature that the current mozilla-central. Are you building Bug 1530546 with this patch included?
Comment 21•4 years ago
|
||
Sorry, I was confused (I thought this was a simple update request).
I need all 4 patches?
Assignee | ||
Comment 22•4 years ago
|
||
Ideally however the only notable issue I saw was with the OnDataAvailable patch (which changes the number of call arguments). Perhaps the other methods don't have test coverage.
The failing test was dom/base/test/test_progress_events_for_gzip_data.html and the error that is causing it is:
*** error running SJS at /builds/worker/workspace/build/tests/mochitest/tests/dom/base/test/send_gzip_content.sjs: [Exception... "Not enough arguments [nsIStreamListener.onDataAvailable]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: file:///builds/worker/workspace/build/tests/mochitest/tests/dom/base/test/send_gzip_content.sjs :: gzipCompressString :: line 14" data: no] on line -2516
However if it's not landed at the same time I doubt tests will be happy with the update also. Any ideas on how to land these together?
Comment 23•4 years ago
|
||
I'm not familiar with any way of ensuring they all land together other than making all of the changes in the same commit (but I'm pretty new).
I'll share a diff with the new hostutils manifests when I'm done so you can add them to your diff.
Assignee | ||
Comment 24•4 years ago
|
||
If you add them to your bug and get them reviewed I will try and find someone to land them at the same time tomorrow. Thanks!
Assignee | ||
Comment 25•4 years ago
|
||
:gbrown is there an ordering of the landing of these patches we need to take care of? Should I disable the failing test in this bug so the host utils can be updated and the test re-enabled again?
![]() |
||
Comment 26•4 years ago
|
||
I think the landing is working out okay. Andrew will update the Linux host-utils, then you can land this bug, then Andrew will update the osx host-utils. The osx host-utils don't affect continuous integration, so the only consequence of the time lag will be that anyone running Android tests on their osx laptop would see the affected tests fail (probably no one will notice).
Updated•4 years ago
|
![]() |
||
Comment 27•4 years ago
|
||
jkt -- Sorry, I misunderstood the scope of Andrew's try push, so thought everything was working out okay, but it didn't. As you expected, your changes in this bug can't land before the hostutils update and the hostutils update can't land before your changes. If you can arrange to land all changes together, that should be fine. Or you could disable the failing test, land, then re-enable (as you suggested earlier!).
Assignee | ||
Comment 28•4 years ago
|
||
Queued the landing with the test disabled, if it sticks then we can renable after hostutils has been updated. I appreciate you both looking into this!
Thanks!
Comment 29•4 years ago
|
||
Pushed by jkingston@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b5f7ff4ca9b5 Removing context from OnStartRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/c48f47f793c0 Removing context from OnStopRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/2f665c88b0c8 Changing js to remove context from onStartRequest and onStopRequest r=valentin https://hg.mozilla.org/integration/autoland/rev/20fcf9d9494a Removing context from OnDataAvailable r=valentin
Comment 30•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b5f7ff4ca9b5
https://hg.mozilla.org/mozilla-central/rev/c48f47f793c0
https://hg.mozilla.org/mozilla-central/rev/2f665c88b0c8
https://hg.mozilla.org/mozilla-central/rev/20fcf9d9494a
Updated•4 years ago
|
Description
•