Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 403f2d9b29d603035152e7e913ed83e1dda1c212
      
https://github.com/WebKit/WebKit/commit/403f2d9b29d603035152e7e913ed83e1dda1c212
  Author: Carlos Garcia Campos <[email protected]>
  Date:   2026-01-13 (Tue, 13 Jan 2026)

  Changed paths:
    M Source/WebKit/UIProcess/wpe/DisplayVBlankMonitorWPE.cpp
    M Source/WebKit/UIProcess/wpe/DisplayVBlankMonitorWPE.h
    M Source/WebKit/WPEPlatform/wpe/WPEScreenSyncObserver.cpp
    M Source/WebKit/WPEPlatform/wpe/WPEScreenSyncObserver.h

  Log Message:
  -----------
  [WPE] WPE Platform: allow to add multiple callbacks to WPEScreenSyncObserver
https://bugs.webkit.org/show_bug.cgi?id=305326

Reviewed by Adrian Perez de Castro.

This can happen if there are more than one web context, like when using
the local inspector. There's just one WPEScreenSyncObserver, since it's
created per WPEScreen, but multiple DisplayLink objects, since they are
managed by ProcessPool. In that case we need to be able to set a
callback for both DisplayLink objects. This patch replaces the current
API using a single set_callback() method and start() and stop() by new
API based on add_callback() and remove_callback(). The monitor is
automatically started when the first callback is added and stopped when
the last one is removed.

* Source/WebKit/UIProcess/wpe/DisplayVBlankMonitorWPE.cpp:
(WebKit::DisplayVBlankMonitorWPE::DisplayVBlankMonitorWPE):
(WebKit::DisplayVBlankMonitorWPE::~DisplayVBlankMonitorWPE):
(WebKit::DisplayVBlankMonitorWPE::observer const):
(WebKit::DisplayVBlankMonitorWPE::addCallbackIfNeeded):
(WebKit::DisplayVBlankMonitorWPE::removeCallbackIfNeeded):
(WebKit::DisplayVBlankMonitorWPE::start):
(WebKit::DisplayVBlankMonitorWPE::stop):
(WebKit::DisplayVBlankMonitorWPE::invalidate):
(WebKit::DisplayVBlankMonitorWPE::isActive):
* Source/WebKit/UIProcess/wpe/DisplayVBlankMonitorWPE.h:
* Source/WebKit/WPEPlatform/wpe/WPEScreenSyncObserver.cpp:
(ObserverCallback::ObserverCallback):
(ObserverCallback::~ObserverCallback):
(wpeScreenSyncObserverSync):
(wpe_screen_sync_observer_class_init):
(wpe_screen_sync_observer_add_callback):
(wpe_screen_sync_observer_remove_callback):
(wpeScreenSyncObserverDispose): Deleted.
(wpe_screen_sync_observer_set_callback): Deleted.
(wpe_screen_sync_observer_start): Deleted.
(wpe_screen_sync_observer_stop): Deleted.
(wpe_screen_sync_observer_is_active): Deleted.
* Source/WebKit/WPEPlatform/wpe/WPEScreenSyncObserver.h:

Canonical link: https://commits.webkit.org/305509@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to