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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2668413003: DevTools: extract NetworkConditionsSelector into its own module (Closed)
Patch Set: rebaseline Created 3 years, 10 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 var url = timelineData.url; 775 var url = timelineData.url;
776 if (url) 776 if (url)
777 contentHelper.appendElementRow(Common.UIString('Resource'), Components .Linkifier.linkifyURL(url)); 777 contentHelper.appendElementRow(Common.UIString('Resource'), Components .Linkifier.linkifyURL(url));
778 if (eventData['requestMethod']) 778 if (eventData['requestMethod'])
779 contentHelper.appendTextRow(Common.UIString('Request Method'), eventDa ta['requestMethod']); 779 contentHelper.appendTextRow(Common.UIString('Request Method'), eventDa ta['requestMethod']);
780 if (typeof eventData['statusCode'] === 'number') 780 if (typeof eventData['statusCode'] === 'number')
781 contentHelper.appendTextRow(Common.UIString('Status Code'), eventData[ 'statusCode']); 781 contentHelper.appendTextRow(Common.UIString('Status Code'), eventData[ 'statusCode']);
782 if (eventData['mimeType']) 782 if (eventData['mimeType'])
783 contentHelper.appendTextRow(Common.UIString('MIME Type'), eventData['m imeType']); 783 contentHelper.appendTextRow(Common.UIString('MIME Type'), eventData['m imeType']);
784 if ('priority' in eventData) { 784 if ('priority' in eventData) {
785 var priority = Components.uiLabelForPriority(eventData['priority']); 785 var priority = NetworkConditions.uiLabelForPriority(eventData['priorit y']);
786 contentHelper.appendTextRow(Common.UIString('Priority'), priority); 786 contentHelper.appendTextRow(Common.UIString('Priority'), priority);
787 } 787 }
788 if (eventData['encodedDataLength']) { 788 if (eventData['encodedDataLength']) {
789 contentHelper.appendTextRow( 789 contentHelper.appendTextRow(
790 Common.UIString('Encoded Data Length'), Common.UIString('%d Bytes' , eventData['encodedDataLength'])); 790 Common.UIString('Encoded Data Length'), Common.UIString('%d Bytes' , eventData['encodedDataLength']));
791 } 791 }
792 break; 792 break;
793 case recordTypes.CompileScript: 793 case recordTypes.CompileScript:
794 case recordTypes.EvaluateScript: 794 case recordTypes.EvaluateScript:
795 var url = eventData && eventData['url']; 795 var url = eventData && eventData['url'];
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 1071
1072 const duration = request.endTime - (request.startTime || -Infinity); 1072 const duration = request.endTime - (request.startTime || -Infinity);
1073 if (request.url) 1073 if (request.url)
1074 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie r.linkifyURL(request.url)); 1074 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie r.linkifyURL(request.url));
1075 if (isFinite(duration)) 1075 if (isFinite(duration))
1076 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt ring(duration, true)); 1076 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt ring(duration, true));
1077 if (request.requestMethod) 1077 if (request.requestMethod)
1078 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req uestMethod); 1078 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req uestMethod);
1079 if (typeof request.priority === 'string') { 1079 if (typeof request.priority === 'string') {
1080 const priority = 1080 const priority =
1081 Components.uiLabelForPriority(/** @type {!Protocol.Network.ResourcePri ority} */ (request.priority)); 1081 NetworkConditions.uiLabelForPriority(/** @type {!Protocol.Network.Reso urcePriority} */ (request.priority));
1082 contentHelper.appendTextRow(Common.UIString('Priority'), priority); 1082 contentHelper.appendTextRow(Common.UIString('Priority'), priority);
1083 } 1083 }
1084 if (request.mimeType) 1084 if (request.mimeType)
1085 contentHelper.appendTextRow(Common.UIString('Mime Type'), request.mimeType ); 1085 contentHelper.appendTextRow(Common.UIString('Mime Type'), request.mimeType );
1086 var lengthText = ''; 1086 var lengthText = '';
1087 if (request.fromCache) 1087 if (request.fromCache)
1088 lengthText += Common.UIString('(from cache) '); 1088 lengthText += Common.UIString('(from cache) ');
1089 if (request.fromServiceWorker) 1089 if (request.fromServiceWorker)
1090 lengthText += Common.UIString('(from service worker)'); 1090 lengthText += Common.UIString('(from service worker)');
1091 if (request.encodedDataLength || !lengthText) 1091 if (request.encodedDataLength || !lengthText)
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 scripting: new Timeline.TimelineCategory( 1446 scripting: new Timeline.TimelineCategory(
1447 'scripting', Common.UIString('Scripting'), true, 'hsl(43, 83%, 72%)', 'hsl(43, 83%, 64%) '), 1447 'scripting', Common.UIString('Scripting'), true, 'hsl(43, 83%, 72%)', 'hsl(43, 83%, 64%) '),
1448 rendering: new Timeline.TimelineCategory( 1448 rendering: new Timeline.TimelineCategory(
1449 'rendering', Common.UIString('Rendering'), true, 'hsl(256, 67%, 76%)', 'hsl(256, 67%, 70%)'), 1449 'rendering', Common.UIString('Rendering'), true, 'hsl(256, 67%, 76%)', 'hsl(256, 67%, 70%)'),
1450 painting: new Timeline.TimelineCategory( 1450 painting: new Timeline.TimelineCategory(
1451 'painting', Common.UIString('Painting'), true, 'hsl(109, 33%, 64%)', ' hsl(109, 33%, 55%)'), 1451 'painting', Common.UIString('Painting'), true, 'hsl(109, 33%, 64%)', ' hsl(109, 33%, 55%)'),
1452 gpu: new Timeline.TimelineCategory( 1452 gpu: new Timeline.TimelineCategory(
1453 'gpu', Common.UIString('GPU'), false, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'), 1453 'gpu', Common.UIString('GPU'), false, 'hsl(109, 33%, 64%)', 'hsl(109, 33%, 55%)'),
1454 other: 1454 other:
1455 new Timeline.TimelineCategory('other', Common.UIString('Other'), false , 'hsl(0, 0%, 87%)', 'hsl(0, 0%, 79%)'), 1455 new Timeline.TimelineCategory('other', Common.UIString('Other'), false , 'hsl(0, 0%, 87%)', 'hsl(0, 0%, 79%)'),
1456 idle: new Timeline.TimelineCategory( 1456 idle: new Timeline.TimelineCategory('idle', Common.UIString('Idle'), false , 'hsl(0, 0%, 98%)', 'hsl(0, 0%, 98%)')
1457 'idle', Common.UIString('Idle'), false, 'hsl(0, 0%, 98%)', 'hsl(0, 0%, 98%)')
1458 }; 1457 };
1459 return Timeline.TimelineUIUtils._categories; 1458 return Timeline.TimelineUIUtils._categories;
1460 } 1459 }
1461 1460
1462 /** 1461 /**
1463 * @param {!TimelineModel.TimelineModel.AsyncEventGroup} group 1462 * @param {!TimelineModel.TimelineModel.AsyncEventGroup} group
1464 * @return {string} 1463 * @return {string}
1465 */ 1464 */
1466 static titleForAsyncEventGroup(group) { 1465 static titleForAsyncEventGroup(group) {
1467 if (!Timeline.TimelineUIUtils._titleForAsyncEventGroupMap) { 1466 if (!Timeline.TimelineUIUtils._titleForAsyncEventGroupMap) {
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2273 * @param {string=} warningType 2272 * @param {string=} warningType
2274 */ 2273 */
2275 appendWarningRow(event, warningType) { 2274 appendWarningRow(event, warningType) {
2276 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); 2275 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType);
2277 if (warning) 2276 if (warning)
2278 this.appendElementRow(Common.UIString('Warning'), warning, true); 2277 this.appendElementRow(Common.UIString('Warning'), warning, true);
2279 } 2278 }
2280 }; 2279 };
2281 2280
2282 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); 2281 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698