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

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

Issue 1941523002: Aura Window Capture: Ensure capture callback is always run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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 | « media/capture/content/thread_safe_capture_oracle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e99b56caefc899888676afa745bd3eadcc383005..6753e60665eb0749abb1f9f6678c4b53c3439fa5 100644
--- a/media/capture/content/thread_safe_capture_oracle.cc
+++ b/media/capture/content/thread_safe_capture_oracle.cc
@@ -140,8 +140,15 @@ bool ThreadSafeCaptureOracle::ObserveEventAndDecideCapture(
static_cast<uint8_t*>(output_buffer->data()),
output_buffer->mapped_size(), base::SharedMemory::NULLHandle(), 0u,
base::TimeDelta());
- if (!(*storage))
+ // If creating the VideoFrame wrapper failed, call DidCaptureFrame() with
+ // !success to execute the required post-capture steps (tracing, notification
+ // of failure to VideoCaptureOracle, etc.).
+ if (!(*storage)) {
+ DidCaptureFrame(frame_number, std::move(output_buffer), capture_begin_time,
+ estimated_frame_duration, *storage, event_time, false);
return false;
+ }
+
*callback = base::Bind(&ThreadSafeCaptureOracle::DidCaptureFrame, this,
frame_number, base::Passed(&output_buffer),
capture_begin_time, estimated_frame_duration);
« no previous file with comments | « media/capture/content/thread_safe_capture_oracle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698