Web Inspector: implement Flame Chart for CPU profiler.
[WebKit-https.git] / Source / WebCore / inspector / front-end / CPUProfileView.js
index c26796e..2788a3d 100644 (file)
@@ -53,7 +53,17 @@ WebInspector.CPUProfileView = function(profile)
     this.dataGrid = new WebInspector.DataGrid(columns);
     this.dataGrid.addEventListener("sorting changed", this._sortProfile, this);
     this.dataGrid.element.addEventListener("mousedown", this._mouseDownInDataGrid.bind(this), true);
-    this.dataGrid.show(this.element);
+
+    if (WebInspector.experimentsSettings.cpuFlameChart.isEnabled()) {
+        this._splitView = new WebInspector.SplitView(false, "flameChartSplitLocation");
+        this._splitView.show(this.element);
+
+        this.dataGrid.show(this._splitView.firstElement());
+
+        this.flameChart = new WebInspector.FlameChart(this);
+        this.flameChart.show(this._splitView.secondElement());
+    } else
+        this.dataGrid.show(this.element);
 
     this.viewSelectComboBox = new WebInspector.StatusBarComboBox(this._changeView.bind(this));
 
@@ -109,6 +119,8 @@ WebInspector.CPUProfileView.prototype = {
         this._assignParentsInProfile();
         this._changeView();
         this._updatePercentButton();
+        if (this.flameChart)
+            this.flameChart.update();
     },
 
     get statusBarItems()
@@ -750,3 +762,5 @@ WebInspector.CPUProfileHeader.prototype = {
 
     __proto__: WebInspector.ProfileHeader.prototype
 }
+
+importScript("FlameChart.js");