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

Side by Side Diff: Source/devtools/front_end/timeline/MemoryCountersGraph.js

Issue 710113002: DevTools: remove TimelineModel.Events.RecordAdded event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 WebInspector.MemoryCountersGraph.prototype = { 54 WebInspector.MemoryCountersGraph.prototype = {
55 timelineStarted: function() 55 timelineStarted: function()
56 { 56 {
57 }, 57 },
58 58
59 timelineStopped: function() 59 timelineStopped: function()
60 { 60 {
61 }, 61 },
62 62
63 /** 63 /**
64 * @param {!WebInspector.TimelineModel.Record} record 64 * @override
65 * @param {?RegExp} textFilter
65 */ 66 */
66 addRecord: function(record) 67 refreshRecords: function(textFilter)
67 { 68 {
69 this.reset();
70 var records = this._model.records();
71
68 /** 72 /**
69 * @param {!WebInspector.TimelineModel.Record} record 73 * @param {!WebInspector.TimelineModel.Record} record
70 * @this {!WebInspector.MemoryCountersGraph} 74 * @this {!WebInspector.MemoryCountersGraph}
71 */ 75 */
72 function addStatistics(record) 76 function addStatistics(record)
73 { 77 {
74 var counters = this._uiUtils.countersForRecord(record); 78 var counters = this._uiUtils.countersForRecord(record);
75 if (!counters) 79 if (!counters)
76 return; 80 return;
77 for (var name in counters) { 81 for (var name in counters) {
78 var counter = this._countersByName[name]; 82 var counter = this._countersByName[name];
79 if (counter) 83 if (counter)
80 counter.appendSample(record.endTime() || record.startTime(), counters[name]); 84 counter.appendSample(record.endTime() || record.startTime(), counters[name]);
81 } 85 }
82 86
83 var gpuMemoryLimitCounterName = "gpuMemoryLimitKB"; 87 var gpuMemoryLimitCounterName = "gpuMemoryLimitKB";
84 if (this._gpuMemoryCounter && (gpuMemoryLimitCounterName in counters )) 88 if (this._gpuMemoryCounter && (gpuMemoryLimitCounterName in counters ))
85 this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterNa me]); 89 this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterNa me]);
86 } 90 }
87 WebInspector.TimelineModel.forAllRecords([record], null, addStatistics.b ind(this)); 91 WebInspector.TimelineModel.forAllRecords(records, null, addStatistics.bi nd(this));
88 this.scheduleRefresh(); 92 this.scheduleRefresh();
89 }, 93 },
90 94
91 refreshRecords: function()
92 {
93 this.reset();
94 var records = this._model.records();
95 for (var i = 0; i < records.length; ++i)
96 this.addRecord(records[i]);
97 },
98
99 __proto__: WebInspector.CountersGraph.prototype 95 __proto__: WebInspector.CountersGraph.prototype
100 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698