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

Unified Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 83483007: Expose synthetic delays through the GPU benchmarking extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « content/browser/tracing/tracing_controller_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_controller_impl.cc
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 1340b67e99237802b01190d46d470232eaf02bbe..a1c3148cbbfa19cd841a35681bab1b6c2400e7fc 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -114,6 +114,7 @@ TracingControllerImpl::TracingControllerImpl() :
pending_disable_recording_ack_count_(0),
pending_capture_monitoring_snapshot_ack_count_(0),
pending_trace_buffer_percent_full_ack_count_(0),
+ pending_configure_synthetic_delay_ack_count_(0),
maximum_trace_buffer_percent_full_(0),
// Tracing may have been enabled by ContentMainRunner if kTraceStartup
// is specified in command line.
@@ -356,6 +357,31 @@ bool TracingControllerImpl::GetTraceBufferPercentFull(
return true;
}
+void TracingControllerImpl::ConfigureSyntheticDelay(
nduca 2013/11/24 19:42:00 i think you need to configure them all in one go,
+ const std::string& name,
+ base::TimeDelta target_duration,
+ base::debug::TraceEventSyntheticDelay::Mode mode,
+ const ConfigureSyntheticDelayCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ base::debug::TraceEventSyntheticDelay* delay =
+ base::debug::TraceEventSyntheticDelay::Lookup(name);
+ delay->SetTargetDuration(target_duration);
+ delay->SetMode(mode);
+
+ pending_configure_synthetic_delay_callback_ = callback;
+ pending_configure_synthetic_delay_ack_count_ = filters_.size() + 1;
+
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&TracingControllerImpl::OnConfigureSyntheticDelayAcked,
+ base::Unretained(this)));
+
+ // Notify all child processes.
+ for (FilterMap::iterator it = filters_.begin(); it != filters_.end(); ++it) {
+ it->get()->SendConfigureSyntheticDelay(name, target_duration, mode);
+ }
+}
+
void TracingControllerImpl::AddFilter(TraceMessageFilter* filter) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
@@ -569,4 +595,21 @@ void TracingControllerImpl::OnTraceBufferPercentFullReply(float percent_full) {
}
}
+void TracingControllerImpl::OnConfigureSyntheticDelayAcked() {
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&TracingControllerImpl::OnConfigureSyntheticDelayAcked,
+ base::Unretained(this)));
+ return;
+ }
+
+ if (pending_configure_synthetic_delay_ack_count_ == 0)
+ return;
+
+ if (--pending_configure_synthetic_delay_ack_count_ != 0)
+ return;
+
+ pending_configure_synthetic_delay_callback_.Run();
+}
+
} // namespace content
« no previous file with comments | « content/browser/tracing/tracing_controller_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698