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

Unified Diff: Source/devtools/front_end/profiler/CPUProfileFlameChart.js

Issue 388303002: DevTools: Get rid of WebInspector.TargetObserver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/profiler/CPUProfileFlameChart.js
diff --git a/Source/devtools/front_end/profiler/CPUProfileFlameChart.js b/Source/devtools/front_end/profiler/CPUProfileFlameChart.js
index a4068052dd83151a6ef8d3e618f4af9be2755f56..10713d9c4c280cdba823614bacd43cf7669a2f22 100644
--- a/Source/devtools/front_end/profiler/CPUProfileFlameChart.js
+++ b/Source/devtools/front_end/profiler/CPUProfileFlameChart.js
@@ -33,13 +33,13 @@
* @constructor
* @implements {WebInspector.FlameChartDataProvider}
* @param {!WebInspector.CPUProfileDataModel} cpuProfile
- * @param {?WebInspector.Target} target
+ * @param {!WeakReference.<!WebInspector.Target>} weakTarget
*/
-WebInspector.CPUFlameChartDataProvider = function(cpuProfile, target)
+WebInspector.CPUFlameChartDataProvider = function(cpuProfile, weakTarget)
{
WebInspector.FlameChartDataProvider.call(this);
this._cpuProfile = cpuProfile;
- this._targetObserver = new WebInspector.TargetObserver(target);
+ this._weakTarget = weakTarget;
this._colorGenerator = WebInspector.CPUFlameChartDataProvider.colorGenerator();
}
@@ -224,7 +224,7 @@ WebInspector.CPUFlameChartDataProvider.prototype = {
var totalTime = this._millisecondsToString(timelineData.entryTotalTimes[entryIndex]);
pushEntryInfoRow(WebInspector.UIString("Self time"), selfTime);
pushEntryInfoRow(WebInspector.UIString("Total time"), totalTime);
- var target = this._targetObserver.target();
+ var target = this._weakTarget.get();
var text = target ? WebInspector.Linkifier.liveLocationText(target, node.scriptId, node.lineNumber, node.columnNumber) : node.url;
pushEntryInfoRow(WebInspector.UIString("URL"), text);
pushEntryInfoRow(WebInspector.UIString("Aggregated self time"), Number.secondsToString(node.selfTime / 1000, true));

Powered by Google App Engine
This is Rietveld 408576698