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

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: rebase and include time.h in ServiceWorkerGlobalScopeProxy.* 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 * @param {string} data 592 * @param {string} data
593 */ 593 */
594 eventSourceMessageReceived(requestId, time, eventName, eventId, data) { 594 eventSourceMessageReceived(requestId, time, eventName, eventId, data) {
595 var networkRequest = this._inflightRequestsById[requestId]; 595 var networkRequest = this._inflightRequestsById[requestId];
596 if (!networkRequest) 596 if (!networkRequest)
597 return; 597 return;
598 networkRequest.addEventSourceMessage(time, eventName, eventId, data); 598 networkRequest.addEventSourceMessage(time, eventName, eventId, data);
599 } 599 }
600 600
601 /** 601 /**
602 * @override
603 * @param {!Protocol.Network.RequestId} requestId
604 * @param {string} requestURL
605 * @param {!Protocol.Network.Timestamp} time
606 * @param {!Protocol.Network.Timestamp} wallTime
607 * @param {!Protocol.Network.Initiator} initiator
608 */
609 navigationPreloadSent(requestId, requestURL, time, wallTime, initiator) {
610 var networkRequest = this._createNetworkRequest(requestId, '', '', requestUR L, requestURL, initiator);
611 networkRequest.setIssueTime(time, wallTime);
612 this._startNetworkRequest(networkRequest);
613 }
614
615 /**
616 * @override
617 * @param {!Protocol.Network.RequestId} requestId
618 * @param {!Protocol.Network.Timestamp} time
619 * @param {!Protocol.Network.Response} response
620 */
621 navigationPreloadResponseReceived(requestId, time, response) {
622 var networkRequest = this._inflightRequestsById[requestId];
623 if (!networkRequest)
624 return;
625
626 networkRequest.responseReceivedTime = time;
627 this._updateNetworkRequestWithResponse(networkRequest, response);
628 this._updateNetworkRequest(networkRequest);
629 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.ResponseRec eived, networkRequest);
630 }
631
632 /**
633 * @override
634 * @param {!Protocol.Network.RequestId} requestId
635 * @param {!Protocol.Network.Timestamp} time
636 * @param {string} errorMessage
637 */
638 navigationPreloadFailed(requestId, time, errorMessage) {
639 var networkRequest = this._inflightRequestsById[requestId];
640 if (!networkRequest)
641 return;
642 networkRequest.failed = true;
643 networkRequest.localizedFailDescription = errorMessage;
644 this._finishNetworkRequest(networkRequest, time, -1);
645 }
646
647 /**
648 * @override
649 * @param {!Protocol.Network.RequestId} requestId
650 * @param {!Protocol.Network.Timestamp} time
651 */
652 navigationPreloadFinished(requestId, time) {
653 var networkRequest = this._inflightRequestsById[requestId];
654 if (!networkRequest)
655 return;
656 this._finishNetworkRequest(networkRequest, time, -1);
657 }
658
659 /**
602 * @param {!Protocol.Network.RequestId} requestId 660 * @param {!Protocol.Network.RequestId} requestId
603 * @param {!Protocol.Network.Timestamp} time 661 * @param {!Protocol.Network.Timestamp} time
604 * @param {string} redirectURL 662 * @param {string} redirectURL
605 * @return {!SDK.NetworkRequest} 663 * @return {!SDK.NetworkRequest}
606 */ 664 */
607 _appendRedirect(requestId, time, redirectURL) { 665 _appendRedirect(requestId, time, redirectURL) {
608 var originalNetworkRequest = this._inflightRequestsById[requestId]; 666 var originalNetworkRequest = this._inflightRequestsById[requestId];
609 var previousRedirects = originalNetworkRequest.redirects || []; 667 var previousRedirects = originalNetworkRequest.redirects || [];
610 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length); 668 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length);
611 delete originalNetworkRequest.redirects; 669 delete originalNetworkRequest.redirects;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 SDK.MultitargetNetworkManager.Events = { 966 SDK.MultitargetNetworkManager.Events = {
909 ConditionsChanged: Symbol('ConditionsChanged'), 967 ConditionsChanged: Symbol('ConditionsChanged'),
910 UserAgentChanged: Symbol('UserAgentChanged') 968 UserAgentChanged: Symbol('UserAgentChanged')
911 }; 969 };
912 970
913 971
914 /** 972 /**
915 * @type {!SDK.MultitargetNetworkManager} 973 * @type {!SDK.MultitargetNetworkManager}
916 */ 974 */
917 SDK.multitargetNetworkManager; 975 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698