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

Issue 2327463002: Relax ad-hoc assumptions on InterceptingResourceHandler (Closed)

Created:
4 years, 3 months ago by yhirano
Modified:
4 years, 2 months ago
CC:
chromium-reviews, loading-reviews_chromium.org, jam, darin-cc_chromium.org, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Relax ad-hoc assumptions on InterceptingResourceHandler InterceptingResourceHandler holds two ResourceHandlers but it requires those ResourceHandlers to meet certain conditions in addition to the usual ResourceHandler contract. This CL removes some (not all) requirements so that it can work with MojoAsyncResourceHandler. With this CL, - OnResponseStarted on the old handler can return false. - OnResponseStarted on the new handler can return false. - OnResponseStarted on the new handler can defer processing. - OnWillStart on the old handler can return false. - OnReadCompleted on the old handler can return false. - OnReadCompleted on the old handler can defer processing. - the payload given to |UseHandler| can be longer than the size of the buffer exposed via OnWillRead. - InterceptingResourceHandler reads only "committed" data. Previously, it read data on the buffer exposed by OnWillRead before OnReadCompleted was called. BUG=603396 Committed: https://crrev.com/22b69a9b20e099fbe14c70b621bc630043222146 Cr-Commit-Position: refs/heads/master@{#426134}

Patch Set 1 : fix #

Total comments: 16

Patch Set 2 : fix #

Total comments: 9

Patch Set 3 : fix #

Patch Set 4 : fix #

Patch Set 5 : fix #

Patch Set 6 : fix #

Patch Set 7 : fix #

Patch Set 8 : fix #

Total comments: 36

Patch Set 9 : fix #

Patch Set 10 : fix #

Total comments: 24

Patch Set 11 : fix #

Patch Set 12 : fix #

Patch Set 13 : fix #

Patch Set 14 : fix #

Total comments: 2

Patch Set 15 : fix #

Total comments: 2

Patch Set 16 : fix #

Patch Set 17 : fix #

Patch Set 18 : fix #

Patch Set 19 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+743 lines, -202 lines) Patch
M content/browser/loader/intercepting_resource_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +64 lines, -21 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +193 lines, -84 lines 0 comments Download
M content/browser/loader/intercepting_resource_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 26 chunks +454 lines, -92 lines 0 comments Download
M content/browser/loader/mime_sniffing_resource_handler_unittest.cc View 1 2 3 6 chunks +32 lines, -5 lines 0 comments Download

Messages

Total messages: 139 (107 generated)
yhirano
Matt, can you take a look? This CL addresses [1]. 1: https://codereview.chromium.org/1970693002/diff/1680001/content/browser/loader/mojo_async_resource_handler.cc#newcode220
4 years, 2 months ago (2016-09-29 09:15:41 UTC) #35
mmenke
On 2016/09/29 09:15:41, yhirano wrote: > Matt, can you take a look? This CL addresses ...
4 years, 2 months ago (2016-09-29 14:55:01 UTC) #38
mmenke
[+csharrison]: You said you wanted to shadow me on the Mojo reviews. While this doesn't ...
4 years, 2 months ago (2016-09-29 15:01:50 UTC) #40
Charlie Harrison
This looks good. I think having the logic in InterceptingResourceHandler is the right move conceptually. ...
4 years, 2 months ago (2016-09-29 22:32:58 UTC) #41
yhirano
Thank you for your comments. https://codereview.chromium.org/2327463002/diff/100001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/100001/content/browser/loader/intercepting_resource_handler.cc#newcode83 content/browser/loader/intercepting_resource_handler.cc:83: DCHECK_EQ(State::STARTING, state_); On 2016/09/29 ...
4 years, 2 months ago (2016-10-03 11:50:22 UTC) #45
mmenke
Sorry for the delay - ended up taking Friday off, low on sleep today (Insomnia, ...
4 years, 2 months ago (2016-10-03 20:20:01 UTC) #48
mmenke
https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc#newcode133 content/browser/loader/intercepting_resource_handler.cc:133: bool InterceptingResourceHandler::SendFirstReadBufferToNewHandler(bool* defer) { Why are you reversing the ...
4 years, 2 months ago (2016-10-04 15:08:01 UTC) #49
mmenke
Other than those comments, code looks reasonable to me (Still need to look at tests).
4 years, 2 months ago (2016-10-04 15:09:22 UTC) #50
yhirano
https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc#newcode133 content/browser/loader/intercepting_resource_handler.cc:133: bool InterceptingResourceHandler::SendFirstReadBufferToNewHandler(bool* defer) { On 2016/10/04 15:08:01, mmenke wrote: ...
4 years, 2 months ago (2016-10-06 11:41:44 UTC) #57
mmenke
https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc#newcode133 content/browser/loader/intercepting_resource_handler.cc:133: bool InterceptingResourceHandler::SendFirstReadBufferToNewHandler(bool* defer) { On 2016/10/06 11:41:44, yhirano wrote: ...
4 years, 2 months ago (2016-10-06 16:10:18 UTC) #60
yhirano
https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/120001/content/browser/loader/intercepting_resource_handler.cc#newcode133 content/browser/loader/intercepting_resource_handler.cc:133: bool InterceptingResourceHandler::SendFirstReadBufferToNewHandler(bool* defer) { On 2016/10/06 16:10:18, mmenke wrote: ...
4 years, 2 months ago (2016-10-07 15:03:53 UTC) #75
mmenke
I'll try to do a pass later today, have a couple other good size reviews, ...
4 years, 2 months ago (2016-10-07 15:48:42 UTC) #76
mmenke
Sorry for the delay. Think there may be some further cleanup of the DoLoop - ...
4 years, 2 months ago (2016-10-10 19:40:16 UTC) #77
yhirano
https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc#newcode73 content/browser/loader/intercepting_resource_handler.cc:73: *buf = first_read_buffer_double_; On 2016/10/10 19:40:15, mmenke wrote: > ...
4 years, 2 months ago (2016-10-11 11:06:41 UTC) #78
mmenke
https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc#newcode73 content/browser/loader/intercepting_resource_handler.cc:73: *buf = first_read_buffer_double_; On 2016/10/11 11:06:40, yhirano wrote: > ...
4 years, 2 months ago (2016-10-11 18:04:27 UTC) #79
mmenke
https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc#newcode117 content/browser/loader/intercepting_resource_handler.cc:117: new_handler_->OnResponseCompleted(status, defer); This seems not quite right. If we're ...
4 years, 2 months ago (2016-10-11 21:34:35 UTC) #80
yhirano
https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc#newcode117 content/browser/loader/intercepting_resource_handler.cc:117: new_handler_->OnResponseCompleted(status, defer); On 2016/10/11 21:34:35, mmenke wrote: > This ...
4 years, 2 months ago (2016-10-12 10:36:22 UTC) #87
mmenke
Want to do a pass over the tests today, and hopefully be ready to sign ...
4 years, 2 months ago (2016-10-12 15:04:01 UTC) #90
Charlie Harrison
This code was hard for me to follow :/ What follows are sort of suggestions ...
4 years, 2 months ago (2016-10-12 19:38:21 UTC) #91
mmenke
https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc File content/browser/loader/intercepting_resource_handler_unittest.cc (right): https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc#newcode66 content/browser/loader/intercepting_resource_handler_unittest.cc:66: false /* defer_on_response_completed */) {} Should this just call ...
4 years, 2 months ago (2016-10-12 20:10:47 UTC) #92
yhirano
https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/240001/content/browser/loader/intercepting_resource_handler.cc#newcode193 content/browser/loader/intercepting_resource_handler.cc:193: next_handler_->OnResponseCompleted(status, &defer_ignored); On 2016/10/12 15:04:01, mmenke wrote: > On ...
4 years, 2 months ago (2016-10-13 11:36:22 UTC) #101
mmenke
Cancellation is dark and full of horrors. https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc File content/browser/loader/intercepting_resource_handler_unittest.cc (right): https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc#newcode772 content/browser/loader/intercepting_resource_handler_unittest.cc:772: } On ...
4 years, 2 months ago (2016-10-13 17:35:47 UTC) #104
yhirano
https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc File content/browser/loader/intercepting_resource_handler_unittest.cc (right): https://codereview.chromium.org/2327463002/diff/280001/content/browser/loader/intercepting_resource_handler_unittest.cc#newcode772 content/browser/loader/intercepting_resource_handler_unittest.cc:772: } On 2016/10/13 17:35:47, mmenke wrote: > On 2016/10/13 ...
4 years, 2 months ago (2016-10-14 04:06:04 UTC) #105
yhirano
PS15 brings back the assumption that the old handler's OnResponseCompleted finished synchronously, because I now ...
4 years, 2 months ago (2016-10-14 05:47:00 UTC) #110
mmenke
https://codereview.chromium.org/2327463002/diff/380001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/380001/content/browser/loader/intercepting_resource_handler.cc#newcode104 content/browser/loader/intercepting_resource_handler.cc:104: if (!new_handler_) { Let's add tests that go through ...
4 years, 2 months ago (2016-10-14 14:52:15 UTC) #111
yhirano
https://codereview.chromium.org/2327463002/diff/380001/content/browser/loader/intercepting_resource_handler.cc File content/browser/loader/intercepting_resource_handler.cc (right): https://codereview.chromium.org/2327463002/diff/380001/content/browser/loader/intercepting_resource_handler.cc#newcode104 content/browser/loader/intercepting_resource_handler.cc:104: if (!new_handler_) { On 2016/10/14 14:52:15, mmenke wrote: > ...
4 years, 2 months ago (2016-10-17 08:58:59 UTC) #122
mmenke
LGTM!
4 years, 2 months ago (2016-10-17 17:00:32 UTC) #129
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2327463002/480001
4 years, 2 months ago (2016-10-19 01:33:16 UTC) #131
commit-bot: I haz the power
Exceeded global retry quota
4 years, 2 months ago (2016-10-19 03:07:18 UTC) #133
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2327463002/480001
4 years, 2 months ago (2016-10-19 03:47:55 UTC) #135
commit-bot: I haz the power
Committed patchset #19 (id:480001)
4 years, 2 months ago (2016-10-19 04:40:19 UTC) #137
commit-bot: I haz the power
4 years, 2 months ago (2016-10-21 13:06:31 UTC) #139
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/22b69a9b20e099fbe14c70b621bc630043222146
Cr-Commit-Position: refs/heads/master@{#426134}

Powered by Google App Engine
This is Rietveld 408576698