FallbackDesktopCapturerWrapper should set permanent_error if main_capturer_->SelectSource() failed

http://crbug.com/732224 should be able to be covered by
FallbackDesktopCapturerWrapper if its SelectSource() behaves like this.

This change also adds histogram to track the failure of SelectSource().

This change was reviewed at
https://chromium-review.googlesource.com/c/external/webrtc/+/662906.

Bug: chromium:732224
Change-Id: I6cffe745a48d77acb703bfb0a0d042b170d8a937
TBR: jamiewalch@chromium.org
Reviewed-on: https://webrtc-review.googlesource.com/1380
Reviewed-by: Zijie He <zijiehe@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
Cr-Commit-Position: refs/heads/master@{#19839}
This commit is contained in:
Zijie He 2017-09-14 08:28:58 -07:00 committed by Commit Bot
parent 6d01f6d220
commit 6564ea3b46

View File

@ -130,8 +130,15 @@ bool FallbackDesktopCapturerWrapper::SelectSource(SourceId id) {
if (main_capturer_permanent_error_) {
return secondary_capturer_->SelectSource(id);
}
return main_capturer_->SelectSource(id) &&
secondary_capturer_->SelectSource(id);
const bool main_capturer_result = main_capturer_->SelectSource(id);
RTC_HISTOGRAM_BOOLEAN(
"WebRTC.DesktopCapture.PrimaryCapturerSelectSourceError",
main_capturer_result);
if (!main_capturer_result) {
main_capturer_permanent_error_ = true;
}
return secondary_capturer_->SelectSource(id);
}
bool FallbackDesktopCapturerWrapper::FocusOnSelectedSource() {