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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkDataGridNode.js

Issue 2758673002: [DevTools] Extract NetworkLog and HAREntry to a separate network_log module (Closed)
Patch Set: rebased Created 3 years, 9 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 * @param {!Network.NetworkNode} a 291 * @param {!Network.NetworkNode} a
292 * @param {!Network.NetworkNode} b 292 * @param {!Network.NetworkNode} b
293 * @return {number} 293 * @return {number}
294 */ 294 */
295 static InitiatorComparator(a, b) { 295 static InitiatorComparator(a, b) {
296 // TODO(allada) Handle this properly for group nodes. 296 // TODO(allada) Handle this properly for group nodes.
297 var aRequest = a.requestOrFirstKnownChildRequest(); 297 var aRequest = a.requestOrFirstKnownChildRequest();
298 var bRequest = b.requestOrFirstKnownChildRequest(); 298 var bRequest = b.requestOrFirstKnownChildRequest();
299 if (!aRequest || !bRequest) 299 if (!aRequest || !bRequest)
300 return !aRequest ? -1 : 1; 300 return !aRequest ? -1 : 1;
301 var aInitiator = SDK.networkLog.initiatorInfoForRequest(aRequest); 301 var aInitiator = NetworkLog.networkLog.initiatorInfoForRequest(aRequest);
302 var bInitiator = SDK.networkLog.initiatorInfoForRequest(bRequest); 302 var bInitiator = NetworkLog.networkLog.initiatorInfoForRequest(bRequest);
303 303
304 if (aInitiator.type < bInitiator.type) 304 if (aInitiator.type < bInitiator.type)
305 return -1; 305 return -1;
306 if (aInitiator.type > bInitiator.type) 306 if (aInitiator.type > bInitiator.type)
307 return 1; 307 return 1;
308 308
309 if (typeof aInitiator.__source === 'undefined') 309 if (typeof aInitiator.__source === 'undefined')
310 aInitiator.__source = Bindings.displayNameForURL(aInitiator.url); 310 aInitiator.__source = Bindings.displayNameForURL(aInitiator.url);
311 if (typeof bInitiator.__source === 'undefined') 311 if (typeof bInitiator.__source === 'undefined')
312 bInitiator.__source = Bindings.displayNameForURL(bInitiator.url); 312 bInitiator.__source = Bindings.displayNameForURL(bInitiator.url);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 return aRequest.indentityCompare(bRequest); 462 return aRequest.indentityCompare(bRequest);
463 return aValue > bValue ? 1 : -1; 463 return aValue > bValue ? 1 : -1;
464 } 464 }
465 465
466 /** 466 /**
467 * @override 467 * @override
468 */ 468 */
469 showingInitiatorChainChanged() { 469 showingInitiatorChainChanged() {
470 var showInitiatorChain = this.showingInitiatorChain(); 470 var showInitiatorChain = this.showingInitiatorChain();
471 471
472 var initiatorGraph = SDK.networkLog.initiatorGraphForRequest(this._request); 472 var initiatorGraph = NetworkLog.networkLog.initiatorGraphForRequest(this._re quest);
473 for (var request of initiatorGraph.initiators) { 473 for (var request of initiatorGraph.initiators) {
474 if (request === this._request) 474 if (request === this._request)
475 continue; 475 continue;
476 var node = this.parentView().nodeForRequest(request); 476 var node = this.parentView().nodeForRequest(request);
477 if (!node) 477 if (!node)
478 continue; 478 continue;
479 node._setIsOnInitiatorPath(showInitiatorChain); 479 node._setIsOnInitiatorPath(showInitiatorChain);
480 } 480 }
481 for (var request of initiatorGraph.initiated) { 481 for (var request of initiatorGraph.initiated) {
482 if (request === this._request) 482 if (request === this._request)
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 _arrayLength(array) { 669 _arrayLength(array) {
670 return array ? '' + array.length : ''; 670 return array ? '' + array.length : '';
671 } 671 }
672 672
673 /** 673 /**
674 * @override 674 * @override
675 * @protected 675 * @protected
676 */ 676 */
677 willAttach() { 677 willAttach() {
678 if (this._initiatorCell && 678 if (this._initiatorCell &&
679 SDK.networkLog.initiatorInfoForRequest(this._request).type === SDK.Netwo rkRequest.InitiatorType.Script) 679 NetworkLog.networkLog.initiatorInfoForRequest(this._request).type === SD K.NetworkRequest.InitiatorType.Script)
680 this._initiatorCell.insertBefore(this._linkifiedInitiatorAnchor, this._ini tiatorCell.firstChild); 680 this._initiatorCell.insertBefore(this._linkifiedInitiatorAnchor, this._ini tiatorCell.firstChild);
681 } 681 }
682 682
683 /** 683 /**
684 * @override 684 * @override
685 */ 685 */
686 wasDetached() { 686 wasDetached() {
687 if (this._linkifiedInitiatorAnchor) 687 if (this._linkifiedInitiatorAnchor)
688 this._linkifiedInitiatorAnchor.remove(); 688 this._linkifiedInitiatorAnchor.remove();
689 } 689 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 this._setTextAndTitle(cell, Common.UIString('(pending)')); 803 this._setTextAndTitle(cell, Common.UIString('(pending)'));
804 } 804 }
805 } 805 }
806 806
807 /** 807 /**
808 * @param {!Element} cell 808 * @param {!Element} cell
809 */ 809 */
810 _renderInitiatorCell(cell) { 810 _renderInitiatorCell(cell) {
811 this._initiatorCell = cell; 811 this._initiatorCell = cell;
812 var request = this._request; 812 var request = this._request;
813 var initiator = SDK.networkLog.initiatorInfoForRequest(request); 813 var initiator = NetworkLog.networkLog.initiatorInfoForRequest(request);
814 814
815 if (request.timing && request.timing.pushStart) 815 if (request.timing && request.timing.pushStart)
816 cell.appendChild(createTextNode(Common.UIString('Push / '))); 816 cell.appendChild(createTextNode(Common.UIString('Push / ')));
817 switch (initiator.type) { 817 switch (initiator.type) {
818 case SDK.NetworkRequest.InitiatorType.Parser: 818 case SDK.NetworkRequest.InitiatorType.Parser:
819 cell.title = initiator.url + ':' + (initiator.lineNumber + 1); 819 cell.title = initiator.url + ':' + (initiator.lineNumber + 1);
820 var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(initiator.url) ; 820 var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(initiator.url) ;
821 cell.appendChild(Components.Linkifier.linkifyURL( 821 cell.appendChild(Components.Linkifier.linkifyURL(
822 initiator.url, uiSourceCode ? uiSourceCode.displayName() : undefined , '', initiator.lineNumber, 822 initiator.url, uiSourceCode ? uiSourceCode.displayName() : undefined , '', initiator.lineNumber,
823 initiator.columnNumber)); 823 initiator.columnNumber));
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 * @param {boolean=} supressSelectedEvent 968 * @param {boolean=} supressSelectedEvent
969 */ 969 */
970 select(supressSelectedEvent) { 970 select(supressSelectedEvent) {
971 if (this.expanded) { 971 if (this.expanded) {
972 this.collapse(); 972 this.collapse();
973 return; 973 return;
974 } 974 }
975 this.expand(); 975 this.expand();
976 } 976 }
977 }; 977 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698