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

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

Issue 159135: DevTools Profiler: small UI improvements.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « webkit/glue/devtools/js/debugger_agent.js ('k') | 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
===================================================================
--- webkit/glue/devtools/js/profiler_processor.js (revision 21170)
+++ webkit/glue/devtools/js/profiler_processor.js (working copy)
@@ -179,6 +179,12 @@
this.startedProfileProcessing_ = null;
/**
+ * Callback that is called periodically to display processing status.
+ * @type {function()}
+ */
+ this.profileProcessingStatus_ = null;
+
+ /**
* Callback that is called when a profile has been processed and is ready
* to be shown.
* @type {function(devtools.profiler.ProfileView)}
@@ -202,6 +208,12 @@
* @type {number}
*/
this.profileId_ = 1;
+
+ /**
+ * Counter for processed ticks.
+ * @type {number}
+ */
+ this.ticksCount_ = 0;
};
goog.inherits(devtools.profiler.Processor, devtools.profiler.LogReader);
@@ -230,8 +242,9 @@
* processing callback.
*/
devtools.profiler.Processor.prototype.setCallbacks = function(
- started, finished) {
+ started, processing, finished) {
this.startedProfileProcessing_ = started;
+ this.profileProcessingStatus_ = processing;
this.finishedProfileProcessing_ = finished;
};
@@ -265,6 +278,7 @@
devtools.profiler.Processor.prototype.processProfiler_ = function(
state, params) {
+ var processingInterval = null;
switch (state) {
case 'resume':
if (this.currentProfile_ == null) {
@@ -276,10 +290,18 @@
if (this.startedProfileProcessing_) {
this.startedProfileProcessing_();
}
+ this.ticksCount_ = 0;
+ var self = this;
+ if (this.profileProcessingStatus_) {
+ processingInterval = window.setInterval(
+ function() { self.profileProcessingStatus_(self.ticksCount_); },
+ 1000);
+ }
}
break;
case 'pause':
if (this.currentProfile_ != null) {
+ window.clearInterval(processingInterval);
pfeldman 2009/07/21 14:58:49 should this be checked for nullness?
mnaganov (inactive) 2009/07/21 15:06:29 window.clearInterval(null) is harmless.
if (this.finishedProfileProcessing_) {
this.finishedProfileProcessing_(this.createProfileForView());
}
@@ -326,6 +348,7 @@
// see the comment for devtools.profiler.Processor.PROGRAM_ENTRY
stack.push(devtools.profiler.Processor.PROGRAM_ENTRY_STR);
this.currentProfile_.recordTick(this.processStack(pc, stack));
+ this.ticksCount_++;
};
« no previous file with comments | « webkit/glue/devtools/js/debugger_agent.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698