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

Issue 2843043002: network service: Create URLLoader for service worker navigation case

Created:
3 years, 7 months ago by scottmg
Modified:
3 years, 7 months ago
Reviewers:
kinuko, falken, yzshen1
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, Randy Smith (Not in Mondays), nhiroki, kinuko+serviceworker, darin-cc_chromium.org, blink-worker-reviews_chromium.org, loading-reviews_chromium.org, horo+watch_chromium.org, kinuko+watch, tzik, mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

network service: Create URLLoader for service worker navigation case This forwards navigation requests optionally through a registered service worker. It does this by reusing code in ServiceWorkerRequestHandler through a new entry point (ServiceWorkerRequestHandler::InitializeForNavigationNetworkService), which is given the opportunity to create ia URLLoaderFactory for the navigation. Internally, ServiceWorkerRequestHandler still uses much of the same machinery (ServiceWorkerStorage, ServiceWorkerVersion) as in the non-network service case, with the addition of some shim code in ServiceWorkerControlleeRequestHandler to forward to a new ServiceWorkerControlleeURLLoaderFactory which uses ServiceWorkerFetchDispatcher to retrieve the data (replacing ServiceWorkerURLRequestJob in this path). There's some placeholder ugliness in SWControllerURLLoaderFactory to grab the blob returned from the Fetch and turn it into a data pipe. This can be removed once the blob store is mojoified. This is about as far as it gets at the moment http://i.imgur.com/ViO1q5u.png (i.e. only the navigation requests). There's no handling for the renderer resource requests yet, nor is there any handling of context-side requests. BUG=715640

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : chromium-style #

Patch Set 4 : warning #

Patch Set 5 : comment #

Patch Set 6 : . #

Patch Set 7 : pull out start data #

Patch Set 8 : less in factory #

Patch Set 9 : . #

Patch Set 10 : . #

Total comments: 8

Patch Set 11 : wip on trying to reuse ServiceWorkerRequestHandler #

Patch Set 12 : . #

Patch Set 13 : add wrapper in ServiceWorkerControlleeRequestHandler to detach from URLRequestJob #

Patch Set 14 : . #

Patch Set 15 : . #

Patch Set 16 : . #

Patch Set 17 : rebase #

Patch Set 18 : bind in ControlleeRequestHandler to empty #

Total comments: 1

Patch Set 19 : plumbing SWControlleeURLLoaderFactory through to SWVersion #

Patch Set 20 : plumb blob from SWFetchDispatcher back to NavigationURLLoaderNS through temp data pipe #

Patch Set 21 : works for basic page load via SW! #

Patch Set 22 : network fallback in simple cases #

Total comments: 13

Patch Set 23 : review fixes, handle network fallback when deferred #

Patch Set 24 : rebase after webui changes #

Patch Set 25 : fix rebase #

Total comments: 12

Patch Set 26 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+807 lines, -121 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/loader/navigation_url_loader_network_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -5 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 15 16 17 18 19 20 21 22 23 24 25 6 chunks +103 lines, -21 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +20 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 14 chunks +176 lines, -24 lines 0 comments Download
A content/browser/service_worker/service_worker_controllee_url_loader_factory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +133 lines, -0 lines 0 comments Download
A content/browser/service_worker/service_worker_controllee_url_loader_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +227 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_request_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 6 chunks +41 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +91 lines, -62 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -1 line 0 comments Download
M content/common/service_worker/service_worker_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (35 generated)
scottmg
jam, could you review? kinuko, michaeln: fyi if I can pique your interest :) My ...
3 years, 7 months ago (2017-04-26 21:04:09 UTC) #21
scottmg
-> kinuko who somewhat volunteered to take a look. :)
3 years, 7 months ago (2017-04-27 00:22:51 UTC) #25
scottmg
On 2017/04/27 00:22:51, scottmg wrote: > -> kinuko who somewhat volunteered to take a look. ...
3 years, 7 months ago (2017-04-27 17:22:50 UTC) #30
kinuko
Sorry for long delay, needed a few days before I could have more time. I ...
3 years, 7 months ago (2017-05-01 02:06:24 UTC) #31
kinuko
https://codereview.chromium.org/2843043002/diff/180001/content/browser/service_worker/service_worker_url_loader_factory_creation.cc File content/browser/service_worker/service_worker_url_loader_factory_creation.cc (right): https://codereview.chromium.org/2843043002/diff/180001/content/browser/service_worker/service_worker_url_loader_factory_creation.cc#newcode36 content/browser/service_worker/service_worker_url_loader_factory_creation.cc:36: ControlleeURLLoaderImpl(mojom::URLLoaderAssociatedRequest loader, Someone needs to own this? https://codereview.chromium.org/2843043002/diff/180001/content/browser/service_worker/service_worker_url_loader_factory_creation.cc#newcode182 content/browser/service_worker/service_worker_url_loader_factory_creation.cc:182: ...
3 years, 7 months ago (2017-05-01 15:07:57 UTC) #32
yzshen1
https://codereview.chromium.org/2843043002/diff/360001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2843043002/diff/360001/content/browser/loader/navigation_url_loader_network_service.cc#newcode276 content/browser/loader/navigation_url_loader_network_service.cc:276: url_loader_factory_ = std::move(g_direct_network_url_loader_factory.Get()); nit: This takes the g_direct_network_url_loader_factory and ...
3 years, 7 months ago (2017-05-04 22:30:37 UTC) #36
falken
I just have a quick question. I think Kinuko is thinking about the overall design ...
3 years, 7 months ago (2017-05-08 08:20:33 UTC) #41
kinuko
The screenshot looks very exciting! And yeah I think we can start with something like ...
3 years, 7 months ago (2017-05-08 14:55:48 UTC) #42
scottmg
Thanks to both of you for taking a look. I addressed all the comments, and ...
3 years, 7 months ago (2017-05-08 20:12:31 UTC) #43
falken
FYI I made some revisions to get the patch to compile on Linux: https://codereview.chromium.org/2867853004/ I ...
3 years, 7 months ago (2017-05-09 08:20:15 UTC) #45
kinuko
Thanks. I/we still have lots to figure out while coding, for landing could we start ...
3 years, 7 months ago (2017-05-09 14:45:25 UTC) #46
scottmg
On 2017/05/09 08:20:15, falken wrote: > FYI I made some revisions to get the patch ...
3 years, 7 months ago (2017-05-09 21:56:02 UTC) #47
scottmg
https://codereview.chromium.org/2843043002/diff/500001/content/browser/loader/navigation_url_loader_network_service.cc File content/browser/loader/navigation_url_loader_network_service.cc (right): https://codereview.chromium.org/2843043002/diff/500001/content/browser/loader/navigation_url_loader_network_service.cc#newcode46 content/browser/loader/navigation_url_loader_network_service.cc:46: using CompleteNavigationStart = On 2017/05/09 14:45:25, kinuko wrote: > ...
3 years, 7 months ago (2017-05-09 22:14:10 UTC) #48
scottmg
On 2017/05/09 14:45:25, kinuko wrote: > Thanks. I/we still have lots to figure out while ...
3 years, 7 months ago (2017-05-09 22:16:40 UTC) #49
falken
3 years, 7 months ago (2017-05-18 08:28:05 UTC) #50
For reference, I very roughly rebased this patch on the latest ToT (with the
landed stub patch):
https://codereview.chromium.org/2886843006/

I removed the network fallback support though, just to try to get something to
work (wasn't sure how to do fallback with the new stub).

Powered by Google App Engine
This is Rietveld 408576698