From 6a8f257529d6a37f43a8e38f093ebfa3ad7ee5ba Mon Sep 17 00:00:00 2001 From: Nico Grunbaum Date: Thu, 30 Jan 2020 05:47:41 +0000 Subject: [PATCH] Bug 1611486 - P1 - Cherry-pick webrct desktop sharing X hang fixes;r=dminor https://chromium.googlesource.com/external/webrtc/+/4b47dd39a79d62acaaeb68bedd147d748320ce4d Differential Revision: https://phabricator.services.mozilla.com/D61000 --HG-- extra : moz-landing-system : lando --- .../desktop_capture/desktop_and_cursor_composer.cc | 9 --------- .../desktop_capture/desktop_and_cursor_composer.h | 2 -- .../modules/desktop_capture/mouse_cursor_monitor.h | 3 +-- .../desktop_capture/mouse_cursor_monitor_unittest.cc | 4 +--- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc index ad977dfaca0e..0359a7258885 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc +++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc @@ -201,15 +201,6 @@ void DesktopAndCursorComposer::OnMouseCursor(MouseCursor* cursor) { cursor_.reset(cursor); } -void DesktopAndCursorComposer::OnMouseCursorPosition( - MouseCursorMonitor::CursorState state, - const DesktopVector& position) { - if (!use_desktop_relative_cursor_position_) { - cursor_state_ = state; - cursor_position_ = position; - } -} - void DesktopAndCursorComposer::OnMouseCursorPosition( const DesktopVector& position) { if (use_desktop_relative_cursor_position_) { diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h index 041a2f6bd895..5174e40820ba 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h +++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h @@ -70,8 +70,6 @@ class DesktopAndCursorComposer : public DesktopCapturer, // MouseCursorMonitor::Callback interface. void OnMouseCursor(MouseCursor* cursor) override; - void OnMouseCursorPosition(MouseCursorMonitor::CursorState state, - const DesktopVector& position) override; void OnMouseCursorPosition(const DesktopVector& position) override; const std::unique_ptr desktop_capturer_; diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor.h index 2e98594d63e8..0976d37bb468 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor.h +++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor.h @@ -54,13 +54,12 @@ class MouseCursorMonitor { // relative to the |window| specified in the constructor. // Deprecated: use the following overload instead. virtual void OnMouseCursorPosition(CursorState state, - const DesktopVector& position) = 0; + const DesktopVector& position) {} // Called in response to Capture(). |position| indicates cursor absolute // position on the system in fullscreen coordinate, i.e. the top-left // monitor always starts from (0, 0). // TODO(zijiehe): Ensure all implementations return the absolute position. - // TODO(zijiehe): Make this function pure virtual after Chromium changes. // TODO(zijiehe): Current this overload works correctly only when capturing // mouse cursor against fullscreen. virtual void OnMouseCursorPosition(const DesktopVector& position) {} diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_unittest.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_unittest.cc index 9af0d68efcc7..67f036ce9d84 100644 --- a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_unittest.cc +++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_unittest.cc @@ -31,9 +31,7 @@ class MouseCursorMonitorTest : public testing::Test, cursor_image_.reset(cursor_image); } - void OnMouseCursorPosition(MouseCursorMonitor::CursorState state, - const DesktopVector& position) override { - state_ = state; + void OnMouseCursorPosition(const DesktopVector& position) override { position_ = position; position_received_ = true; }