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

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)

Created:
3 years, 11 months ago by horo
Modified:
3 years, 10 months ago
Reviewers:
falken, pfeldman
CC:
chromium-reviews, michaeln, mlamouri+watch-content_chromium.org, tzik, jsbell+serviceworker_chromium.org, serviceworker-reviews, jam, nhiroki, blink-reviews-api_chromium.org, haraken, dglazkov+blink, kinuko+serviceworker, horo+watch_chromium.org, blink-reviews, darin-cc_chromium.org, kinuko+watch, shimazu+serviceworker_chromium.org, falken+watch_chromium.org, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Show service worker navigation preload requests in DevTools Network tab. Demo: https://youtu.be/I-Qe_Y-xYxE Navigation Preload requests are initiated from the browser process. This is different from the normal network requests which are initiated from the renderer process. When the DevTools show the normal requests in the Network tab, DevTool's Network events (requestWillBeSent, responseReceived, loadingFinished etc) are dispatched via InspectorInstrumentation and InspectorNetworkAgent. This CL introduces new DevTool's Network events (navigationPreloadSent, navigationPreloadResponseReceived, navigationPreloadFailed, navigationPreloadFinished) which are dispatched via InspectorInstrumentation and InspectorNetworkAgent from ServiceWorkerContextClient. In the normal requests case, we record the request sending timestamp when the renderer process will send the request in InspectorNetworkAgent:: willSendRequestInternal(). But in the navigation preload case, we record the timestamp in the browser process, and send it to the service worker's renderer process using FetchEventPreloadHandle. BUG=649558 Review-Url: https://codereview.chromium.org/2620463002 Cr-Original-Commit-Position: refs/heads/master@{#445630} Committed: https://chromium.googlesource.com/chromium/src/+/4c6b3b0f11b62e069d9d84ba99dbe94a45a5c622 Review-Url: https://codereview.chromium.org/2620463002 Cr-Commit-Position: refs/heads/master@{#445699} Committed: https://chromium.googlesource.com/chromium/src/+/23276c71698583a0142e8213bada22e3ae8d0a0e

Patch Set 1 #

Total comments: 18

Patch Set 2 : incorporated falken's comment #

Total comments: 14

Patch Set 3 : incorporated falken's comment #

Patch Set 4 : rebase and include time.h in ServiceWorkerGlobalScopeProxy.* #

Total comments: 2

Patch Set 5 : Add comment in WebServiceWorkerContextProxy.h #

Patch Set 6 : add inspector-test.js #

Total comments: 2

Patch Set 7 : reuse existing instrumentation for network #

Total comments: 10

Patch Set 8 : incorporated pfeldman's comment #

Patch Set 9 : fix compile failure #

Patch Set 10 : fix crash #

Unified diffs Side-by-side diffs Delta from patch set Stats (+400 lines, -92 lines) Patch
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_fetch_dispatcher.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -9 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/resources/navigation-preload-scope.php View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/resources/navigation-preload-worker.php View 1 2 3 4 5 6 1 chunk +29 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-navigation-preload.html View 1 2 3 4 5 6 7 1 chunk +130 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/service-workers-navigation-preload-expected.txt View 1 2 3 4 5 6 7 1 chunk +29 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl View 1 2 3 4 5 6 7 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp View 1 2 3 4 5 6 7 8 9 11 chunks +44 lines, -27 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/WorkerInspectorController.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp View 1 2 3 4 5 6 7 3 chunks +12 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/browser_protocol.json View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/PingLoader.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/InProcessWorkerMessagingProxy.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletMessagingProxy.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/ThreadedWorkletTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThread.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThreadStartupData.h View 1 2 3 4 5 6 7 3 chunks +8 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThreadStartupData.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sdk/NetworkLog.js View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sdk/NetworkRequest.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sdk/SubTargetsManager.js View 1 2 3 4 5 6 7 2 chunks +10 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/AnimationWorkletThreadTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +27 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 131 (107 generated)
horo
falken@ Could you please review this?
3 years, 11 months ago (2017-01-17 08:16:20 UTC) #57
falken
https://codereview.chromium.org/2620463002/diff/240001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/240001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1505 content/browser/loader/resource_dispatcher_host_impl.cc:1505: !requester_info->IsNavigationPreload()) { Can you add a comment about why ...
3 years, 11 months ago (2017-01-17 14:38:36 UTC) #58
horo
https://codereview.chromium.org/2620463002/diff/240001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/240001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1505 content/browser/loader/resource_dispatcher_host_impl.cc:1505: !requester_info->IsNavigationPreload()) { On 2017/01/17 14:38:36, falken wrote: > Can ...
3 years, 11 months ago (2017-01-18 14:25:02 UTC) #61
falken
https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1507 content/browser/loader/resource_dispatcher_host_impl.cc:1507: // the original request. So this check has already ...
3 years, 11 months ago (2017-01-18 14:50:08 UTC) #62
horo
https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1507 content/browser/loader/resource_dispatcher_host_impl.cc:1507: // the original request. So this check has already ...
3 years, 11 months ago (2017-01-19 09:57:09 UTC) #69
falken
lgtm for service worker. Looks like there's the redness is just an expected string that ...
3 years, 11 months ago (2017-01-19 13:40:58 UTC) #72
horo
Thank you. https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1507 content/browser/loader/resource_dispatcher_host_impl.cc:1507: // the original request. So this check ...
3 years, 11 months ago (2017-01-19 14:33:04 UTC) #75
horo
pfeldman@ Could you please review this CL?
3 years, 11 months ago (2017-01-19 14:36:02 UTC) #77
horo
Ah, I forgot to upload inspector-test.js after Patch Set 4. So some layout tests are ...
3 years, 11 months ago (2017-01-19 23:05:23 UTC) #82
pfeldman
Is there a way we could reuse existing instrumentation for network? I.e. create dummy ResourceRequest, ...
3 years, 11 months ago (2017-01-19 23:23:48 UTC) #83
pfeldman
Also, are there any actual network requests under the hood? You are showing it in ...
3 years, 11 months ago (2017-01-19 23:38:16 UTC) #84
falken
https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2620463002/diff/260001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1507 content/browser/loader/resource_dispatcher_host_impl.cc:1507: // the original request. So this check has already ...
3 years, 11 months ago (2017-01-20 01:38:54 UTC) #85
horo
> Also, are there any actual network requests under the hood? You are showing it ...
3 years, 11 months ago (2017-01-20 13:18:36 UTC) #94
pfeldman
> > Also, are there any actual network requests under the hood? You are showing ...
3 years, 11 months ago (2017-01-20 20:32:22 UTC) #97
pfeldman
https://codereview.chromium.org/2620463002/diff/380001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js File third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js (right): https://codereview.chromium.org/2620463002/diff/380001/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js#newcode1000 third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js:1000: return target && !target.hasBrowserCapability() && target.hasJSCapability() && target.hasNetworkCapability() && ...
3 years, 11 months ago (2017-01-20 20:41:46 UTC) #98
horo
> You know what, we could try instrumenting it there, right in the browser if ...
3 years, 11 months ago (2017-01-23 08:05:32 UTC) #104
pfeldman
>> But is it possible to send the existing Netowork events like requestWillBeSent from the ...
3 years, 11 months ago (2017-01-23 18:30:22 UTC) #115
horo
Thank you. Ah, if we send loadingFinished() event from the browser process, we can't known ...
3 years, 11 months ago (2017-01-24 03:28:46 UTC) #116
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/2620463002/460001
3 years, 11 months ago (2017-01-24 03:29:26 UTC) #119
commit-bot: I haz the power
Committed patchset #9 (id:460001) as https://chromium.googlesource.com/chromium/src/+/4c6b3b0f11b62e069d9d84ba99dbe94a45a5c622
3 years, 11 months ago (2017-01-24 03:37:56 UTC) #122
horo
A revert of this CL (patchset #9 id:460001) has been created in https://codereview.chromium.org/2649923007/ by horo@chromium.org. ...
3 years, 11 months ago (2017-01-24 08:47:12 UTC) #123
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/2620463002/480001
3 years, 11 months ago (2017-01-24 09:45:26 UTC) #127
commit-bot: I haz the power
Committed patchset #10 (id:480001) as https://chromium.googlesource.com/chromium/src/+/23276c71698583a0142e8213bada22e3ae8d0a0e
3 years, 11 months ago (2017-01-24 11:25:00 UTC) #130
horo
3 years, 11 months ago (2017-01-26 03:45:57 UTC) #131
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:480001) has been created in
https://codereview.chromium.org/2654433012/ by horo@chromium.org.

The reason for reverting is: Introduced DCHECK crash.

BUG=685493
.

Powered by Google App Engine
This is Rietveld 408576698