Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2094 case warnings.V8Deopt: | 2094 case warnings.V8Deopt: |
| 2095 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53", | 2095 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53", |
| 2096 WebInspector.UIString("Not optimized"), undefined, true)); | 2096 WebInspector.UIString("Not optimized"), undefined, true)); |
| 2097 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"])); | 2097 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"])); |
| 2098 break; | 2098 break; |
| 2099 default: | 2099 default: |
| 2100 console.assert(false, "Unhandled TimelineModel.WarningType"); | 2100 console.assert(false, "Unhandled TimelineModel.WarningType"); |
| 2101 } | 2101 } |
| 2102 return span; | 2102 return span; |
| 2103 } | 2103 } |
| 2104 | |
| 2105 /** | |
| 2106 * @constructor | |
| 2107 * @implements {WebInspector.UISourceCodeFrame.LineDecorator} | |
| 2108 */ | |
| 2109 WebInspector.TimelineUIUtils.PerformanceLineDecorator = function() | |
| 2110 { | |
| 2111 } | |
| 2112 | |
| 2113 WebInspector.TimelineUIUtils.PerformanceLineDecorator.prototype = { | |
| 2114 /** | |
| 2115 * @override | |
| 2116 * @param {!WebInspector.UISourceCode} uiSourceCode | |
| 2117 * @param {!WebInspector.CodeMirrorTextEditor} textEditor | |
| 2118 */ | |
| 2119 decorate: function(uiSourceCode, textEditor) | |
| 2120 { | |
| 2121 var type = "performance"; | |
|
caseq
2016/03/11 22:52:06
nit: decoratorType. Also, consider @const.
alph
2016/03/12 00:47:54
Done.
| |
| 2122 var decorations = uiSourceCode.lineDecorations(type) || []; | |
| 2123 textEditor.operation(() => { | |
|
caseq
2016/03/11 22:52:05
nit: extract named function?
alph
2016/03/12 00:47:54
Done.
| |
| 2124 textEditor.resetGutterDecorations(type); | |
| 2125 for (var decoration of decorations) { | |
| 2126 var data = /** @type {!{text: string, intensity: number}} */ (de coration.data()); | |
| 2127 var element = createElementWithClass("div", "text-editor-line-ma rker-performance"); | |
| 2128 element.textContent = data.text; | |
| 2129 element.style.backgroundColor = `rgba(255, 0, 0, ${data.intensit y.toFixed(3)})`; | |
| 2130 textEditor.setGutterDecoration(decoration.line(), type, element) ; | |
| 2131 } | |
| 2132 }); | |
| 2133 } | |
| 2134 } | |
| OLD | NEW |