| CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
script: Have FetchResponseListener::process_response_eof consume the listener
#40556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e listener The goal of this change is to prevent having to copy so much data out of listeners when a fetch completes, which will be particularly important for off-the-main thread parsing of CSS (see servo#22478). This change has pros and cons: Pros: - This makes the design of the `FetchResponseListener` a great deal simpler. They no longer individually store a dummy `ResourceFetchTiming` that is only replaced right before `process_response_eof`. - The creation of the `Arc<Mutex<FetchResponseListener>>` in the `NetworkListener` is abstracted away from clients and now they just pass the `FetchResponseListener` to the fetch methods in the global. Cons: - Now each `FetchResponseListener` must explicitly call `submit_timing` instead of having the `NetworkListener` do it. This is arguably a bit easier to follow in the code. - Since the internal data of the `NetworkListener` is now an `Arc<Mutex<Option<FetchResponseListener>>>`, when the fetching code needs to share state with the `NetworkListener` it either needs to share an `Option` or some sort of internal state. In one case I've stored the `Option` and in another case, I've stored a new inner shared value. Signed-off-by: Martin Robinson <mrobinson@igalia.com> ste#
|
I like the cleanup. The timing call is unfortunate, so let's try to see if that's unnecessary? Maybe we can return If it's not possible, then I do think your solution is superior to the current state. |
Yeah, unfortunately the goal here is that |
TimvdLippe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a step in the right direction
|
I've had to post a modification to this change which does two things:
|
|
🔨 Triggering try run (#19270503294) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19270503294): Flaky unexpected result (36)
Stable unexpected results that are known to be intermittent (31)
Stable unexpected results (1)
|
|
|
1a9da60 to
f8b19f4
Compare
|
This seems to have fixed an issue with resource timing tests due to the fact that the resource timing is now set before events are fired. This is possible because now the |
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
f8b19f4 to
e4ab12f
Compare
|
Hrm. It seems that these changes had too many side effects on the resource timing code so I have made another attempt to preserve the old behavior (which was also wrong, it seems). |
The goal of this change is to prevent having to copy so much data out of
listeners when a fetch completes, which will be particularly important
for off-the-main thread parsing of CSS (see #22478). This change has
pros and cons:
Pros:
FetchResponseListenera great deal simpler.They no longer individually store a dummy
ResourceFetchTimingthat isonly replaced right before
process_response_eof.Arc<Mutex<FetchResponseListener>>in theNetworkListeneris abstracted away from clients and now they justpass the
FetchResponseListenerto the fetch methods in the global.Cons:
FetchResponseListenermust explicitly callsubmit_timinginstead of having the
NetworkListenerdo it. This is arguably a biteasier to follow in the code.
NetworkListeneris now anArc<Mutex<Option<FetchResponseListener>>>, when the fetching codeneeds to share state with the
NetworkListenerit either needs toshare an
Optionor some sort of internal state. In one case I'vestored the
Optionand in another case, I've stored a new innershared value.
Testing: This should not change observable behavior and is thus covered by existing tests.
Fixes: #22550