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

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

Issue 2921053002: [Devtools] Removed "redirects" from NetworkRequest to use redirectSource (Closed)
Patch Set: Merge branch 'MOVE_NETWORK_STUFF_AROUND' into REMOVE_REDIRECTS_REBASE Created 3 years, 6 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 629 }
630 630
631 /** 631 /**
632 * @param {!Protocol.Network.RequestId} requestId 632 * @param {!Protocol.Network.RequestId} requestId
633 * @param {!Protocol.Network.Timestamp} time 633 * @param {!Protocol.Network.Timestamp} time
634 * @param {string} redirectURL 634 * @param {string} redirectURL
635 * @return {!SDK.NetworkRequest} 635 * @return {!SDK.NetworkRequest}
636 */ 636 */
637 _appendRedirect(requestId, time, redirectURL) { 637 _appendRedirect(requestId, time, redirectURL) {
638 var originalNetworkRequest = this._inflightRequestsById[requestId]; 638 var originalNetworkRequest = this._inflightRequestsById[requestId];
639 var previousRedirects = originalNetworkRequest.redirects || []; 639 var redirectCount = 0;
640 originalNetworkRequest.setRequestId(requestId + ':redirected.' + previousRed irects.length); 640 for (var redirect = originalNetworkRequest.redirectSource(); redirect; redir ect = redirect.redirectSource())
641 delete originalNetworkRequest.redirects; 641 redirectCount++;
642 if (previousRedirects.length > 0) 642
643 originalNetworkRequest.redirectSource = previousRedirects[previousRedirect s.length - 1]; 643 originalNetworkRequest.setRequestId(requestId + ':redirected.' + redirectCou nt);
644 this._finishNetworkRequest(originalNetworkRequest, time, -1); 644 this._finishNetworkRequest(originalNetworkRequest, time, -1);
645 var newNetworkRequest = this._createNetworkRequest( 645 var newNetworkRequest = this._createNetworkRequest(
646 requestId, originalNetworkRequest.frameId, originalNetworkRequest.loader Id, redirectURL, 646 requestId, originalNetworkRequest.frameId, originalNetworkRequest.loader Id, redirectURL,
647 originalNetworkRequest.documentURL, originalNetworkRequest.initiator()); 647 originalNetworkRequest.documentURL, originalNetworkRequest.initiator());
648 newNetworkRequest.redirects = previousRedirects.concat(originalNetworkReques t); 648 newNetworkRequest.setRedirectSource(originalNetworkRequest);
649 return newNetworkRequest; 649 return newNetworkRequest;
650 } 650 }
651 651
652 /** 652 /**
653 * @param {!SDK.NetworkRequest} networkRequest 653 * @param {!SDK.NetworkRequest} networkRequest
654 */ 654 */
655 _startNetworkRequest(networkRequest) { 655 _startNetworkRequest(networkRequest) {
656 this._inflightRequestsById[networkRequest.requestId()] = networkRequest; 656 this._inflightRequestsById[networkRequest.requestId()] = networkRequest;
657 this._inflightRequestsByURL[networkRequest.url()] = networkRequest; 657 this._inflightRequestsByURL[networkRequest.url()] = networkRequest;
658 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.RequestStar ted, networkRequest); 658 this._manager.dispatchEventToListeners(SDK.NetworkManager.Events.RequestStar ted, networkRequest);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 SDK.MultitargetNetworkManager.Events = { 956 SDK.MultitargetNetworkManager.Events = {
957 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), 957 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'),
958 ConditionsChanged: Symbol('ConditionsChanged'), 958 ConditionsChanged: Symbol('ConditionsChanged'),
959 UserAgentChanged: Symbol('UserAgentChanged') 959 UserAgentChanged: Symbol('UserAgentChanged')
960 }; 960 };
961 961
962 /** 962 /**
963 * @type {!SDK.MultitargetNetworkManager} 963 * @type {!SDK.MultitargetNetworkManager}
964 */ 964 */
965 SDK.multitargetNetworkManager; 965 SDK.multitargetNetworkManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698