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

Unified Diff: webkit/glue/devtools/js/profiler_processor.js

Issue 384144: DevTools: fix timer leak. (Closed)
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/profiler_processor.js
diff --git a/webkit/glue/devtools/js/profiler_processor.js b/webkit/glue/devtools/js/profiler_processor.js
index 05da93e67a812deaf47778ce2ec22bcbfa99da12..012605cc317547bbbc9e355ca8046468867304f5 100644
--- a/webkit/glue/devtools/js/profiler_processor.js
+++ b/webkit/glue/devtools/js/profiler_processor.js
@@ -228,6 +228,12 @@ devtools.profiler.Processor = function() {
this.ticksCount_ = 0;
/**
+ * Interval id for updating processing status.
+ * @type {number}
+ */
+ this.processingInterval_ = null;
+
+ /**
* The current heap snapshot.
* @type {string}
*/
@@ -302,7 +308,6 @@ devtools.profiler.Processor.prototype.setNewProfileCallback = function(
devtools.profiler.Processor.prototype.processProfiler_ = function(
state, params) {
- var processingInterval = null;
switch (state) {
case 'resume':
if (this.currentProfile_ == null) {
@@ -317,7 +322,7 @@ devtools.profiler.Processor.prototype.processProfiler_ = function(
this.ticksCount_ = 0;
var self = this;
if (this.profileProcessingStatus_) {
- processingInterval = window.setInterval(
+ this.processingInterval_ = window.setInterval(
function() { self.profileProcessingStatus_(self.ticksCount_); },
1000);
}
@@ -325,7 +330,8 @@ devtools.profiler.Processor.prototype.processProfiler_ = function(
break;
case 'pause':
if (this.currentProfile_ != null) {
- window.clearInterval(processingInterval);
+ window.clearInterval(this.processingInterval_);
+ this.processingInterval_ = null;
if (this.finishedProfileProcessing_) {
this.finishedProfileProcessing_(this.createProfileForView());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698