Chromium Code Reviews| 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); |
|
GeorgeZ
2016/04/23 18:47:15
There is one more loop hole in
https://code.googl
miu
2016/04/26 02:27:58
Done. Good catch.
|
| } |
| 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); |
|
GeorgeZ
2016/04/23 18:47:15
You may add a check for result (bool success) in v
miu
2016/04/26 02:27:58
VideoCaptureOracle::CompleteCapture() must be call
|
| } |
| void AuraWindowCaptureMachine::OnWindowBoundsChanged( |