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

Unified Diff: Source/devtools/front_end/timeline/TimelineFrameModel.js

Issue 402633002: DevTools: Remove redundant dependency on target from TimelineFrameModel (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
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelineFrameModel.js
diff --git a/Source/devtools/front_end/timeline/TimelineFrameModel.js b/Source/devtools/front_end/timeline/TimelineFrameModel.js
index 371deeedb2cc980a5d57621aee8e1fbe649e1324..71cf8247ed7ee2b66d4c20012bda311702c27baf 100644
--- a/Source/devtools/front_end/timeline/TimelineFrameModel.js
+++ b/Source/devtools/front_end/timeline/TimelineFrameModel.js
@@ -30,13 +30,9 @@
/**
* @constructor
- * @extends {WebInspector.SDKObject}
- * @param {!WebInspector.Target} target
*/
-WebInspector.TimelineFrameModelBase = function(target)
+WebInspector.TimelineFrameModelBase = function()
{
- WebInspector.SDKObject.call(this, target);
-
this.reset();
}
@@ -207,19 +203,16 @@ WebInspector.TimelineFrameModelBase.prototype = {
return result;
}
return null;
- },
-
- __proto__: WebInspector.SDKObject.prototype
+ }
}
/**
* @constructor
- * @param {!WebInspector.Target} target
* @extends {WebInspector.TimelineFrameModelBase}
*/
-WebInspector.TimelineFrameModel = function(target)
+WebInspector.TimelineFrameModel = function()
{
- WebInspector.TimelineFrameModelBase.call(this, target);
+ WebInspector.TimelineFrameModelBase.call(this);
}
WebInspector.TimelineFrameModel._mainFrameMarkers = [
@@ -312,7 +305,7 @@ WebInspector.TimelineFrameModel.prototype = {
{
var recordTypes = WebInspector.TimelineModel.RecordType;
if (record.type() === recordTypes.UpdateLayerTree && record.data()["layerTree"])
- this.handleLayerTreeSnapshot(new WebInspector.DeferredAgentLayerTree(this.target().weakReference(), record.data()["layerTree"]));
+ this.handleLayerTreeSnapshot(new WebInspector.DeferredAgentLayerTree(record.target().weakReference(), record.data()["layerTree"]));
if (!this._hasThreadedCompositing) {
if (record.type() === recordTypes.BeginFrame)
this._startMainThreadFrame(record.startTime());
@@ -356,12 +349,11 @@ WebInspector.TimelineFrameModel.prototype = {
/**
* @constructor
- * @param {!WebInspector.Target} target
* @extends {WebInspector.TimelineFrameModelBase}
*/
-WebInspector.TracingTimelineFrameModel = function(target)
+WebInspector.TracingTimelineFrameModel = function()
{
- WebInspector.TimelineFrameModelBase.call(this, target);
+ WebInspector.TimelineFrameModelBase.call(this);
}
WebInspector.TracingTimelineFrameModel._mainFrameMarkers = [
@@ -415,9 +407,9 @@ WebInspector.TracingTimelineFrameModel.prototype = {
_addBackgroundTraceEvent: function(event)
{
var eventNames = WebInspector.TracingTimelineModel.RecordType;
-
+ var target = event.thread.target();
if (event.phase === WebInspector.TracingModel.Phase.SnapshotObject && event.name === eventNames.LayerTreeHostImplSnapshot && parseInt(event.id, 0) === this._layerTreeId) {
- this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTree(this.target().weakReference(), event.args["snapshot"]["active_tree"]["root_layer"], event.args["snapshot"]["device_viewport_size"]));
+ this.handleLayerTreeSnapshot(new WebInspector.DeferredTracingLayerTree(target ? target.weakReference() : new WeakReference(null), event.args["snapshot"]["active_tree"]["root_layer"], event.args["snapshot"]["device_viewport_size"]));
caseq 2014/07/17 12:30:36 new WeakReference(null) looks rather unfortunate.
sergeyv 2014/07/17 14:34:29 Done.
return;
}
if (this._lastFrame && event.selfTime)
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698