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

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

Issue 336373002: Parametrize TimelinePresentationModel with coalescable record types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 recordStyles[recordTypes.WebSocketCreate] = { title: WebInspector.UIString(" Create WebSocket"), category: categories["scripting"] }; 101 recordStyles[recordTypes.WebSocketCreate] = { title: WebInspector.UIString(" Create WebSocket"), category: categories["scripting"] };
102 recordStyles[recordTypes.WebSocketSendHandshakeRequest] = { title: WebInspec tor.UIString("Send WebSocket Handshake"), category: categories["scripting"] }; 102 recordStyles[recordTypes.WebSocketSendHandshakeRequest] = { title: WebInspec tor.UIString("Send WebSocket Handshake"), category: categories["scripting"] };
103 recordStyles[recordTypes.WebSocketReceiveHandshakeResponse] = { title: WebIn spector.UIString("Receive WebSocket Handshake"), category: categories["scripting "] }; 103 recordStyles[recordTypes.WebSocketReceiveHandshakeResponse] = { title: WebIn spector.UIString("Receive WebSocket Handshake"), category: categories["scripting "] };
104 recordStyles[recordTypes.WebSocketDestroy] = { title: WebInspector.UIString( "Destroy WebSocket"), category: categories["scripting"] }; 104 recordStyles[recordTypes.WebSocketDestroy] = { title: WebInspector.UIString( "Destroy WebSocket"), category: categories["scripting"] };
105 recordStyles[recordTypes.EmbedderCallback] = { title: WebInspector.UIString( "Embedder Callback"), category: categories["scripting"] }; 105 recordStyles[recordTypes.EmbedderCallback] = { title: WebInspector.UIString( "Embedder Callback"), category: categories["scripting"] };
106 106
107 WebInspector.TimelineUIUtils._recordStylesMap = recordStyles; 107 WebInspector.TimelineUIUtils._recordStylesMap = recordStyles;
108 return recordStyles; 108 return recordStyles;
109 } 109 }
110 110
111 WebInspector.TimelineUIUtils.coalescableRecordTypes = {};
112 WebInspector.TimelineUIUtils.coalescableRecordTypes[WebInspector.TimelineModel.R ecordType.Layout] = 1;
113 WebInspector.TimelineUIUtils.coalescableRecordTypes[WebInspector.TimelineModel.R ecordType.Paint] = 1;
114 WebInspector.TimelineUIUtils.coalescableRecordTypes[WebInspector.TimelineModel.R ecordType.Rasterize] = 1;
115 WebInspector.TimelineUIUtils.coalescableRecordTypes[WebInspector.TimelineModel.R ecordType.DecodeImage] = 1;
116 WebInspector.TimelineUIUtils.coalescableRecordTypes[WebInspector.TimelineModel.R ecordType.ResizeImage] = 1;
117
111 /** 118 /**
112 * @param {!WebInspector.TimelineModel.Record} record 119 * @param {!WebInspector.TimelineModel.Record} record
113 * @return {!{title: string, category: !WebInspector.TimelineCategory}} 120 * @return {!{title: string, category: !WebInspector.TimelineCategory}}
114 */ 121 */
115 WebInspector.TimelineUIUtils.recordStyle = function(record) 122 WebInspector.TimelineUIUtils.recordStyle = function(record)
116 { 123 {
117 return WebInspector.TimelineUIUtils.styleForTimelineEvent(record.type()); 124 return WebInspector.TimelineUIUtils.styleForTimelineEvent(record.type());
118 } 125 }
119 126
120 /** 127 /**
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 for (var i = 0; i < stackTrace.length; ++i) { 1001 for (var i = 0; i < stackTrace.length; ++i) {
995 var stackFrame = stackTrace[i]; 1002 var stackFrame = stackTrace[i];
996 var row = stackTraceElement.createChild("div"); 1003 var row = stackTraceElement.createChild("div");
997 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)")); 1004 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)"));
998 row.createTextChild(" @ "); 1005 row.createTextChild(" @ ");
999 var urlElement = this._linkifier.linkifyLocation(this._target, stack Frame.url, stackFrame.lineNumber - 1); 1006 var urlElement = this._linkifier.linkifyLocation(this._target, stack Frame.url, stackFrame.lineNumber - 1);
1000 row.appendChild(urlElement); 1007 row.appendChild(urlElement);
1001 } 1008 }
1002 } 1009 }
1003 } 1010 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePresentationModel.js ('k') | Source/devtools/front_end/timeline/TimelineView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698