Index: content/browser/media/capture/aura_window_capture_machine.cc |
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc |
index b959e153f658f60d03d379ce17e639b5e910b28e..daaa5cc0758d62e4a895ddab5dfd37d395318048 100644 |
--- a/content/browser/media/capture/aura_window_capture_machine.cc |
+++ b/content/browser/media/capture/aura_window_capture_machine.cc |
@@ -199,7 +199,7 @@ void AuraWindowCaptureMachine::DidCopyOutput( |
static bool first_call = true; |
- bool succeeded = ProcessCopyOutputResponse( |
+ const bool succeeded = ProcessCopyOutputResponse( |
video_frame, start_time, capture_frame_cb, std::move(result)); |
base::TimeDelta capture_time = base::TimeTicks::Now() - start_time; |
@@ -223,6 +223,11 @@ void AuraWindowCaptureMachine::DidCopyOutput( |
: FIRST_WINDOW_CAPTURE_FAILED); |
} |
} |
+ |
+ // If ProcessCopyOutputResponse() failed, it will not run |capture_frame_cb|, |
+ // so do that now. |
+ if (!succeeded) |
+ capture_frame_cb.Run(video_frame, start_time, false); |
} |
bool AuraWindowCaptureMachine::ProcessCopyOutputResponse( |
@@ -310,8 +315,11 @@ void AuraWindowCaptureMachine::CopyOutputFinishedForVideo( |
if (machine) { |
if (machine->cursor_renderer_ && result) |
machine->cursor_renderer_->RenderOnVideoFrame(target); |
- capture_frame_cb.Run(target, start_time, result); |
+ } else { |
+ result = false; |
} |
+ |
+ capture_frame_cb.Run(target, start_time, result); |
} |
void AuraWindowCaptureMachine::OnWindowBoundsChanged( |