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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/NetworkManager.js

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: incorporated falken's comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 * @param {string} data 581 * @param {string} data
582 */ 582 */
583 eventSourceMessageReceived(requestId, time, eventName, eventId, data) { 583 eventSourceMessageReceived(requestId, time, eventName, eventId, data) {
584 var networkRequest = this._inflightRequestsById[requestId]; 584 var networkRequest = this._inflightRequestsById[requestId];
585 if (!networkRequest) 585 if (!networkRequest)
586 return; 586 return;
587 networkRequest.addEventSourceMessage(time, eventName, eventId, data); 587 networkRequest.addEventSourceMessage(time, eventName, eventId, data);
588 } 588 }
589 589
590 /** 590 /**
591 * @override
592 * @param {!Protocol.Network.RequestId} requestId
593 * @param {string} requestURL
594 * @param {!Protocol.Network.Timestamp} time
595 * @param {!Protocol.Network.Timestamp} wallTime
596 * @param {!Protocol.Network.Initiator} initiator
597 */
598 navigationPreloadSent(requestId, requestURL, time, wallTime, initiator) {
599 var networkRequest = this._createNetworkRequest(requestId, '', '', requestUR L, requestURL, initiator);
600 networkRequest.setIssueTime(time, wallTime);
601 this._startNetworkRequest(networkRequest);
602 }
603
604 /**
605 * @override
606 * @param {!Protocol.Network.RequestId} requestId
607 * @param {!Protocol.Network.Timestamp} time
608 * @param {!Protocol.Network.Response} response
609 */
610 navigationPreloadResponseReceived(requestId, time, response) {
611 var networkRequest = this._inflightRequestsById[requestId];
612 if (!networkRequest)
613 return;
614
615 networkRequest.responseReceivedTime = time;
616 this._updateNetworkRequestWithResponse(networkRequest, response);
617 this._updateNetworkRequest(networkRequest);
618 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest);
619 }
620
621 /**
622 * @override
623 * @param {!Protocol.Network.RequestId} requestId
624 * @param {!Protocol.Network.Timestamp} time
625 * @param {string} errorMessage
626 */
627 navigationPreloadFailed(requestId, time, errorMessage) {
628 var networkRequest = this._inflightRequestsById[requestId];
629 if (!networkRequest)
630 return;
631 networkRequest.failed = true;
632 networkRequest.localizedFailDescription = errorMessage;
633 this._finishNetworkRequest(networkRequest, time, -1);
634 }
635
636 /**
637 * @override
638 * @param {!Protocol.Network.RequestId} requestId
639 * @param {!Protocol.Network.Timestamp} time
640 */
641 navigationPreloadFinished(requestId, time) {
642 var networkRequest = this._inflightRequestsById[requestId];
643 if (!networkRequest)
644 return;
645 this._finishNetworkRequest(networkRequest, time, -1);
646 }
647
648 /**
591 * @param {!Protocol.Network.RequestId} requestId 649 * @param {!Protocol.Network.RequestId} requestId
592 * @param {!Protocol.Network.Timestamp} time 650 * @param {!Protocol.Network.Timestamp} time
593 * @param {string} redirectURL 651 * @param {string} redirectURL
594 * @return {!SDK.NetworkRequest} 652 * @return {!SDK.NetworkRequest}
595 */ 653 */
596 _appendRedirect(requestId, time, redirectURL) { 654 _appendRedirect(requestId, time, redirectURL) {
597 var originalNetworkRequest = this._inflightRequestsById[requestId]; 655 var originalNetworkRequest = this._inflightRequestsById[requestId];
598 var previousRedirects = originalNetworkRequest.redirects || []; 656 var previousRedirects = originalNetworkRequest.redirects || [];
599 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length); 657 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length);
600 delete originalNetworkRequest.redirects; 658 delete originalNetworkRequest.redirects;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 SDK.MultitargetNetworkManager.Events = { 955 SDK.MultitargetNetworkManager.Events = {
898 ConditionsChanged: Symbol('ConditionsChanged'), 956 ConditionsChanged: Symbol('ConditionsChanged'),
899 UserAgentChanged: Symbol('UserAgentChanged') 957 UserAgentChanged: Symbol('UserAgentChanged')
900 }; 958 };
901 959
902 960
903 /** 961 /**
904 * @type {!SDK.MultitargetNetworkManager} 962 * @type {!SDK.MultitargetNetworkManager}
905 */ 963 */
906 SDK.multitargetNetworkManager; 964 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698