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

Unified Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 306923008: Add tracing to measure the entire time it takes to satisfy a getStats request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_peer_connection_handler.cc
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc
index 0c5c3737cf153f2ca680d981e502701bb4301220..3d096b4af1f5771896b64522cbeb0a02e450e5a8 100644
--- a/content/renderer/media/rtc_peer_connection_handler.cc
+++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -233,7 +233,10 @@ class SetSessionDescriptionRequest
class StatsResponse : public webrtc::StatsObserver {
public:
explicit StatsResponse(const scoped_refptr<LocalRTCStatsRequest>& request)
- : request_(request.get()), response_(request_->createResponse().get()) {}
+ : request_(request.get()), response_(request_->createResponse().get()) {
+ // Measure the overall time it takes to satisfy a getStats request.
+ TRACE_EVENT_ASYNC_BEGIN0("webrtc", "getStats_Native", this);
+ }
virtual void OnComplete(
const std::vector<webrtc::StatsReport>& reports) OVERRIDE {
@@ -244,6 +247,12 @@ class StatsResponse : public webrtc::StatsObserver {
AddReport(*it);
}
}
+
+ // Record the getSync operation as done before calling into Blink so that
+ // we don't skew the perf measurements of the native code with whatever the
+ // callback might be doing.
+ TRACE_EVENT_ASYNC_END0("webrtc", "getStats_Native", this);
+
request_->requestSucceeded(response_);
}
« 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