--
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CACPC1r7z0ExsVT8boSxZ083HmeGdRHbp2GyWCh7VV2ea%2BD%2BzZA%40mail.gmail.com.
Would it make sense to just suppress the DidCommit to the browser? Or is this additional call significant for updating some state on the browser side?
Thanks Rakina!
From the browser process point of view, when receiving a blank 404 page. It sends CommitNavigation and receives DidCommitNavigation as usual. Later blink replaces the blank document by a sort of error page and sends a second DidCommitNavigation.The browser process usually kills the renderer when receiving this unexpected DidCommitNavigation. However we allow this edge case for now in DidCommitNavigationInternal.```// 3) Error pages implementations in Chrome can commit twice.// TODO(clamy): Fix this.``` This would be a huge win removing it!Would it make sense to just suppress the DidCommit to the browser? Or is this additional call significant for updating some state on the browser side?~DanielThis looks appealing. However, the DidCommit tells the browser the current document in the renderer has changed its origin.
It also has the side effect of changing the address-bar indicator. See:Ideally, in a not so far future, we would compute the origin of the document to commit, before sending CommitNavigation. We can then better decide what kind of URLLoaderFactories / capabilities are given to the document.
---I think I am leaning toward either:
1) On 4XX status code, the browser starts reading the response_body and decides depending on its size if it should commit an error page or continue with the normal page sent by the server.
2) Blink commits the normal page (as it does today), but instead of sending a second DidCommit, it requests the browser process to navigate to a "real" error page.(2) is probably way easier than (1).
I think I am leaning toward either:1) On 4XX status code, the browser starts reading the response_body and decides depending on its size if it should commit an error page or continue with the normal page sent by the server.
2) Blink commits the normal page (as it does today), but instead of sending a second DidCommit, it requests the browser process to navigate to a "real" error page.(2) is probably way easier than (1).Is my understanding correct that (2) corresponds to proposal #1 in the doc, "Send the commit to the browser", where we will keep the empty page, and then ask the browser to commit a chrome error page?Or do you mean for (2) it should "commit" the chrome error page, but should not send a DidCommit call to the browser and instead it will create a new navigation request for the chrome error page?
This would not have the additional round trip delay of showing the final error page like the proposal in the doc, so it does sound interesting.
However, doesn't this pose the same problems as not sending DidCommit at all (although just for a few moments before the browser gets updated I guess), and maybe additional inconsistencies between browser and renderer for that brief period?
Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.
Also from this RFC it seems like Content-Length might not always be there (it's only required for requests). Do you have other info on this?
On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.
Also from this RFC it seems like Content-Length might not always be there (it's only required for requests). Do you have other info on this?Yes, it is not a required field. Maybe we should see if we have any metrics on its usage in practice? I would suspect someone on Chrome has experience in this area, but I'm not sure who that would be.On Sat, Sep 26, 2020 at 2:17 AM Nasko Oskov <na...@chromium.org> wrote:On Fri, Sep 25, 2020 at 3:11 AM Arthur Sonzogni <arthurs...@google.com> wrote:I think I am leaning toward either:1) On 4XX status code, the browser starts reading the response_body and decides depending on its size if it should commit an error page or continue with the normal page sent by the server.
2) Blink commits the normal page (as it does today), but instead of sending a second DidCommit, it requests the browser process to navigate to a "real" error page.(2) is probably way easier than (1).Is my understanding correct that (2) corresponds to proposal #1 in the doc, "Send the commit to the browser", where we will keep the empty page, and then ask the browser to commit a chrome error page?Or do you mean for (2) it should "commit" the chrome error page, but should not send a DidCommit call to the browser and instead it will create a new navigation request for the chrome error page?Yes, sorry, I reversed the order.This would not have the additional round trip delay of showing the final error page like the proposal in the doc, so it does sound interesting.However, doesn't this pose the same problems as not sending DidCommit at all (although just for a few moments before the browser gets updated I guess), and maybe additional inconsistencies between browser and renderer for that brief period?
Yes they both have their pro/cons. I am not quite sure which one is the best. I was a bit reluctant to implement something new in the NavigationRequest (reading the response_body on 4XX) and was thinking it might be easier to rely on what we already have (submitting new navigations).
Maybe reading the response_body on 4XX isn't that hard. This avoids committing the empty 404 document before the chrome 404 document.Does it actually require reading the response body? Can't we rely on the Content-Length: header, which should be available? This should allow us to know that we need to commit a Chrome error page instead of what the server sent at ReadyToCommit time and adjust accordingly.
--
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAA%3DmyAvcg7W2UOkkzDXK-58AXk1wsK3u717ZzobcYwe%3D-2mRNg%40mail.gmail.com.
Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?
On Mon, Sep 28, 2020 at 11:32 AM Matt Falkenhagen <fal...@chromium.org> wrote:Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?If we don't show the error page, we will show a blank page, which is probably bad UX (see original bug). We can definitely try to measure how often error pages with incorrect/non-existent content-length show up, but I'm wondering how comfortable are we with missing these cases?Also, how long should we gather the data for (weeks? months?). If we need a long time to be confident we've captured enough data, I'm wondering if it's better to do this in parallel with implementing the simpler proposal (to unblock the current work) and change it later if the data shows we can rely on Content-Length most of the time.
2020年9月28日(月) 22:28 Rakina Zata Amni <rak...@chromium.org>:On Mon, Sep 28, 2020 at 11:32 AM Matt Falkenhagen <fal...@chromium.org> wrote:Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?If we don't show the error page, we will show a blank page, which is probably bad UX (see original bug). We can definitely try to measure how often error pages with incorrect/non-existent content-length show up, but I'm wondering how comfortable are we with missing these cases?Also, how long should we gather the data for (weeks? months?). If we need a long time to be confident we've captured enough data, I'm wondering if it's better to do this in parallel with implementing the simpler proposal (to unblock the current work) and change it later if the data shows we can rely on Content-Length most of the time.
Thanks I see. Agree we don't want to show the blank page. I also agree with doing the simpler proposal and not over-engineering this though it's not really clear which one is simpler, is that Proposal #1 in your doc?I think I had an idea similar to dcheng's at the top of this thread. Would it be possible for the renderer to just not send the initial DidCommit ACK until it knows whether it wants to commit the error page or not? And if it turns out it wants the browser to navigate to another error page, it tells the browser that as part of the NavigationCommit callback / in place of DidCommit?
2020年9月28日(月) 22:28 Rakina Zata Amni <rak...@chromium.org>:On Mon, Sep 28, 2020 at 11:32 AM Matt Falkenhagen <fal...@chromium.org> wrote:Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?If we don't show the error page, we will show a blank page, which is probably bad UX (see original bug). We can definitely try to measure how often error pages with incorrect/non-existent content-length show up, but I'm wondering how comfortable are we with missing these cases?Also, how long should we gather the data for (weeks? months?). If we need a long time to be confident we've captured enough data, I'm wondering if it's better to do this in parallel with implementing the simpler proposal (to unblock the current work) and change it later if the data shows we can rely on Content-Length most of the time.Thanks I see. Agree we don't want to show the blank page. I also agree with doing the simpler proposal and not over-engineering this though it's not really clear which one is simpler, is that Proposal #1 in your doc?I think I had an idea similar to dcheng's at the top of this thread. Would it be possible for the renderer to just not send the initial DidCommit ACK until it knows whether it wants to commit the error page or not? And if it turns out it wants the browser to navigate to another error page, it tells the browser that as part of the NavigationCommit callback / in place of DidCommit?
On Mon, 28 Sep 2020 at 22:59, Matt Falkenhagen <fal...@chromium.org> wrote:2020年9月28日(月) 22:28 Rakina Zata Amni <rak...@chromium.org>:On Mon, Sep 28, 2020 at 11:32 AM Matt Falkenhagen <fal...@chromium.org> wrote:Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?If we don't show the error page, we will show a blank page, which is probably bad UX (see original bug). We can definitely try to measure how often error pages with incorrect/non-existent content-length show up, but I'm wondering how comfortable are we with missing these cases?Also, how long should we gather the data for (weeks? months?). If we need a long time to be confident we've captured enough data, I'm wondering if it's better to do this in parallel with implementing the simpler proposal (to unblock the current work) and change it later if the data shows we can rely on Content-Length most of the time.Thanks I see. Agree we don't want to show the blank page. I also agree with doing the simpler proposal and not over-engineering this though it's not really clear which one is simpler, is that Proposal #1 in your doc?I think I had an idea similar to dcheng's at the top of this thread. Would it be possible for the renderer to just not send the initial DidCommit ACK until it knows whether it wants to commit the error page or not? And if it turns out it wants the browser to navigate to another error page, it tells the browser that as part of the NavigationCommit callback / in place of DidCommit?We are trying to get rid of the browser's dependence on the callback and make it so that the browser can swap render frames and finish committing as soon as it sends the commit. So having it just do a renderer-initiated navigation would be compatible with that but I worry that it would be more complicated to commit a blank page and then navigate again to a error page,
--F--Also from this RFC it seems like Content-Length might not always be there (it's only required for requests). Do you have other info on this?Yes, it is not a required field. Maybe we should see if we have any metrics on its usage in practice? I would suspect someone on Chrome has experience in this area, but I'm not sure who that would be.On Sat, Sep 26, 2020 at 2:17 AM Nasko Oskov <na...@chromium.org> wrote:On Fri, Sep 25, 2020 at 3:11 AM Arthur Sonzogni <arthurs...@google.com> wrote:I think I am leaning toward either:1) On 4XX status code, the browser starts reading the response_body and decides depending on its size if it should commit an error page or continue with the normal page sent by the server.
2) Blink commits the normal page (as it does today), but instead of sending a second DidCommit, it requests the browser process to navigate to a "real" error page.(2) is probably way easier than (1).Is my understanding correct that (2) corresponds to proposal #1 in the doc, "Send the commit to the browser", where we will keep the empty page, and then ask the browser to commit a chrome error page?Or do you mean for (2) it should "commit" the chrome error page, but should not send a DidCommit call to the browser and instead it will create a new navigation request for the chrome error page?Yes, sorry, I reversed the order.This would not have the additional round trip delay of showing the final error page like the proposal in the doc, so it does sound interesting.However, doesn't this pose the same problems as not sending DidCommit at all (although just for a few moments before the browser gets updated I guess), and maybe additional inconsistencies between browser and renderer for that brief period?
Yes they both have their pro/cons. I am not quite sure which one is the best. I was a bit reluctant to implement something new in the NavigationRequest (reading the response_body on 4XX) and was thinking it might be easier to rely on what we already have (submitting new navigations).
Maybe reading the response_body on 4XX isn't that hard. This avoids committing the empty 404 document before the chrome 404 document.Does it actually require reading the response body? Can't we rely on the Content-Length: header, which should be available? This should allow us to know that we need to commit a Chrome error page instead of what the server sent at ReadyToCommit time and adjust accordingly.
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAA%3DmyAvcg7W2UOkkzDXK-58AXk1wsK3u717ZzobcYwe%3D-2mRNg%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "navigation-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to navigation-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAAozHLnp9DG294JY2F%3D9sXs4HwJDfgzMDxXW7SOphkWLY9Qv1w%40mail.gmail.com.
2020年9月29日(火) 13:53 'Fergal Daly' via navigation-dev <navigat...@chromium.org>:On Mon, 28 Sep 2020 at 22:59, Matt Falkenhagen <fal...@chromium.org> wrote:2020年9月28日(月) 22:28 Rakina Zata Amni <rak...@chromium.org>:On Mon, Sep 28, 2020 at 11:32 AM Matt Falkenhagen <fal...@chromium.org> wrote:Thanks, I placed some comments in the doc.2020年9月26日(土) 5:48 Nasko Oskov <na...@chromium.org>:On Fri, Sep 25, 2020 at 10:50 AM Rakina Zata Amni <rak...@chromium.org> wrote:Yeah we were wondering about that, but weren't sure if Content-Length is always present and reliable for this use case or not. +Yutaka Hirano mentioned that it might not be trustworthy when chunked transfer encoding is used, and service workers are involved.Would we expect to get 404 from a ServiceWorker? I don't have much experience in the area, so happy to learn more!In general, I would be very surprised if we see in practice a 404 error page use chunked encoding. We can put some UMA stats to try and detect how often this happens in practice and use it as a guide.I'm not sure service workers change the equation much here. From the Chrome implementation side, we forward all the headers they provide to the client, as if they came from the server.It's possible developers are writing service workers that are more badly behaved than servers with respect to providing the Content-Length header, but I don't know that it makes a big difference.I agree that 404 pages and incorrect Content-Length header may be a niche case. From my understanding, this whole problem space is about how to know whether to show the embedder-provided error page (ContentRendererClient::HasErrorPage()). If we don't show the embedded-provided error page, what happens... does it show a blank page or some default one provided by //content?If we don't show the error page, we will show a blank page, which is probably bad UX (see original bug). We can definitely try to measure how often error pages with incorrect/non-existent content-length show up, but I'm wondering how comfortable are we with missing these cases?Also, how long should we gather the data for (weeks? months?). If we need a long time to be confident we've captured enough data, I'm wondering if it's better to do this in parallel with implementing the simpler proposal (to unblock the current work) and change it later if the data shows we can rely on Content-Length most of the time.Thanks I see. Agree we don't want to show the blank page. I also agree with doing the simpler proposal and not over-engineering this though it's not really clear which one is simpler, is that Proposal #1 in your doc?I think I had an idea similar to dcheng's at the top of this thread. Would it be possible for the renderer to just not send the initial DidCommit ACK until it knows whether it wants to commit the error page or not? And if it turns out it wants the browser to navigate to another error page, it tells the browser that as part of the NavigationCommit callback / in place of DidCommit?We are trying to get rid of the browser's dependence on the callback and make it so that the browser can swap render frames and finish committing as soon as it sends the commit. So having it just do a renderer-initiated navigation would be compatible with that but I worry that it would be more complicated to commit a blank page and then navigate again to a error page,I see. I thought if we are going with Proposal #1 in Rakina's doc then suppressing the initial DidCommit could simplify things, but maybe not.For Proposal #2, I suppose using Content-Length or, if we do need to read the response body in the browser, something like MimeSniffingThrottle except a throttle that just checks if the response body is empty, could work.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAAzos5GeKNghANaVzs5emoYTx_Wx%2Bn08Fy4-Nor%2Befn5DFOXQA%40mail.gmail.com.
I have one more question here, since I would really like it if we can handle this entirely between the Network Service and the browser process, leaving the renderer process out of the loop completely.We do have MIME sniffing running in the network service, right? It should be able to tell us whether we have any data or not. fergal@ mentioned earlier that one of the downsides to sniffing is that we don't know when we will get the FIN packet if that is how the server ends the connection. However, don't we have to already handle that case with the MIME sniffing code? If the server sends all headers and then delays the FIN packet, we won't respond back to the browser process with OnReceiveResponse as far as I understand the event flow.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAAozHLmRVjTNkMV4t3DP_hhp90wMNmAbZSMzWT33NLYRd%3DsMEA%40mail.gmail.com.
Yes - see how URLLoader::ContinueOnResponseStarted makes the |is_more_mime_sniffing_needed_| decision (ignoring the HTTP status code) as long as 1) net::ShouldSniffMimeType returns true and 2) mojom::kURLLoadOptionSniffMimeType is specified (it *is* specified in NavigationURLLoaderImpl::GetURLLoaderOptions).
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CAA_NCUFypTv6v0wsOpKW6yre2HxmLuvy8qGtYi15DjbsHhgtLw%40mail.gmail.com.
We do confirmation sniffing of text/html files for CORB in a lot of cases, so I wouldn't rely on just that function to know whether we sniff the response.Also, 404s don't seem like a particularly perf-sensitive case to me, and the addition of sniffing there (even in previous nosniff cases) might be ok if it significantly simplifies the implementation. It seems like it might be an option worth considering, at least.
Just adding things for consideration here. Here's the CLs for the first approach: CL1, CL2 (Note that we found another renderer-inititated error page case with extensions, handled in CL1). They aren't that bad, although having two navigations is a bit weird.If we solve the empty-body-with-error-HTTP-status-code case by waiting for the response body, we will:
- Remove the new NavigateToErrorPage method added in frame.mojom
- Remove RenderFrameImpl::RunScriptsAtDocumentReady
- Add a new NavigationThrottle that waits for the response body and turn the navigation into a failed navigation. (is there a better way to do this?)
Just chiming in on one point, so it can be timely, since I might not have time to review the CLs today.On Tue, Oct 6, 2020 at 6:56 AM Rakina Zata Amni <rak...@chromium.org> wrote:Just adding things for consideration here. Here's the CLs for the first approach: CL1, CL2 (Note that we found another renderer-inititated error page case with extensions, handled in CL1). They aren't that bad, although having two navigations is a bit weird.If we solve the empty-body-with-error-HTTP-status-code case by waiting for the response body, we will:
- Remove the new NavigateToErrorPage method added in frame.mojom
- Remove RenderFrameImpl::RunScriptsAtDocumentReady
- Add a new NavigationThrottle that waits for the response body and turn the navigation into a failed navigation. (is there a better way to do this?)
I don't think we need a NavigationThrottle for this. The Network Service is performing the sniffing and will know whether the body is empty or not. This boolean value can be passed back to the NavigationURLLoader code, in theory. In practice, I'm not sure whether the interface is easy enough to extend, but this would be the first thing I would look at.
On Tue, Oct 6, 2020 at 10:28 AM Nasko Oskov <na...@chromium.org> wrote:Just chiming in on one point, so it can be timely, since I might not have time to review the CLs today.On Tue, Oct 6, 2020 at 6:56 AM Rakina Zata Amni <rak...@chromium.org> wrote:Just adding things for consideration here. Here's the CLs for the first approach: CL1, CL2 (Note that we found another renderer-inititated error page case with extensions, handled in CL1). They aren't that bad, although having two navigations is a bit weird.If we solve the empty-body-with-error-HTTP-status-code case by waiting for the response body, we will:
- Remove the new NavigateToErrorPage method added in frame.mojom
- Remove RenderFrameImpl::RunScriptsAtDocumentReady
- Add a new NavigationThrottle that waits for the response body and turn the navigation into a failed navigation. (is there a better way to do this?)
I don't think we need a NavigationThrottle for this. The Network Service is performing the sniffing and will know whether the body is empty or not. This boolean value can be passed back to the NavigationURLLoader code, in theory. In practice, I'm not sure whether the interface is easy enough to extend, but this would be the first thing I would look at.Just did a quick skim over ULRResponseHead and it has encoded_data_lenght. I don't know whether it actually behaves the way we want it to, maybe it does? The struct has some other lenght members, but I'm not versed on exactly how they work.
On Wed, Oct 7, 2020 at 2:32 AM Nasko Oskov <na...@chromium.org> wrote:On Tue, Oct 6, 2020 at 10:28 AM Nasko Oskov <na...@chromium.org> wrote:Just chiming in on one point, so it can be timely, since I might not have time to review the CLs today.On Tue, Oct 6, 2020 at 6:56 AM Rakina Zata Amni <rak...@chromium.org> wrote:Just adding things for consideration here. Here's the CLs for the first approach: CL1, CL2 (Note that we found another renderer-inititated error page case with extensions, handled in CL1). They aren't that bad, although having two navigations is a bit weird.If we solve the empty-body-with-error-HTTP-status-code case by waiting for the response body, we will:
- Remove the new NavigateToErrorPage method added in frame.mojom
- Remove RenderFrameImpl::RunScriptsAtDocumentReady
- Add a new NavigationThrottle that waits for the response body and turn the navigation into a failed navigation. (is there a better way to do this?)
I don't think we need a NavigationThrottle for this. The Network Service is performing the sniffing and will know whether the body is empty or not. This boolean value can be passed back to the NavigationURLLoader code, in theory. In practice, I'm not sure whether the interface is easy enough to extend, but this would be the first thing I would look at.Just did a quick skim over ULRResponseHead and it has encoded_data_lenght. I don't know whether it actually behaves the way we want it to, maybe it does? The struct has some other lenght members, but I'm not versed on exactly how they work.That is populated very early when we got the headers, so I don't think it has any information on the body. Reading the body for sniffing is further down. I think we can't depend on CORB & MIME sniffing to fully cover all the cases we want (CORB skips some cases like same-origin document I think) - CMIIW.
So we need a separate flag (similar to is_more_mime_sniffing_needed_) and also a new field in URLResponseHead to indicate that we know the body is empty/not-empty. Those aren't that hard to add I think (as we can follow the CORB/MIME sniffing path), except that we want it to be set only on our specific case (otherwise it'd slow down more things than we'd like): It's for a navigation, it's for the main frame, and it has an error status code. The last part is easy to get from the headers, but I don't know how to know about the others from within the URLLoader. Maybe there's a way to pass that info somehow? Does that sound reasonable?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/navigation-dev/CACPC1r7erXtqJaqc%3DZLwSPqN_xQjRJo4b7AYdUaXQgnX0k3spw%40mail.gmail.com.
On Wed, Oct 7, 2020 at 8:35 AM Rakina Zata Amni <rak...@chromium.org> wrote:On Wed, Oct 7, 2020 at 2:32 AM Nasko Oskov <na...@chromium.org> wrote:On Tue, Oct 6, 2020 at 10:28 AM Nasko Oskov <na...@chromium.org> wrote:Just chiming in on one point, so it can be timely, since I might not have time to review the CLs today.On Tue, Oct 6, 2020 at 6:56 AM Rakina Zata Amni <rak...@chromium.org> wrote:Just adding things for consideration here. Here's the CLs for the first approach: CL1, CL2 (Note that we found another renderer-inititated error page case with extensions, handled in CL1). They aren't that bad, although having two navigations is a bit weird.If we solve the empty-body-with-error-HTTP-status-code case by waiting for the response body, we will:
- Remove the new NavigateToErrorPage method added in frame.mojom
- Remove RenderFrameImpl::RunScriptsAtDocumentReady
- Add a new NavigationThrottle that waits for the response body and turn the navigation into a failed navigation. (is there a better way to do this?)
I don't think we need a NavigationThrottle for this. The Network Service is performing the sniffing and will know whether the body is empty or not. This boolean value can be passed back to the NavigationURLLoader code, in theory. In practice, I'm not sure whether the interface is easy enough to extend, but this would be the first thing I would look at.Just did a quick skim over ULRResponseHead and it has encoded_data_lenght. I don't know whether it actually behaves the way we want it to, maybe it does? The struct has some other lenght members, but I'm not versed on exactly how they work.That is populated very early when we got the headers, so I don't think it has any information on the body. Reading the body for sniffing is further down. I think we can't depend on CORB & MIME sniffing to fully cover all the cases we want (CORB skips some cases like same-origin document I think) - CMIIW.So we need a separate flag (similar to is_more_mime_sniffing_needed_) and also a new field in URLResponseHead to indicate that we know the body is empty/not-empty. Those aren't that hard to add I think (as we can follow the CORB/MIME sniffing path), except that we want it to be set only on our specific case (otherwise it'd slow down more things than we'd like): It's for a navigation, it's for the main frame, and it has an error status code. The last part is easy to get from the headers, but I don't know how to know about the others from within the URLLoader. Maybe there's a way to pass that info somehow? Does that sound reasonable?Are we trying to wait for it in network service or somewhere else? (Sorry, haven't read all the thread yet)URLLoader is created per request/response, and whether it's for navigation or not can be somewhat distinguished by the 'destination' field in the resource request. There's also a flag is_main_frame in the request.