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

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

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed a test and a stray line Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 2 * Copyright 2014 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 * @implements {WebInspector.TimelineModeView} 9 * @implements {WebInspector.TimelineModeView}
10 * @implements {WebInspector.FlameChartDelegate} 10 * @implements {WebInspector.FlameChartDelegate}
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 contentHelper.appendTextRow(WebInspector.UIString("Category"), record.ca tegory); 115 contentHelper.appendTextRow(WebInspector.UIString("Category"), record.ca tegory);
116 contentHelper.appendTextRow(WebInspector.UIString("Start"), Number.milli sToString(record.startTime - this._tracingModel.minimumRecordTime(), true)); 116 contentHelper.appendTextRow(WebInspector.UIString("Start"), Number.milli sToString(record.startTime - this._tracingModel.minimumRecordTime(), true));
117 contentHelper.appendTextRow(WebInspector.UIString("Duration"), Number.mi llisToString(record.duration, true)); 117 contentHelper.appendTextRow(WebInspector.UIString("Duration"), Number.mi llisToString(record.duration, true));
118 if (!Object.isEmpty(record.args)) 118 if (!Object.isEmpty(record.args))
119 contentHelper.appendElementRow(WebInspector.UIString("Arguments"), t his._formatArguments(record.args)); 119 contentHelper.appendElementRow(WebInspector.UIString("Arguments"), t his._formatArguments(record.args));
120 /** 120 /**
121 * @this {WebInspector.TimelineTracingView} 121 * @this {WebInspector.TimelineTracingView}
122 */ 122 */
123 function reveal() 123 function reveal()
124 { 124 {
125 WebInspector.Revealer.reveal(new WebInspector.DeferredTracingLayerTr ee(this._tracingModel.target(), record.args["snapshot"]["active_tree"]["root_lay er"], record.args["snapshot"]["device_viewport_size"])); 125 WebInspector.Revealer.reveal(new WebInspector.DeferredTracingLayerTr ee(this._tracingModel.target().weakReference(), record.args["snapshot"]["active_ tree"]["root_layer"], record.args["snapshot"]["device_viewport_size"]));
126 } 126 }
127 /** 127 /**
128 * @param {!Node=} node 128 * @param {!Node=} node
129 * @this {WebInspector.TimelineTracingView} 129 * @this {WebInspector.TimelineTracingView}
130 */ 130 */
131 function appendPreviewAndshowDetails(node) 131 function appendPreviewAndShowDetails(node)
132 { 132 {
133 if (node) 133 if (node)
134 contentHelper.appendElementRow("Preview", node); 134 contentHelper.appendElementRow("Preview", node);
135 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element); 135 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element);
136 } 136 }
137 var recordTypes = WebInspector.TracingTimelineModel.RecordType; 137 var recordTypes = WebInspector.TracingTimelineModel.RecordType;
138 switch (record.name) { 138 switch (record.name) {
139 case recordTypes.PictureSnapshot: 139 case recordTypes.PictureSnapshot:
140 WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(recor d.args["snapshot"]["skp64"], appendPreviewAndshowDetails.bind(this)); 140 WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(this. _tracingModel.target(), record.args["snapshot"]["skp64"], appendPreviewAndShowDe tails.bind(this));
141 break; 141 break;
142 case recordTypes.LayerTreeHostImplSnapshot: 142 case recordTypes.LayerTreeHostImplSnapshot:
143 var link = document.createElement("span"); 143 var link = document.createElement("span");
144 link.classList.add("revealable-link"); 144 link.classList.add("revealable-link");
145 link.textContent = "show"; 145 link.textContent = "show";
146 link.addEventListener("click", reveal.bind(this), false); 146 link.addEventListener("click", reveal.bind(this), false);
147 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"), link); 147 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"), link);
148 // Fall-through intended. 148 // Fall-through intended.
149 default: 149 default:
150 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element); 150 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 /** 547 /**
548 * @param {string} string 548 * @param {string} string
549 * @return {string} 549 * @return {string}
550 */ 550 */
551 colorForString: function(string) 551 colorForString: function(string)
552 { 552 {
553 var hash = WebInspector.TraceViewPalette._stringHash(string); 553 var hash = WebInspector.TraceViewPalette._stringHash(string);
554 return this._palette[hash % this._palette.length]; 554 return this._palette[hash % this._palette.length];
555 } 555 }
556 }; 556 };
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698