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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/TimelineModel.js
diff --git a/Source/devtools/front_end/TimelineModel.js b/Source/devtools/front_end/TimelineModel.js
index 93d0c9eae03e6660312769a91f65e54c5440dee6..79dc380fa478c290093a5984653a88bb4429b25c 100644
--- a/Source/devtools/front_end/TimelineModel.js
+++ b/Source/devtools/front_end/TimelineModel.js
@@ -42,6 +42,8 @@ WebInspector.TimelineModel = function()
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, this._onRecordAdded, this);
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, this._onStarted, this);
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, this._onStopped, this);
+ if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabilities.canProfilePower)
pfeldman 2014/03/11 12:24:02 Timeline model is about timeline events. You shoul
+ WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfiler.EventTypes.PowerEventRecorded, this._onRecordAdded, this);
}
WebInspector.TimelineModel.TransferChunkLengthBytes = 5000000;
@@ -106,6 +108,8 @@ WebInspector.TimelineModel.RecordType = {
WebSocketDestroy : "WebSocketDestroy",
EmbedderCallback : "EmbedderCallback",
+
+ SoC_Package : "SoC_Package",
}
WebInspector.TimelineModel.Events = {
@@ -222,10 +226,16 @@ WebInspector.TimelineModel.prototype = {
var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0;
var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEnabled();
WebInspector.timelineManager.start(maxStackFrames, includeCounters, includeGPUEvents, this._fireRecordingStarted.bind(this));
+
+ if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabilities.canProfilePower)
+ WebInspector.powerProfiler.startProfile();
},
stopRecording: function()
{
+ if (WebInspector.experimentsSettings.powerTimeline.isEnabled() && Capabilities.canProfilePower)
+ WebInspector.powerProfiler.stopProfile();
+
if (!this._clientInitiatedRecording) {
WebInspector.timelineManager.start(undefined, undefined, undefined, stopTimeline.bind(this));
return;

Powered by Google App Engine
This is Rietveld 408576698