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

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

Issue 402633002: DevTools: Remove redundant dependency on target from TimelineFrameModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address caseq comments 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 this._delegate.showInDetails("", document.createTextNode("")); 110 this._delegate.showInDetails("", document.createTextNode(""));
111 return; 111 return;
112 } 112 }
113 var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null, false); 113 var contentHelper = new WebInspector.TimelineDetailsContentHelper(null, null, false);
114 contentHelper.appendTextRow(WebInspector.UIString("Name"), record.name); 114 contentHelper.appendTextRow(WebInspector.UIString("Name"), record.name);
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}
122 */
123 function reveal() 121 function reveal()
124 { 122 {
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"])); 123 WebInspector.Revealer.reveal(new WebInspector.DeferredTracingLayerTr ee(record.thread.target(), record.args["snapshot"]["active_tree"]["root_layer"], record.args["snapshot"]["device_viewport_size"]));
126 } 124 }
127 /** 125 /**
128 * @param {!Node=} node 126 * @param {!Node=} node
129 * @this {WebInspector.TimelineTracingView} 127 * @this {WebInspector.TimelineTracingView}
130 */ 128 */
131 function appendPreviewAndShowDetails(node) 129 function appendPreviewAndShowDetails(node)
132 { 130 {
133 if (node) 131 if (node)
134 contentHelper.appendElementRow("Preview", node); 132 contentHelper.appendElementRow("Preview", node);
135 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element); 133 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element);
136 } 134 }
137 var recordTypes = WebInspector.TracingTimelineModel.RecordType; 135 var recordTypes = WebInspector.TracingTimelineModel.RecordType;
138 switch (record.name) { 136 switch (record.name) {
139 case recordTypes.PictureSnapshot: 137 case recordTypes.PictureSnapshot:
140 WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(this. _tracingModel.target(), record.args["snapshot"]["skp64"], appendPreviewAndShowDe tails.bind(this)); 138 WebInspector.TracingTimelineUIUtils.buildPicturePreviewContent(this. _tracingModel.target(), record.args["snapshot"]["skp64"], appendPreviewAndShowDe tails.bind(this));
141 break; 139 break;
142 case recordTypes.LayerTreeHostImplSnapshot: 140 case recordTypes.LayerTreeHostImplSnapshot:
143 var link = document.createElement("span"); 141 var link = document.createElement("span");
144 link.classList.add("revealable-link"); 142 link.classList.add("revealable-link");
145 link.textContent = "show"; 143 link.textContent = "show";
146 link.addEventListener("click", reveal.bind(this), false); 144 link.addEventListener("click", reveal, false);
147 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"), link); 145 contentHelper.appendElementRow(WebInspector.UIString("Layer tree"), link);
148 // Fall-through intended. 146 // Fall-through intended.
149 default: 147 default:
150 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element); 148 this._delegate.showInDetails(WebInspector.UIString("Selected Event") , contentHelper.element);
151 } 149 }
152 }, 150 },
153 151
154 /** 152 /**
155 * @param {!Object} args 153 * @param {!Object} args
156 * @return {!Element} 154 * @return {!Element}
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 /** 545 /**
548 * @param {string} string 546 * @param {string} string
549 * @return {string} 547 * @return {string}
550 */ 548 */
551 colorForString: function(string) 549 colorForString: function(string)
552 { 550 {
553 var hash = WebInspector.TraceViewPalette._stringHash(string); 551 var hash = WebInspector.TraceViewPalette._stringHash(string);
554 return this._palette[hash % this._palette.length]; 552 return this._palette[hash % this._palette.length];
555 } 553 }
556 }; 554 };
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePanel.js ('k') | Source/devtools/front_end/timeline/TracingModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698