From 4b47dd39a79d62acaaeb68bedd147d748320ce4d Mon Sep 17 00:00:00 2001 From: Jamie Walch Date: Fri, 17 Jan 2020 13:52:48 -0800 Subject: [PATCH] Make deprecated OnMouseCursorPosition overload optional. The only callers or non-trivial implementations of this that I could find are in remoting/ in Chromium, which I plan on fixing once this gets rolled. Bug: chromium:1043325 Change-Id: Id5a33fc09bb066f979876b2a7dcbc3dc5c2d3dd9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166560 Commit-Queue: Jamie Walch Reviewed-by: Sergey Ulanov Cr-Commit-Position: refs/heads/master@{#30310} --- modules/desktop_capture/desktop_and_cursor_composer.cc | 6 ------ modules/desktop_capture/desktop_and_cursor_composer.h | 2 -- modules/desktop_capture/mouse_cursor_monitor.h | 3 +-- modules/desktop_capture/mouse_cursor_monitor_unittest.cc | 5 ----- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/modules/desktop_capture/desktop_and_cursor_composer.cc b/modules/desktop_capture/desktop_and_cursor_composer.cc index b66849078a..638372d854 100644 --- a/modules/desktop_capture/desktop_and_cursor_composer.cc +++ b/modules/desktop_capture/desktop_and_cursor_composer.cc @@ -197,12 +197,6 @@ void DesktopAndCursorComposer::OnMouseCursor(MouseCursor* cursor) { cursor_.reset(cursor); } -void DesktopAndCursorComposer::OnMouseCursorPosition( - MouseCursorMonitor::CursorState state, - const DesktopVector& position) { - RTC_NOTREACHED(); -} - void DesktopAndCursorComposer::OnMouseCursorPosition( const DesktopVector& position) { cursor_position_ = position; diff --git a/modules/desktop_capture/desktop_and_cursor_composer.h b/modules/desktop_capture/desktop_and_cursor_composer.h index 1381106cca..d4e5f8a4d4 100644 --- a/modules/desktop_capture/desktop_and_cursor_composer.h +++ b/modules/desktop_capture/desktop_and_cursor_composer.h @@ -63,8 +63,6 @@ class RTC_EXPORT DesktopAndCursorComposer // 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/modules/desktop_capture/mouse_cursor_monitor.h b/modules/desktop_capture/mouse_cursor_monitor.h index 22fd629b1a..43b75b3f79 100644 --- a/modules/desktop_capture/mouse_cursor_monitor.h +++ b/modules/desktop_capture/mouse_cursor_monitor.h @@ -54,7 +54,7 @@ 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 @@ -62,7 +62,6 @@ class MouseCursorMonitor { // The coordinates of the position is controlled by OS, but it's always // consistent with DesktopFrame.rect().top_left(). // 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/modules/desktop_capture/mouse_cursor_monitor_unittest.cc b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc index 93ac0da0fc..ee2dff32af 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc +++ b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc @@ -34,11 +34,6 @@ class MouseCursorMonitorTest : public ::testing::Test, cursor_image_.reset(cursor_image); } - void OnMouseCursorPosition(MouseCursorMonitor::CursorState state, - const DesktopVector& position) override { - RTC_NOTREACHED(); - } - void OnMouseCursorPosition(const DesktopVector& position) override { position_ = position; position_received_ = true;