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

Unified Diff: media/capture/content/thread_safe_capture_oracle.cc

Issue 2866943002: Give performance_browser_tests lots of love and attention. (Closed)
Patch Set: fix compile error Created 3 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
Index: media/capture/content/thread_safe_capture_oracle.cc
diff --git a/media/capture/content/thread_safe_capture_oracle.cc b/media/capture/content/thread_safe_capture_oracle.cc
index 0f817d14ab661385d26a60344030b6126b6ddba2..c7a97814b0c66d838290bcbd5683b0661ba550f4 100644
--- a/media/capture/content/thread_safe_capture_oracle.cc
+++ b/media/capture/content/thread_safe_capture_oracle.cc
@@ -212,20 +212,20 @@ void ThreadSafeCaptureOracle::DidCaptureFrame(
scoped_refptr<VideoFrame> frame,
base::TimeTicks reference_time,
bool success) {
- TRACE_EVENT_ASYNC_END2("gpu.capture", "Capture", buffer.id, "success",
- success, "timestamp",
- reference_time.ToInternalValue());
-
base::AutoLock guard(lock_);
- if (!oracle_.CompleteCapture(frame_number, success, &reference_time))
- return;
+ const bool should_deliver_frame =
+ oracle_.CompleteCapture(frame_number, success, &reference_time);
- TRACE_EVENT_INSTANT0("gpu.capture", "CaptureSucceeded",
- TRACE_EVENT_SCOPE_THREAD);
+ // The following is used by
+ // chrome/browser/extension/api/cast_streaming/performance_test.cc, in
+ // addition to the usual runtime tracing.
+ TRACE_EVENT_ASYNC_END2("gpu.capture", "Capture", buffer.id, "success",
+ should_deliver_frame, "timestamp",
+ (reference_time - base::TimeTicks()).InMicroseconds());
- if (!client_)
- return; // Capture is stopped.
+ if (!should_deliver_frame || !client_)
+ return;
frame->metadata()->SetDouble(VideoFrameMetadata::FRAME_RATE,
params_.requested_format.frame_rate);
« no previous file with comments | « chrome/test/data/extensions/api_test/tab_capture/performance.js ('k') | media/cast/receiver/cast_receiver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698