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

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

Issue 1323293004: DevTools: Show function deopt reason in timeline details (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 var eventData = event.args["data"]; 613 var eventData = event.args["data"];
614 var initiator = event.initiator; 614 var initiator = event.initiator;
615 615
616 switch (event.name) { 616 switch (event.name) {
617 case recordTypes.GCEvent: 617 case recordTypes.GCEvent:
618 case recordTypes.MajorGC: 618 case recordTypes.MajorGC:
619 case recordTypes.MinorGC: 619 case recordTypes.MinorGC:
620 var delta = event.args["usedHeapSizeBefore"] - event.args["usedHeapSizeA fter"]; 620 var delta = event.args["usedHeapSizeBefore"] - event.args["usedHeapSizeA fter"];
621 contentHelper.appendTextRow(WebInspector.UIString("Collected"), Number.b ytesToString(delta)); 621 contentHelper.appendTextRow(WebInspector.UIString("Collected"), Number.b ytesToString(delta));
622 break; 622 break;
623 case recordTypes.JSFrame:
624 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNodeForTraceE vent(event, model.target(), linkifier);
625 if (detailsNode)
626 contentHelper.appendElementRow(WebInspector.UIString("Function"), de tailsNode);
627 var deoptReason = eventData["deoptReason"];
628 if (deoptReason && deoptReason != "no reason")
629 contentHelper.appendTextRow(WebInspector.UIString("Warning"), WebIns pector.UIString("Not optimized: %s", deoptReason), true);
630 break;
623 case recordTypes.TimerFire: 631 case recordTypes.TimerFire:
624 case recordTypes.TimerInstall: 632 case recordTypes.TimerInstall:
625 case recordTypes.TimerRemove: 633 case recordTypes.TimerRemove:
626 contentHelper.appendTextRow(WebInspector.UIString("Timer ID"), eventData ["timerId"]); 634 contentHelper.appendTextRow(WebInspector.UIString("Timer ID"), eventData ["timerId"]);
627 if (event.name === recordTypes.TimerInstall) { 635 if (event.name === recordTypes.TimerInstall) {
628 contentHelper.appendTextRow(WebInspector.UIString("Timeout"), Number .millisToString(eventData["timeout"])); 636 contentHelper.appendTextRow(WebInspector.UIString("Timeout"), Number .millisToString(eventData["timeout"]));
629 contentHelper.appendTextRow(WebInspector.UIString("Repeats"), !event Data["singleShot"]); 637 contentHelper.appendTextRow(WebInspector.UIString("Repeats"), !event Data["singleShot"]);
630 } 638 }
631 break; 639 break;
632 case recordTypes.FireAnimationFrame: 640 case recordTypes.FireAnimationFrame:
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 nodeForBackendId: function(backendNodeId) 1861 nodeForBackendId: function(backendNodeId)
1854 { 1862 {
1855 if (!backendNodeId || !this._relatedNodesMap) 1863 if (!backendNodeId || !this._relatedNodesMap)
1856 return null; 1864 return null;
1857 return this._relatedNodesMap.get(backendNodeId) || null; 1865 return this._relatedNodesMap.get(backendNodeId) || null;
1858 }, 1866 },
1859 1867
1860 /** 1868 /**
1861 * @param {string} title 1869 * @param {string} title
1862 * @param {string|number|boolean} value 1870 * @param {string|number|boolean} value
1871 * @param {boolean=} isWarning
1863 */ 1872 */
1864 appendTextRow: function(title, value) 1873 appendTextRow: function(title, value, isWarning)
1865 { 1874 {
1866 var rowElement = this.element.createChild("div", "timeline-details-view- row"); 1875 var rowElement = this.element.createChild("div", "timeline-details-view- row");
1876 if (isWarning)
1877 rowElement.classList.add("timeline-details-warning");
1867 rowElement.createChild("div", "timeline-details-view-row-title").textCon tent = title; 1878 rowElement.createChild("div", "timeline-details-view-row-title").textCon tent = title;
1868 rowElement.createChild("div", "timeline-details-view-row-value" + (this. _monospaceValues ? " monospace" : "")).textContent = value; 1879 rowElement.createChild("div", "timeline-details-view-row-value" + (this. _monospaceValues ? " monospace" : "")).textContent = value;
1869 }, 1880 },
1870 1881
1871 /** 1882 /**
1872 * @param {string} title 1883 * @param {string} title
1873 * @param {!Node|string} content 1884 * @param {!Node|string} content
1874 * @param {boolean=} isWarning 1885 * @param {boolean=} isWarning
1875 */ 1886 */
1876 appendElementRow: function(title, content, isWarning) 1887 appendElementRow: function(title, content, isWarning)
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 { 1936 {
1926 if (!this._linkifier || !this._target) 1937 if (!this._linkifier || !this._target)
1927 return; 1938 return;
1928 1939
1929 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace"); 1940 var stackTraceElement = parentElement.createChild("div", "timeline-detai ls-view-row-value timeline-details-view-row-stack-trace monospace");
1930 1941
1931 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace); 1942 var callFrameElem = WebInspector.DOMPresentationUtils.buildStackTracePre viewContents(this._target, this._linkifier, stackTrace);
1932 1943
1933 stackTraceElement.appendChild(callFrameElem); 1944 stackTraceElement.appendChild(callFrameElem);
1934 } 1945 }
1935
1936 } 1946 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698