summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 10:13:59 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 10:13:59 +0000
commit2c252774313cf6fc542cd785d8eaf1250a2a115a (patch)
tree57ede12e8715153304ef68c3299e34abf557561f /webkit/glue/devtools
parent74d49879e7eb6445a87bf3be66413e6488c55b2a (diff)
downloadchromium_src-2c252774313cf6fc542cd785d8eaf1250a2a115a.zip
chromium_src-2c252774313cf6fc542cd785d8eaf1250a2a115a.tar.gz
chromium_src-2c252774313cf6fc542cd785d8eaf1250a2a115a.tar.bz2
DevTools: update UI when profiling is started / stopped from console.
BUG=24706 TEST=none Review URL: http://codereview.chromium.org/385132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools')
-rw-r--r--webkit/glue/devtools/js/debugger_agent.js29
1 files changed, 19 insertions, 10 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js
index 3eec221..ec22cc4 100644
--- a/webkit/glue/devtools/js/debugger_agent.js
+++ b/webkit/glue/devtools/js/debugger_agent.js
@@ -97,6 +97,18 @@ devtools.DebuggerAgent = function() {
devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_NONE;
/**
+ * Interval for polling profiler state.
+ * @type {number}
+ */
+ this.getActiveProfilerModulesInterval_ = null;
+
+ /**
+ * Whether log contents retrieval must be forced next time.
+ * @type {boolean}
+ */
+ this.forceGetLogLines_ = false;
+
+ /**
* Profiler processor instance.
* @type {devtools.profiler.Processor}
*/
@@ -698,7 +710,9 @@ devtools.DebuggerAgent.prototype.setupProfilerProcessorCallbacks = function() {
*/
devtools.DebuggerAgent.prototype.initializeProfiling = function() {
this.setupProfilerProcessorCallbacks();
- RemoteDebuggerAgent.GetActiveProfilerModules();
+ this.forceGetLogLines_ = true;
+ this.getActiveProfilerModulesInterval_ = setInterval(
+ function() { RemoteDebuggerAgent.GetActiveProfilerModules(); }, 1000);
};
@@ -712,8 +726,6 @@ devtools.DebuggerAgent.prototype.startProfiling = function(modules) {
devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT) {
// Active modules will not change, instead, a snapshot will be logged.
RemoteDebuggerAgent.GetNextLogLines();
- } else {
- RemoteDebuggerAgent.GetActiveProfilerModules();
}
};
@@ -1025,19 +1037,16 @@ devtools.DebuggerAgent.prototype.didGetActiveProfilerModules_ = function(
modules) {
var profModules = devtools.DebuggerAgent.ProfilerModules;
var profModuleNone = profModules.PROFILER_MODULE_NONE;
- if (modules != profModuleNone &&
- this.activeProfilerModules_ == profModuleNone) {
+ if (this.forceGetLogLines_ ||
+ (modules != profModuleNone &&
+ this.activeProfilerModules_ == profModuleNone)) {
+ this.forceGetLogLines_ = false;
// Start to query log data.
RemoteDebuggerAgent.GetNextLogLines();
}
this.activeProfilerModules_ = modules;
// Update buttons.
WebInspector.setRecordingProfile(modules & profModules.PROFILER_MODULE_CPU);
- if (modules != profModuleNone) {
- // Monitor profiler state. It can stop itself on buffer fill-up.
- setTimeout(
- function() { RemoteDebuggerAgent.GetActiveProfilerModules(); }, 1000);
- }
};