From 52a7c4dab688f4ad77fe3f8b3602ae731335c357 Mon Sep 17 00:00:00 2001 From: horo Date: Tue, 24 Jan 2017 00:48:25 -0800 Subject: [PATCH] Revert of Show service worker navigation preload requests in DevTools Network tab (patchset #9 id:460001 of https://codereview.chromium.org/2620463002/ ) Reason for revert: Caused layout test failures. http://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=webkit_tests&tests=http%2Ftests%2Finspector%2Fservice-workers%2Flazy-addeventlisteners.html Original issue's 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-Commit-Position: refs/heads/master@{#445630} > Committed: https://chromium.googlesource.com/chromium/src/+/4c6b3b0f11b62e069d9d84ba99dbe94a45a5c622 TBR=falken@chromium.org,pfeldman@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=649558 Review-Url: https://codereview.chromium.org/2649923007 Cr-Commit-Position: refs/heads/master@{#445684} --- front_end/network/NetworkDataGridNode.js | 6 ------ front_end/sdk/NetworkLog.js | 2 -- front_end/sdk/NetworkRequest.js | 3 +-- front_end/sdk/SubTargetsManager.js | 13 +++---------- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/front_end/network/NetworkDataGridNode.js b/front_end/network/NetworkDataGridNode.js index 6e64b55e3d..3c4027aa7c 100644 --- a/front_end/network/NetworkDataGridNode.js +++ b/front_end/network/NetworkDataGridNode.js @@ -785,12 +785,6 @@ Network.NetworkRequestNode = class extends Network.NetworkNode { cell.request = request; break; - case SDK.NetworkRequest.InitiatorType.Preload: - cell.title = Common.UIString('Preload'); - cell.classList.add('network-dim-cell'); - cell.appendChild(createTextNode(Common.UIString('Preload'))); - break; - default: cell.title = Common.UIString('Other'); cell.classList.add('network-dim-cell'); diff --git a/front_end/sdk/NetworkLog.js b/front_end/sdk/NetworkLog.js index d2632d77e2..4d0752b122 100644 --- a/front_end/sdk/NetworkLog.js +++ b/front_end/sdk/NetworkLog.js @@ -145,8 +145,6 @@ SDK.NetworkLog = class extends SDK.SDKModel { scriptId = topFrame.scriptId; break; } - } else if (initiator.type === Protocol.Network.InitiatorType.Preload) { - type = SDK.NetworkRequest.InitiatorType.Preload; } } diff --git a/front_end/sdk/NetworkRequest.js b/front_end/sdk/NetworkRequest.js index ddb315eea7..a40828f558 100644 --- a/front_end/sdk/NetworkRequest.js +++ b/front_end/sdk/NetworkRequest.js @@ -1136,8 +1136,7 @@ SDK.NetworkRequest.InitiatorType = { Other: 'other', Parser: 'parser', Redirect: 'redirect', - Script: 'script', - Preload: 'preload' + Script: 'script' }; /** @typedef {!{name: string, value: string}} */ diff --git a/front_end/sdk/SubTargetsManager.js b/front_end/sdk/SubTargetsManager.js index f65ec3a617..d5845ad8eb 100644 --- a/front_end/sdk/SubTargetsManager.js +++ b/front_end/sdk/SubTargetsManager.js @@ -130,15 +130,8 @@ SDK.SubTargetsManager = class extends SDK.SDKModel { * @return {number} */ _capabilitiesForType(type) { - if (type === 'worker') { - var capabilities = SDK.Target.Capability.JS | SDK.Target.Capability.Log; - var parentTargetInfo = this.targetInfo(this.target()); - var mainIsServiceWorker = - !this.target().parentTarget() && this.target().hasTargetCapability() && !this.target().hasJSCapability(); - if ((parentTargetInfo && parentTargetInfo.type === 'service_worker') || mainIsServiceWorker) - capabilities |= SDK.Target.Capability.Network; - return capabilities; - } + if (type === 'worker') + return SDK.Target.Capability.JS | SDK.Target.Capability.Log; if (type === 'service_worker') return SDK.Target.Capability.Log | SDK.Target.Capability.Network | SDK.Target.Capability.Target; if (type === 'iframe') { @@ -170,7 +163,7 @@ SDK.SubTargetsManager = class extends SDK.SDKModel { // Only pause new worker if debugging SW - we are going through the pause on start checkbox. var mainIsServiceWorker = - !this.target().parentTarget() && this.target().hasTargetCapability() && !this.target().hasJSCapability(); + !this.target().parentTarget() && this.target().hasTargetCapability() && !this.target().hasBrowserCapability(); if (mainIsServiceWorker && waitingForDebugger) target.debuggerAgent().pause(); target.runtimeAgent().runIfWaitingForDebugger();