summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2018-06-14 10:40:59 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2018-06-15 07:03:08 +0000
commitb1377d261c7630350dc7594942128711e374a5d2 (patch)
tree16f08b24d3e2cb7d4bc19d64e0390743fb7bd10e
parentde47955be72b2363c5dff2b1f407be993b0f6031 (diff)
downloadqtwebengine-chromium-b1377d261c7630350dc7594942128711e374a5d2.tar.gz
Add ScopedAllowBaseSyncPrimitives for DesktopConfigurationMonitor
This is a re-apply of https://webrtc-review.googlesource.com/c/src/+/40460 This workaround has been reverted from the mainline Chromium due to breaking WebRTC roll: https://webrtc-review.googlesource.com/c/src/+/46540 Revert the revert by this patch, otherwise we get an assert for desktop capture auto tests (tst_QWebEnginePage::getUserMediaRequest) on macOS: https://bugs.chromium.org/p/chromium/issues/detail?id=796889 Change-Id: I28351cf4c85d039821dc462e492caba068b5dc0a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--chromium/third_party/webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/third_party/webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc b/chromium/third_party/webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc
index 4eeee321066..922f3ec59cf 100644
--- a/chromium/third_party/webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc
+++ b/chromium/third_party/webrtc/modules/desktop_capture/mac/desktop_configuration_monitor.cc
@@ -11,6 +11,7 @@
#include "modules/desktop_capture/mac/desktop_configuration_monitor.h"
#include "modules/desktop_capture/mac/desktop_configuration.h"
+#include "rtc_base/event.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/event_wrapper.h"
@@ -41,6 +42,9 @@ DesktopConfigurationMonitor::~DesktopConfigurationMonitor() {
}
void DesktopConfigurationMonitor::Lock() {
+ // TODO(crbug.com/796889, crbug.com/795340): Fix how synchronization is being
+ // done and avoid blocking waits.
+ rtc::ScopedAllowBaseSyncPrimitives allow_event_wait;
if (!display_configuration_capture_event_->Wait(
kDisplayConfigurationEventTimeoutMs)) {
RTC_LOG_F(LS_ERROR) << "Event wait timed out.";
@@ -70,6 +74,10 @@ void DesktopConfigurationMonitor::DisplaysReconfigured(
// If this is the first display to start reconfiguring then wait on
// |display_configuration_capture_event_| to block the capture thread
// from accessing display memory until the reconfiguration completes.
+
+ // TODO(crbug.com/796889, crbug.com/795340): Fix how synchronization is
+ // being done and avoid blocking waits.
+ rtc::ScopedAllowBaseSyncPrimitives allow_event_wait;
if (!display_configuration_capture_event_->Wait(
kDisplayConfigurationEventTimeoutMs)) {
RTC_LOG_F(LS_ERROR) << "Event wait timed out.";