Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Issue 2447083003: Move fail on suspend logic from URLRequestJob to TcpClientSocket.

Created:
4 years, 1 month ago by mmenke
Modified:
3 years, 4 months ago
Reviewers:
CC:
chromium-reviews, cbentzel+watch_chromium.org, Paweł Hajdan Jr.
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Move fail on suspend logic from URLRequestJob to TcpClientSocket. The old code had a couple issues: 1) It failed requests on entry to suspend mode, regardless of whether a read was actually pending. This could confuse state machines that were asynchronously processing partial results. Fixing this at the URLRequest layer is made difficult due to the URLRequestJob's complicated state machine. TcpClientSocket has a much simpler state machine. 2) It failed requests with ERR_ABORTED, which normally means the URLRequest was cancelled by something above the network stack, so is not accurate in this instance. The RenderView also has magic handling for this error code, unclear if that logic is desireable in this case. If it is, the network stack should not be responsible for ensuring that logic is triggered. 3) This is more minor, but it also resulted in failing requests that aren't going over th network. 4) It only applied to URLRequests, and not other TCP sockets that may be hung as a result of entering/exiting suspend mode. This CL fixes 1-3, with fixing 4 a potential trivial followup to this. The new logic is only enabled for requests that go through a socket pool, and FTP sockets in this CL, with the HostResolver also being updated to fail requests on suspend mode. This should mostly catch the cases the old code caught, with a fair number of exceptions (Doesn't cover QUIC, does cover WebSockets after a connection is established, does cover a couple classes that don't talk HTTP but still use socket pools to get proxy support, fails HTTP2 at the session layer, doesn't try and drain HTTP sockets of data for reuse on network changes). BUG=651120

Patch Set 1 #

Patch Set 2 : Fix NaCl #

Patch Set 3 : Really fix NaCl??? #

Patch Set 4 : Fix callbacks #

Patch Set 5 : Skip test #

Patch Set 6 : Fix connect error case #

Total comments: 2

Patch Set 7 : Merge #

Patch Set 8 : Not rightly sure what this is... #

Patch Set 9 : Fix #

Patch Set 10 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -49 lines) Patch
M net/dns/host_resolver_impl.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -1 line 0 comments Download
M net/dns/host_resolver_impl.cc View 1 2 3 4 5 6 7 4 chunks +20 lines, -2 lines 0 comments Download
M net/ftp/ftp_network_transaction.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M net/socket/stream_socket.h View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M net/socket/stream_socket.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M net/socket/tcp_client_socket.h View 1 2 3 4 5 6 7 7 chunks +22 lines, -4 lines 0 comments Download
M net/socket/tcp_client_socket.cc View 1 2 3 4 5 6 7 12 chunks +90 lines, -12 lines 0 comments Download
M net/socket/transport_client_socket_pool.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M net/url_request/url_request_job.h View 1 2 3 4 5 6 7 3 chunks +2 lines, -7 lines 0 comments Download
M net/url_request/url_request_job.cc View 1 2 3 4 5 6 7 3 chunks +0 lines, -22 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 57 (38 generated)
mmenke
Hey guys, I don't actually want reviews here (I need to add a bunch of ...
4 years, 1 month ago (2016-10-26 20:01:54 UTC) #28
Ryan Hamilton
On 2016/10/26 20:01:54, mmenke wrote: > This code also removes the behavior from QUIC itself ...
4 years, 1 month ago (2016-10-26 22:00:07 UTC) #30
mmenke
On 2016/10/26 22:00:07, Ryan Hamilton wrote: > On 2016/10/26 20:01:54, mmenke wrote: > > This ...
4 years, 1 month ago (2016-10-26 22:05:38 UTC) #31
Ryan Hamilton
On 2016/10/26 22:05:38, mmenke wrote: > On 2016/10/26 22:00:07, Ryan Hamilton wrote: > > On ...
4 years, 1 month ago (2016-10-26 22:09:35 UTC) #32
mmenke
On 2016/10/26 22:09:35, Ryan Hamilton wrote: > On 2016/10/26 22:05:38, mmenke wrote: > > On ...
4 years, 1 month ago (2016-10-26 22:12:13 UTC) #33
Ryan Hamilton
On 2016/10/26 22:12:13, mmenke wrote: > On 2016/10/26 22:09:35, Ryan Hamilton wrote: > > On ...
4 years, 1 month ago (2016-10-26 22:16:09 UTC) #34
mmenke
On 2016/10/26 22:16:09, Ryan Hamilton wrote: > On 2016/10/26 22:12:13, mmenke wrote: > > On ...
4 years, 1 month ago (2016-10-26 22:18:04 UTC) #35
mmenke
On 2016/10/26 22:18:04, mmenke wrote: > On 2016/10/26 22:16:09, Ryan Hamilton wrote: > > On ...
4 years, 1 month ago (2016-10-26 22:18:37 UTC) #36
Bence
https://codereview.chromium.org/2447083003/diff/100001/net/socket/stream_socket.h File net/socket/stream_socket.h (right): https://codereview.chromium.org/2447083003/diff/100001/net/socket/stream_socket.h#newcode118 net/socket/stream_socket.h:118: // connected to remote systems. See https://crbug.com/4606). Unmatched ')'.
4 years, 1 month ago (2016-10-27 13:04:29 UTC) #38
Randy Smith (Not in Mondays)
So it won't surprise you to hear that I'm in favor of this CL; removing ...
4 years, 1 month ago (2016-10-27 15:51:11 UTC) #39
Randy Smith (Not in Mondays)
On 2016/10/27 15:51:11, Randy Smith - Not in Mondays wrote: > So it won't surprise ...
4 years, 1 month ago (2016-10-27 16:04:23 UTC) #40
mmenke
On 2016/10/27 16:04:23, Randy Smith - Not in Mondays wrote: > On 2016/10/27 15:51:11, Randy ...
4 years, 1 month ago (2016-10-27 17:22:50 UTC) #41
mmenke
And thanks for all the feedback, Randy!
4 years, 1 month ago (2016-10-27 17:23:16 UTC) #42
eroman
> If the computer goes to sleep, does that mean that TimeTicks don't move forward ...
4 years, 1 month ago (2016-10-27 18:33:52 UTC) #43
eroman
Thanks Matt, I am very supportive of moving this logic down to the socket layer! ...
4 years, 1 month ago (2016-10-27 19:26:26 UTC) #44
mmenke
On 2016/10/27 19:26:26, eroman wrote: > Thanks Matt, I am very supportive of moving this ...
4 years, 1 month ago (2016-10-27 20:09:44 UTC) #45
mmenke
Eric: Experimenting with the behavior on Windows, we get either a connection reset or connection ...
4 years, 1 month ago (2016-11-16 15:17:40 UTC) #46
Ryan Hamilton
FWIW, I recently learned that while Android devices *do* go to sleep, they do not ...
4 years, 1 month ago (2016-11-16 15:22:19 UTC) #47
mmenke
4 years, 1 month ago (2016-11-16 15:53:47 UTC) #48
On 2016/11/16 15:22:19, Ryan Hamilton wrote:
> FWIW, I recently learned that while Android devices *do* go to sleep, they do
> not deliver a signal to the application about this. As a result
> OnSuspend/OnRestore are never called on Android. You probably already knew
this,
> but just as a heads up...

Thanks for the heads up!  Yea, I did know that, but could very well not have.  I
only knew it because they used to be called when Chrome was backgrounded,
causing problems, hence the switch to not calling them.

Powered by Google App Engine
This is Rietveld 408576698