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

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

Issue 2915883002: DevTools: prepare to unify Network and CPU throttling UI (Closed)
Patch Set: gs 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) 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 * @param {!Network.NetworkNode} a 480 * @param {!Network.NetworkNode} a
481 * @param {!Network.NetworkNode} b 481 * @param {!Network.NetworkNode} b
482 * @return {number} 482 * @return {number}
483 */ 483 */
484 static InitialPriorityComparator(a, b) { 484 static InitialPriorityComparator(a, b) {
485 // TODO(allada) Handle this properly for group nodes. 485 // TODO(allada) Handle this properly for group nodes.
486 var aRequest = a.requestOrFirstKnownChildRequest(); 486 var aRequest = a.requestOrFirstKnownChildRequest();
487 var bRequest = b.requestOrFirstKnownChildRequest(); 487 var bRequest = b.requestOrFirstKnownChildRequest();
488 if (!aRequest || !bRequest) 488 if (!aRequest || !bRequest)
489 return !aRequest ? -1 : 1; 489 return !aRequest ? -1 : 1;
490 var priorityMap = NetworkConditions.prioritySymbolToNumericMap(); 490 var priorityMap = NetworkPriorities.prioritySymbolToNumericMap();
491 var aPriority = aRequest.initialPriority(); 491 var aPriority = aRequest.initialPriority();
492 var aScore = aPriority ? priorityMap.get(aPriority) : 0; 492 var aScore = aPriority ? priorityMap.get(aPriority) : 0;
493 aScore = aScore || 0; 493 aScore = aScore || 0;
494 var bPriority = aRequest.initialPriority(); 494 var bPriority = aRequest.initialPriority();
495 var bScore = bPriority ? priorityMap.get(bPriority) : 0; 495 var bScore = bPriority ? priorityMap.get(bPriority) : 0;
496 bScore = bScore || 0; 496 bScore = bScore || 0;
497 497
498 return aScore - bScore || aRequest.indentityCompare(bRequest); 498 return aScore - bScore || aRequest.indentityCompare(bRequest);
499 } 499 }
500 500
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 this._setTextAndTitle(cell, this._request.remoteAddress()); 758 this._setTextAndTitle(cell, this._request.remoteAddress());
759 break; 759 break;
760 case 'cookies': 760 case 'cookies':
761 this._setTextAndTitle(cell, this._arrayLength(this._request.requestCooki es)); 761 this._setTextAndTitle(cell, this._arrayLength(this._request.requestCooki es));
762 break; 762 break;
763 case 'setcookies': 763 case 'setcookies':
764 this._setTextAndTitle(cell, this._arrayLength(this._request.responseCook ies)); 764 this._setTextAndTitle(cell, this._arrayLength(this._request.responseCook ies));
765 break; 765 break;
766 case 'priority': 766 case 'priority':
767 var priority = this._request.initialPriority(); 767 var priority = this._request.initialPriority();
768 this._setTextAndTitle(cell, priority ? NetworkConditions.uiLabelForPrior ity(priority) : ''); 768 this._setTextAndTitle(cell, priority ? NetworkPriorities.uiLabelForPrior ity(priority) : '');
769 break; 769 break;
770 case 'connectionid': 770 case 'connectionid':
771 this._setTextAndTitle(cell, this._request.connectionId); 771 this._setTextAndTitle(cell, this._request.connectionId);
772 break; 772 break;
773 case 'type': 773 case 'type':
774 this._setTextAndTitle(cell, this.displayType()); 774 this._setTextAndTitle(cell, this.displayType());
775 break; 775 break;
776 case 'initiator': 776 case 'initiator':
777 this._renderInitiatorCell(cell); 777 this._renderInitiatorCell(cell);
778 break; 778 break;
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 * @param {boolean=} supressSelectedEvent 1037 * @param {boolean=} supressSelectedEvent
1038 */ 1038 */
1039 select(supressSelectedEvent) { 1039 select(supressSelectedEvent) {
1040 if (this.expanded) { 1040 if (this.expanded) {
1041 this.collapse(); 1041 this.collapse();
1042 return; 1042 return;
1043 } 1043 }
1044 this.expand(); 1044 this.expand();
1045 } 1045 }
1046 }; 1046 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698