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

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

Issue 113950: Separate results of profiling sessions.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | webkit/glue/devtools/js/devtools_host_stub.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/debugger_agent.js
===================================================================
--- webkit/glue/devtools/js/debugger_agent.js (revision 17069)
+++ webkit/glue/devtools/js/debugger_agent.js (working copy)
@@ -69,11 +69,10 @@
this.scriptsCacheInitialized_ = false;
/**
- * Whether user has stopped profiling and we are retrieving the rest of
- * profiler's log.
+ * Whether profiling session is started.
* @type {boolean}
*/
- this.isProcessingProfile_ = false;
+ this.isProfilingStarted_ = false;
/**
* The position in log file to read from.
@@ -85,7 +84,8 @@
* Profiler processor instance.
* @type {devtools.profiler.Processor}
*/
- this.profilerProcessor_ = new devtools.profiler.Processor();
+ this.profilerProcessor_ = new devtools.profiler.Processor(
+ goog.bind(WebInspector.addProfile, WebInspector));
};
@@ -348,11 +348,7 @@
* Starts (resumes) profiling.
*/
devtools.DebuggerAgent.prototype.startProfiling = function() {
- if (this.isProcessingProfile_) {
- return;
- }
RemoteDebuggerAgent.StartProfiling();
- // Query if profiling has been really started.
RemoteDebuggerAgent.IsProfilingStarted();
};
@@ -361,7 +357,6 @@
* Stops (pauses) profiling.
*/
devtools.DebuggerAgent.prototype.stopProfiling = function() {
- this.isProcessingProfile_ = true;
RemoteDebuggerAgent.StopProfiling();
};
@@ -613,11 +608,17 @@
*/
devtools.DebuggerAgent.prototype.didIsProfilingStarted_ = function(
is_started) {
- if (is_started) {
+ if (is_started && !this.isProfilingStarted_) {
// Start to query log data.
RemoteDebuggerAgent.GetLogLines(this.lastProfileLogPosition_);
}
+ this.isProfilingStarted_ = is_started;
+ // Update button.
WebInspector.setRecordingProfile(is_started);
+ if (is_started) {
+ // Monitor profiler state. It can stop itself on buffer fill-up.
+ setTimeout(function() { RemoteDebuggerAgent.IsProfilingStarted(); }, 1000);
+ }
};
@@ -632,14 +633,11 @@
if (log.length > 0) {
this.profilerProcessor_.processLogChunk(log);
this.lastProfileLogPosition_ = newPosition;
- } else if (this.isProcessingProfile_) {
- this.isProcessingProfile_ = false;
- WebInspector.setRecordingProfile(false);
- WebInspector.addProfile(this.profilerProcessor_.createProfileForView());
+ } else if (!this.isProfilingStarted_) {
+ // No new data and profiling is stopped---suspend log reading.
return;
}
- setTimeout(function() { RemoteDebuggerAgent.GetLogLines(newPosition); },
- this.isProcessingProfile_ ? 100 : 1000);
+ setTimeout(function() { RemoteDebuggerAgent.GetLogLines(newPosition); }, 500);
};
« no previous file with comments | « no previous file | webkit/glue/devtools/js/devtools_host_stub.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698