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

Side by Side Diff: Source/devtools/front_end/TimelineModel.js

Issue 104523002: [DevTools] Add power profiler and power overview in timeline panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 24 matching lines...) Expand all
35 WebInspector.TimelineModel = function() 35 WebInspector.TimelineModel = function()
36 { 36 {
37 this._filters = []; 37 this._filters = [];
38 this._bindings = new WebInspector.TimelineModel.InterRecordBindings(); 38 this._bindings = new WebInspector.TimelineModel.InterRecordBindings();
39 39
40 this.reset(); 40 this.reset();
41 41
42 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineEventRecorded, this._onRecordAdded, this); 42 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineEventRecorded, this._onRecordAdded, this);
43 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStarted, this._onStarted, this); 43 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStarted, this._onStarted, this);
44 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStopped, this._onStopped, this); 44 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E ventTypes.TimelineStopped, this._onStopped, this);
45 if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabiliti es.canProfilePower)
pfeldman 2014/03/11 12:24:02 Timeline model is about timeline events. You shoul
46 WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfiler.E ventTypes.PowerEventRecorded, this._onRecordAdded, this);
45 } 47 }
46 48
47 WebInspector.TimelineModel.TransferChunkLengthBytes = 5000000; 49 WebInspector.TimelineModel.TransferChunkLengthBytes = 5000000;
48 50
49 WebInspector.TimelineModel.RecordType = { 51 WebInspector.TimelineModel.RecordType = {
50 Root: "Root", 52 Root: "Root",
51 Program: "Program", 53 Program: "Program",
52 EventDispatch: "EventDispatch", 54 EventDispatch: "EventDispatch",
53 55
54 GPUTask: "GPUTask", 56 GPUTask: "GPUTask",
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 RequestAnimationFrame: "RequestAnimationFrame", 101 RequestAnimationFrame: "RequestAnimationFrame",
100 CancelAnimationFrame: "CancelAnimationFrame", 102 CancelAnimationFrame: "CancelAnimationFrame",
101 FireAnimationFrame: "FireAnimationFrame", 103 FireAnimationFrame: "FireAnimationFrame",
102 104
103 WebSocketCreate : "WebSocketCreate", 105 WebSocketCreate : "WebSocketCreate",
104 WebSocketSendHandshakeRequest : "WebSocketSendHandshakeRequest", 106 WebSocketSendHandshakeRequest : "WebSocketSendHandshakeRequest",
105 WebSocketReceiveHandshakeResponse : "WebSocketReceiveHandshakeResponse", 107 WebSocketReceiveHandshakeResponse : "WebSocketReceiveHandshakeResponse",
106 WebSocketDestroy : "WebSocketDestroy", 108 WebSocketDestroy : "WebSocketDestroy",
107 109
108 EmbedderCallback : "EmbedderCallback", 110 EmbedderCallback : "EmbedderCallback",
111
112 SoC_Package : "SoC_Package",
109 } 113 }
110 114
111 WebInspector.TimelineModel.Events = { 115 WebInspector.TimelineModel.Events = {
112 RecordAdded: "RecordAdded", 116 RecordAdded: "RecordAdded",
113 RecordsCleared: "RecordsCleared", 117 RecordsCleared: "RecordsCleared",
114 RecordingStarted: "RecordingStarted", 118 RecordingStarted: "RecordingStarted",
115 RecordingStopped: "RecordingStopped", 119 RecordingStopped: "RecordingStopped",
116 RecordFilterChanged: "RecordFilterChanged" 120 RecordFilterChanged: "RecordFilterChanged"
117 } 121 }
118 122
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 /** 219 /**
216 * @param {boolean=} includeCounters 220 * @param {boolean=} includeCounters
217 */ 221 */
218 startRecording: function(includeCounters) 222 startRecording: function(includeCounters)
219 { 223 {
220 this._clientInitiatedRecording = true; 224 this._clientInitiatedRecording = true;
221 this.reset(); 225 this.reset();
222 var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0; 226 var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0;
223 var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEn abled(); 227 var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEn abled();
224 WebInspector.timelineManager.start(maxStackFrames, includeCounters, incl udeGPUEvents, this._fireRecordingStarted.bind(this)); 228 WebInspector.timelineManager.start(maxStackFrames, includeCounters, incl udeGPUEvents, this._fireRecordingStarted.bind(this));
229
230 if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabi lities.canProfilePower)
231 WebInspector.powerProfiler.startProfile();
225 }, 232 },
226 233
227 stopRecording: function() 234 stopRecording: function()
228 { 235 {
236 if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabi lities.canProfilePower)
237 WebInspector.powerProfiler.stopProfile();
238
229 if (!this._clientInitiatedRecording) { 239 if (!this._clientInitiatedRecording) {
230 WebInspector.timelineManager.start(undefined, undefined, undefined, stopTimeline.bind(this)); 240 WebInspector.timelineManager.start(undefined, undefined, undefined, stopTimeline.bind(this));
231 return; 241 return;
232 } 242 }
233 243
234 /** 244 /**
235 * Console started this one and we are just sniffing it. Initiate record ing so that we 245 * Console started this one and we are just sniffing it. Initiate record ing so that we
236 * could stop it. 246 * could stop it.
237 * @this {WebInspector.TimelineModel} 247 * @this {WebInspector.TimelineModel}
238 */ 248 */
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 WebInspector.TimelineModel._quadFromRectData = function(data) 1169 WebInspector.TimelineModel._quadFromRectData = function(data)
1160 { 1170 {
1161 if (typeof data["x"] === "undefined" || typeof data["y"] === "undefined") 1171 if (typeof data["x"] === "undefined" || typeof data["y"] === "undefined")
1162 return null; 1172 return null;
1163 var x0 = data["x"]; 1173 var x0 = data["x"];
1164 var x1 = data["x"] + data["width"]; 1174 var x1 = data["x"] + data["width"];
1165 var y0 = data["y"]; 1175 var y0 = data["y"];
1166 var y1 = data["y"] + data["height"]; 1176 var y1 = data["y"] + data["height"];
1167 return [x0, y0, x1, y0, x1, y1, x0, y1]; 1177 return [x0, y0, x1, y0, x1, y1, x0, y1];
1168 } 1178 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698