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

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

Issue 713913002: DevTools: merge TracingTimelineUIUtils into TimelineUIUtils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Deleted instance refs Created 6 years, 1 month 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 */ 272 */
273 _addBackgroundTraceEvent: function(event) 273 _addBackgroundTraceEvent: function(event)
274 { 274 {
275 var eventNames = WebInspector.TracingTimelineModel.RecordType; 275 var eventNames = WebInspector.TracingTimelineModel.RecordType;
276 if (event.phase === WebInspector.TracingModel.Phase.SnapshotObject && ev ent.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === t his._layerTreeId) { 276 if (event.phase === WebInspector.TracingModel.Phase.SnapshotObject && ev ent.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === t his._layerTreeId) {
277 var snapshot = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event); 277 var snapshot = /** @type {!WebInspector.TracingModel.ObjectSnapshot} */ (event);
278 this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTr ee(snapshot)); 278 this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTr ee(snapshot));
279 return; 279 return;
280 } 280 }
281 if (this._lastFrame && event.selfTime) 281 if (this._lastFrame && event.selfTime)
282 this._lastFrame._addTimeForCategory(WebInspector.TracingTimelineUIUt ils.eventStyle(event).category.name, event.selfTime); 282 this._lastFrame._addTimeForCategory(WebInspector.TimelineUIUtils.eve ntStyle(event).category.name, event.selfTime);
283 283
284 if (event.args["layerTreeId"] !== this._layerTreeId) 284 if (event.args["layerTreeId"] !== this._layerTreeId)
285 return; 285 return;
286 286
287 var timestamp = event.startTime; 287 var timestamp = event.startTime;
288 if (event.name === eventNames.BeginFrame) 288 if (event.name === eventNames.BeginFrame)
289 this.handleBeginFrame(timestamp); 289 this.handleBeginFrame(timestamp);
290 else if (event.name === eventNames.DrawFrame) 290 else if (event.name === eventNames.DrawFrame)
291 this.handleDrawFrame(timestamp); 291 this.handleDrawFrame(timestamp);
292 else if (event.name === eventNames.ActivateLayerTree) 292 else if (event.name === eventNames.ActivateLayerTree)
(...skipping 12 matching lines...) Expand all
305 var selfTime = event.selfTime || 0; 305 var selfTime = event.selfTime || 0;
306 306
307 if (!this._hasThreadedCompositing) { 307 if (!this._hasThreadedCompositing) {
308 if (event.name === eventNames.BeginMainThreadFrame) 308 if (event.name === eventNames.BeginMainThreadFrame)
309 this._startMainThreadFrame(timestamp); 309 this._startMainThreadFrame(timestamp);
310 if (!this._lastFrame) 310 if (!this._lastFrame)
311 return; 311 return;
312 if (!selfTime) 312 if (!selfTime)
313 return; 313 return;
314 314
315 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev ent).category.name; 315 var categoryName = WebInspector.TimelineUIUtils.eventStyle(event).ca tegory.name;
316 this._lastFrame._addTimeForCategory(categoryName, selfTime); 316 this._lastFrame._addTimeForCategory(categoryName, selfTime);
317 return; 317 return;
318 } 318 }
319 319
320 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel. _mainFrameMarkers.indexOf(event.name) >= 0) 320 if (!this._framePendingCommit && WebInspector.TracingTimelineFrameModel. _mainFrameMarkers.indexOf(event.name) >= 0)
321 this._framePendingCommit = new WebInspector.PendingFrame(); 321 this._framePendingCommit = new WebInspector.PendingFrame();
322 if (!this._framePendingCommit) 322 if (!this._framePendingCommit)
323 return; 323 return;
324 if (event.name === eventNames.Paint && event.args["data"]["layerId"] && event.picture) 324 if (event.name === eventNames.Paint && event.args["data"]["layerId"] && event.picture)
325 this._framePendingCommit.paints.push(new WebInspector.LayerPaintEven t(event)); 325 this._framePendingCommit.paints.push(new WebInspector.LayerPaintEven t(event));
326 326
327 if (selfTime) { 327 if (selfTime) {
328 var categoryName = WebInspector.TracingTimelineUIUtils.eventStyle(ev ent).category.name; 328 var categoryName = WebInspector.TimelineUIUtils.eventStyle(event).ca tegory.name;
329 this._framePendingCommit.timeByCategory[categoryName] = (this._frame PendingCommit.timeByCategory[categoryName] || 0) + selfTime; 329 this._framePendingCommit.timeByCategory[categoryName] = (this._frame PendingCommit.timeByCategory[categoryName] || 0) + selfTime;
330 } 330 }
331 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId "] === this._layerTreeId) 331 if (event.name === eventNames.CompositeLayers && event.args["layerTreeId "] === this._layerTreeId)
332 this.handleCompositeLayers(); 332 this.handleCompositeLayers();
333 }, 333 },
334 334
335 __proto__: WebInspector.TimelineFrameModelBase.prototype 335 __proto__: WebInspector.TimelineFrameModelBase.prototype
336 } 336 }
337 337
338 /** 338 /**
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 /** 519 /**
520 * @constructor 520 * @constructor
521 */ 521 */
522 WebInspector.PendingFrame = function() 522 WebInspector.PendingFrame = function()
523 { 523 {
524 /** @type {!Object.<string, number>} */ 524 /** @type {!Object.<string, number>} */
525 this.timeByCategory = {}; 525 this.timeByCategory = {};
526 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */ 526 /** @type {!Array.<!WebInspector.LayerPaintEvent>} */
527 this.paints = []; 527 this.paints = [];
528 } 528 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | Source/devtools/front_end/timeline/TimelineMemoryOverview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698