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

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

Issue 1913283004: Aura Window Capture: Ensure capture callback is always run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix hole in ThreadSafeCaptureOracle as well. 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 9b61674efcde96cbb190547c68a01c6be73e89f6..0f370825413afb6e9fc7e8da14375a3142145fd5 100644
--- a/media/capture/content/thread_safe_capture_oracle.cc
+++ b/media/capture/content/thread_safe_capture_oracle.cc
@@ -141,8 +141,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