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

Issue 2982363002: Add support for fallback content for the frame. This includes main and subframes. (Closed)

Created:
3 years, 5 months ago by ananta
Modified:
3 years, 4 months ago
Reviewers:
michaeln, jam, yzshen1, kinuko
CC:
chromium-reviews, darin-cc_chromium.org, rdsmith+watch_chromium.org, loading-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for fallback content for the frame. This includes main and subframes. To achieve this the following changes were done. 1. The URLLoaderRequestHandler which is implemented by the navigation request handlers like AppCache/ServiceWorker, etc now has the following method MaybeCreateLoaderForResponse(). AppCache returns fallback content for the response passed in if applicable. 2. The AppCacheRequestHandler class which implements the URLLoaderRequestHandler interface implements the above method. It uses the MaybeLoadFallbackForResponse() function to potentially return fallback content. The difference between fallback handling for subresources and the frame is a new job is created for the latter. The MaybeCreateJobForFallback() function has been updated with this check. 3. The URLLoaderRequestController class which handles top level navigations now provides functionality to invoke the registered handlers when it receives a response. This is only done if the request was sent to the default network loader. A boolean flag default_loader_used_ is used to track this. If this is set we invoke the registered handlers and pass in the bound URLLoaderClient and the request to the handlers which enables them to bind to the connection. 4. We don't use the throttling URL loader for this case. This is fine because the main URL would already have been checked by the throtting URL loader when it was sent to the network service. Added a function DisconnectClient() to the throttling URL loader which disconnects the client from the network service in case we are passing fallback content to the client. BUG=715632 Review-Url: https://codereview.chromium.org/2982363002 Cr-Commit-Position: refs/heads/master@{#490666} Committed: https://chromium.googlesource.com/chromium/src/+/b9800e5823ff3358a4f90d1a9e72c26a3d742988

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : More cleanup #

Total comments: 2

Patch Set 4 : Renamed the ThrottlingURLLoader's cancelled_by_throttle_ member to loader_cancelled_ and set it in … #

Total comments: 4

Patch Set 5 : Address review comments. #

Total comments: 23

Patch Set 6 : Address review comments. Add the fallback function as a parameter to LoaderCallback #

Total comments: 4

Patch Set 7 : Revert back to the previous patch set with the new method MaybeCreateLoaderForResponse in the URLLo… #

Patch Set 8 : Rename stale methods #

Patch Set 9 : Fix compile failures #

Patch Set 10 : Fix other issues pointed in an earlier iteration #

Patch Set 11 : Remove the MaybeGetFallbackForRedirect() method from AppCacheRequestHandler #

Patch Set 12 : Changed the MaybeCreateLoaderForResponse function to return the URLLoaderPtr and URLLoaderClientReq… #

Total comments: 3

Patch Set 13 : Remove newline #

Total comments: 17

Patch Set 14 : Address review comments #

Patch Set 15 : rebase to tip #

Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -34 lines) Patch
M content/browser/appcache/appcache_request_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +10 lines, -3 lines 0 comments Download
M content/browser/appcache/appcache_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +34 lines, -1 line 0 comments Download
M content/browser/appcache/appcache_url_loader_job.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_url_loader_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -6 lines 0 comments Download
M content/browser/loader/navigation_url_loader_network_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +68 lines, -1 line 0 comments Download
M content/browser/loader/url_loader_request_handler.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/loader/url_loader_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_loader_job.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -2 lines 0 comments Download
M content/common/throttling_url_loader.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M content/common/throttling_url_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 11 chunks +22 lines, -20 lines 0 comments Download

Messages

Total messages: 75 (38 generated)
ananta
3 years, 5 months ago (2017-07-21 01:27:13 UTC) #2
ananta
michaeln, please review everything. jam, general content changes. yzshen, please review changes to the ThrottlingURLLoader ...
3 years, 5 months ago (2017-07-21 01:28:33 UTC) #5
jam
+Kinuko who should take a look My main comment is whether we can hide these ...
3 years, 5 months ago (2017-07-21 21:42:35 UTC) #11
ananta
On 2017/07/21 21:42:35, jam wrote: > +Kinuko who should take a look > > My ...
3 years, 5 months ago (2017-07-21 21:57:59 UTC) #12
ananta
https://codereview.chromium.org/2982363002/diff/40001/content/common/throttling_url_loader.h File content/common/throttling_url_loader.h (right): https://codereview.chromium.org/2982363002/diff/40001/content/common/throttling_url_loader.h#newcode72 content/common/throttling_url_loader.h:72: void DisconnectClient(); On 2017/07/21 21:42:34, jam wrote: > please ...
3 years, 5 months ago (2017-07-21 23:19:04 UTC) #15
jam
On 2017/07/21 21:57:59, ananta wrote: > On 2017/07/21 21:42:35, jam wrote: > > +Kinuko who ...
3 years, 5 months ago (2017-07-24 15:48:49 UTC) #18
yzshen1
Only a couple of nits for mojo stuff and throttling_url_loader. Other than that, I think ...
3 years, 4 months ago (2017-07-24 17:48:54 UTC) #19
ananta
On 2017/07/24 15:48:49, jam wrote: > On 2017/07/21 21:57:59, ananta wrote: > > On 2017/07/21 ...
3 years, 4 months ago (2017-07-24 18:53:09 UTC) #20
ananta
https://codereview.chromium.org/2982363002/diff/60001/content/browser/appcache/appcache_url_loader_job.h File content/browser/appcache/appcache_url_loader_job.h (right): https://codereview.chromium.org/2982363002/diff/60001/content/browser/appcache/appcache_url_loader_job.h#newcode115 content/browser/appcache/appcache_url_loader_job.h:115: // Binds to the URLLoaderClient instance passed in via ...
3 years, 4 months ago (2017-07-24 18:53:18 UTC) #21
kinuko
Sorry for chiming in late. https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode267 content/browser/loader/navigation_url_loader_network_service.cc:267: return; In my understanding ...
3 years, 4 months ago (2017-07-25 07:12:05 UTC) #26
kinuko
Sorry for chiming in late.
3 years, 4 months ago (2017-07-25 07:12:08 UTC) #27
kinuko
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode316 content/browser/loader/navigation_url_loader_network_service.cc:316: response, &fallback_client, &fallback_request)) { On 2017/07/25 07:12:05, kinuko wrote: ...
3 years, 4 months ago (2017-07-25 07:28:42 UTC) #28
jam
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode316 content/browser/loader/navigation_url_loader_network_service.cc:316: response, &fallback_client, &fallback_request)) { On 2017/07/25 07:12:05, kinuko wrote: ...
3 years, 4 months ago (2017-07-25 18:14:15 UTC) #29
ananta
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode267 content/browser/loader/navigation_url_loader_network_service.cc:267: return; On 2017/07/25 07:12:05, kinuko wrote: > In my ...
3 years, 4 months ago (2017-07-25 22:33:00 UTC) #30
kinuko
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode267 content/browser/loader/navigation_url_loader_network_service.cc:267: return; On 2017/07/25 22:33:00, ananta wrote: > On 2017/07/25 ...
3 years, 4 months ago (2017-07-25 23:23:14 UTC) #31
jam
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode316 content/browser/loader/navigation_url_loader_network_service.cc:316: response, &fallback_client, &fallback_request)) { On 2017/07/25 23:23:13, kinuko wrote: ...
3 years, 4 months ago (2017-07-26 01:40:52 UTC) #32
kinuko
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/navigation_url_loader_network_service.cc#newcode316 content/browser/loader/navigation_url_loader_network_service.cc:316: response, &fallback_client, &fallback_request)) { On 2017/07/26 01:40:51, jam wrote: ...
3 years, 4 months ago (2017-07-26 01:59:14 UTC) #33
michaeln
I'd like to focus on the URLLoaderRequestHandler API and to come to an agreement on ...
3 years, 4 months ago (2017-07-26 23:08:41 UTC) #34
ananta
https://codereview.chromium.org/2982363002/diff/80001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/appcache/appcache_request_handler.cc#newcode587 content/browser/appcache/appcache_request_handler.cc:587: navigation_request_job_.release() On 2017/07/26 23:08:41, michaeln wrote: > if navigation_request_job_ ...
3 years, 4 months ago (2017-07-27 02:40:25 UTC) #35
kinuko
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h File content/browser/loader/url_loader_request_handler.h (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h#newcode50 content/browser/loader/url_loader_request_handler.h:50: mojom::URLLoaderRequest* request); On 2017/07/27 02:40:25, ananta wrote: > On ...
3 years, 4 months ago (2017-07-27 13:46:26 UTC) #41
kinuko
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h File content/browser/loader/url_loader_request_handler.h (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h#newcode50 content/browser/loader/url_loader_request_handler.h:50: mojom::URLLoaderRequest* request); On 2017/07/27 02:40:25, ananta wrote: > On ...
3 years, 4 months ago (2017-07-27 13:46:27 UTC) #42
michaeln
I was working under the assumption that hooking the response was an overly appcache specific ...
3 years, 4 months ago (2017-07-27 22:04:41 UTC) #43
ananta
On 2017/07/27 22:04:41, michaeln wrote: > I was working under the assumption that hooking the ...
3 years, 4 months ago (2017-07-27 22:07:03 UTC) #45
ananta
https://codereview.chromium.org/2982363002/diff/100001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/100001/content/browser/loader/navigation_url_loader_network_service.cc#newcode322 content/browser/loader/navigation_url_loader_network_service.cc:322: .Run(response, std::move(fallback_client), std::move(fallback_request)); On 2017/07/27 13:46:26, kinuko wrote: > ...
3 years, 4 months ago (2017-07-27 22:07:14 UTC) #46
michaeln
On 2017/07/27 22:07:03, ananta wrote: > On 2017/07/27 22:04:41, michaeln wrote: > > I was ...
3 years, 4 months ago (2017-07-27 22:32:03 UTC) #47
jam
https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h File content/browser/loader/url_loader_request_handler.h (right): https://codereview.chromium.org/2982363002/diff/80001/content/browser/loader/url_loader_request_handler.h#newcode50 content/browser/loader/url_loader_request_handler.h:50: mojom::URLLoaderRequest* request); On 2017/07/27 13:46:26, kinuko wrote: > On ...
3 years, 4 months ago (2017-07-27 23:19:13 UTC) #48
kinuko
On 2017/07/27 22:32:03, michaeln wrote: > On 2017/07/27 22:07:03, ananta wrote: > > On 2017/07/27 ...
3 years, 4 months ago (2017-07-27 23:31:43 UTC) #49
ananta
On 2017/07/27 23:31:43, kinuko wrote: > On 2017/07/27 22:32:03, michaeln wrote: > > On 2017/07/27 ...
3 years, 4 months ago (2017-07-28 03:27:19 UTC) #50
kinuko
Thanks ananta, this is looking good! One quick question https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc#newcode308 content/browser/loader/navigation_url_loader_network_service.cc:308: ...
3 years, 4 months ago (2017-07-28 03:34:52 UTC) #53
kinuko
lgtm https://codereview.chromium.org/2982363002/diff/240001/content/browser/appcache/appcache_request_handler.cc File content/browser/appcache/appcache_request_handler.cc (right): https://codereview.chromium.org/2982363002/diff/240001/content/browser/appcache/appcache_request_handler.cc#newcode306 content/browser/appcache/appcache_request_handler.cc:306: // created for handling navigation requests. These instances ...
3 years, 4 months ago (2017-07-28 09:50:29 UTC) #56
michaeln
This went together nicely, lgtm % some questions and a couple nits to consider. Also ...
3 years, 4 months ago (2017-07-28 19:11:03 UTC) #57
ananta
https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc#newcode308 content/browser/loader/navigation_url_loader_network_service.cc:308: return false; On 2017/07/28 03:34:51, kinuko wrote: > One ...
3 years, 4 months ago (2017-07-28 22:59:22 UTC) #58
ananta
https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2982363002/diff/220001/content/browser/loader/navigation_url_loader_network_service.cc#newcode308 content/browser/loader/navigation_url_loader_network_service.cc:308: return false; On 2017/07/28 22:59:21, ananta wrote: > On ...
3 years, 4 months ago (2017-07-29 01:21:45 UTC) #65
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/2982363002/270011
3 years, 4 months ago (2017-07-29 17:59:05 UTC) #70
commit-bot: I haz the power
Committed patchset #15 (id:270011) as https://chromium.googlesource.com/chromium/src/+/b9800e5823ff3358a4f90d1a9e72c26a3d742988
3 years, 4 months ago (2017-07-29 18:04:48 UTC) #73
falken
On 2017/07/29 18:04:48, commit-bot: I haz the power wrote: > Committed patchset #15 (id:270011) as ...
3 years, 4 months ago (2017-07-31 01:29:17 UTC) #74
falken
3 years, 4 months ago (2017-07-31 01:31:46 UTC) #75
Message was sent while issue was closed.
On 2017/07/31 01:29:17, falken wrote:
> On 2017/07/29 18:04:48, commit-bot: I haz the power wrote:
> > Committed patchset #15 (id:270011) as
> >
>
https://chromium.googlesource.com/chromium/src/+/b9800e5823ff3358a4f90d1a9e72...
> 
> FYI this made http/tests/appcache/fallback.html start failing on Mojo Linux.
Not
> sure if that was intended but I'll mark it as failing and file a bug.

Ah, sorry, it didn't "start failing", it just went from Timeout to Failure. So I
won't open a new bug as it was already failing.

Powered by Google App Engine
This is Rietveld 408576698