Skip to content

Commit

Permalink
Revert of Show service worker navigation preload requests in DevTools…
Browse files Browse the repository at this point in the history
… 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

[email protected],[email protected]
# 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}
  • Loading branch information
horo-t authored and Commit bot committed Jan 24, 2017
1 parent f0d5392 commit 52a7c4d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
6 changes: 0 additions & 6 deletions front_end/network/NetworkDataGridNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 0 additions & 2 deletions front_end/sdk/NetworkLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
3 changes: 1 addition & 2 deletions front_end/sdk/NetworkRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,7 @@ SDK.NetworkRequest.InitiatorType = {
Other: 'other',
Parser: 'parser',
Redirect: 'redirect',
Script: 'script',
Preload: 'preload'
Script: 'script'
};

/** @typedef {!{name: string, value: string}} */
Expand Down
13 changes: 3 additions & 10 deletions front_end/sdk/SubTargetsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 52a7c4d

Please sign in to comment.