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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.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) 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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 url = timelineData.url; 820 url = timelineData.url;
821 if (url) 821 if (url)
822 contentHelper.appendElementRow(Common.UIString('Resource'), Components .Linkifier.linkifyURL(url)); 822 contentHelper.appendElementRow(Common.UIString('Resource'), Components .Linkifier.linkifyURL(url));
823 if (eventData['requestMethod']) 823 if (eventData['requestMethod'])
824 contentHelper.appendTextRow(Common.UIString('Request Method'), eventDa ta['requestMethod']); 824 contentHelper.appendTextRow(Common.UIString('Request Method'), eventDa ta['requestMethod']);
825 if (typeof eventData['statusCode'] === 'number') 825 if (typeof eventData['statusCode'] === 'number')
826 contentHelper.appendTextRow(Common.UIString('Status Code'), eventData[ 'statusCode']); 826 contentHelper.appendTextRow(Common.UIString('Status Code'), eventData[ 'statusCode']);
827 if (eventData['mimeType']) 827 if (eventData['mimeType'])
828 contentHelper.appendTextRow(Common.UIString('MIME Type'), eventData['m imeType']); 828 contentHelper.appendTextRow(Common.UIString('MIME Type'), eventData['m imeType']);
829 if ('priority' in eventData) { 829 if ('priority' in eventData) {
830 var priority = NetworkConditions.uiLabelForPriority(eventData['priorit y']); 830 var priority = NetworkPriorities.uiLabelForPriority(eventData['priorit y']);
831 contentHelper.appendTextRow(Common.UIString('Priority'), priority); 831 contentHelper.appendTextRow(Common.UIString('Priority'), priority);
832 } 832 }
833 if (eventData['encodedDataLength']) { 833 if (eventData['encodedDataLength']) {
834 contentHelper.appendTextRow( 834 contentHelper.appendTextRow(
835 Common.UIString('Encoded Data'), Common.UIString('%d Bytes', event Data['encodedDataLength'])); 835 Common.UIString('Encoded Data'), Common.UIString('%d Bytes', event Data['encodedDataLength']));
836 } 836 }
837 if (eventData['decodedBodyLength']) { 837 if (eventData['decodedBodyLength']) {
838 contentHelper.appendTextRow( 838 contentHelper.appendTextRow(
839 Common.UIString('Decoded Body'), Common.UIString('%d Bytes', event Data['decodedBodyLength'])); 839 Common.UIString('Decoded Body'), Common.UIString('%d Bytes', event Data['decodedBodyLength']));
840 } 840 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 const duration = request.endTime - (request.startTime || -Infinity); 1137 const duration = request.endTime - (request.startTime || -Infinity);
1138 if (request.url) 1138 if (request.url)
1139 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie r.linkifyURL(request.url)); 1139 contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifie r.linkifyURL(request.url));
1140 Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, badgePo ol, request.url); 1140 Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, badgePo ol, request.url);
1141 if (isFinite(duration)) 1141 if (isFinite(duration))
1142 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt ring(duration, true)); 1142 contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToSt ring(duration, true));
1143 if (request.requestMethod) 1143 if (request.requestMethod)
1144 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req uestMethod); 1144 contentHelper.appendTextRow(Common.UIString('Request Method'), request.req uestMethod);
1145 if (typeof request.priority === 'string') { 1145 if (typeof request.priority === 'string') {
1146 const priority = 1146 const priority =
1147 NetworkConditions.uiLabelForPriority(/** @type {!Protocol.Network.Reso urcePriority} */ (request.priority)); 1147 NetworkPriorities.uiLabelForPriority(/** @type {!Protocol.Network.Reso urcePriority} */ (request.priority));
1148 contentHelper.appendTextRow(Common.UIString('Priority'), priority); 1148 contentHelper.appendTextRow(Common.UIString('Priority'), priority);
1149 } 1149 }
1150 if (request.mimeType) 1150 if (request.mimeType)
1151 contentHelper.appendTextRow(Common.UIString('Mime Type'), request.mimeType ); 1151 contentHelper.appendTextRow(Common.UIString('Mime Type'), request.mimeType );
1152 var lengthText = ''; 1152 var lengthText = '';
1153 if (request.fromCache) 1153 if (request.fromCache)
1154 lengthText += Common.UIString(' (from cache)'); 1154 lengthText += Common.UIString(' (from cache)');
1155 if (request.fromServiceWorker) 1155 if (request.fromServiceWorker)
1156 lengthText += Common.UIString(' (from service worker)'); 1156 lengthText += Common.UIString(' (from service worker)');
1157 if (request.encodedDataLength || !lengthText) 1157 if (request.encodedDataLength || !lengthText)
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2313 * @param {string=} warningType 2313 * @param {string=} warningType
2314 */ 2314 */
2315 appendWarningRow(event, warningType) { 2315 appendWarningRow(event, warningType) {
2316 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); 2316 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType);
2317 if (warning) 2317 if (warning)
2318 this.appendElementRow(Common.UIString('Warning'), warning, true); 2318 this.appendElementRow(Common.UIString('Warning'), warning, true);
2319 } 2319 }
2320 }; 2320 };
2321 2321
2322 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); 2322 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698