Modified: trunk/LayoutTests/ChangeLog (285801 => 285802)
--- trunk/LayoutTests/ChangeLog 2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/LayoutTests/ChangeLog 2021-11-15 12:57:16 UTC (rev 285802)
@@ -1,3 +1,14 @@
+2021-11-15 Enrique Ocaña González <[email protected]>
+
+ [GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
+ https://bugs.webkit.org/show_bug.cgi?id=229964
+
+ Reviewed by Carlos Garcia Campos.
+
+ Removed failing test from TestExpectations.
+
+ * platform/gtk/TestExpectations:
+
2021-11-15 Antti Koivisto <[email protected]>
Stack overflow with revert-layer
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (285801 => 285802)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2021-11-15 12:57:16 UTC (rev 285802)
@@ -1248,8 +1248,6 @@
webkit.org/b/229268 media/media-fragments/TC0009.html [ Failure Pass ]
webkit.org/b/229268 media/media-fragments/TC0014.html [ Failure Pass ]
-webkit.org/b/229964 webaudio/silent-audio-interrupted-in-background.html [ Pass Timeout ]
-
# Flaky on skip-failing-test bot (EWS)
webkit.org/b/229270 fast/events/monotonic-event-time.html [ Failure Pass ]
Modified: trunk/Source/WebCore/ChangeLog (285801 => 285802)
--- trunk/Source/WebCore/ChangeLog 2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/Source/WebCore/ChangeLog 2021-11-15 12:57:16 UTC (rev 285802)
@@ -1,3 +1,20 @@
+2021-11-15 Enrique Ocaña González <[email protected]>
+
+ [GTK] webaudio/silent-audio-interrupted-in-background.html is a flaky timeout
+ https://bugs.webkit.org/show_bug.cgi?id=229964
+
+ Reviewed by Carlos Garcia Campos.
+
+ I can't reproduce the timeout locally anymore, but I'm getting a crash sometimes. This fix is for the crash.
+ Unregister dbus objects on MediaSessionGLib destruction to prevent the dbus connection to keep processing requests.
+
+ * platform/audio/glib/MediaSessionGLib.cpp:
+ (WebCore::MediaSessionGLib::MediaSessionGLib()): Don't register a GBusNameLostCallback, as unregistration is now going to be handled in the destructor.
+ (WebCore::MediaSessionGLib::~MediaSessionGLib()): Unregister dbus objects.
+ (WebCore::MediaSessionGLib::nameLost()): Refactored into the destructor.
+ * platform/audio/glib/MediaSessionGLib.h:
+ (WebCore::MediaSessionGLib::nameLost()): Deleted.
+
2021-11-15 Antti Koivisto <[email protected]>
Stack overflow with revert-layer
Modified: trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp (285801 => 285802)
--- trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp 2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp 2021-11-15 12:57:16 UTC (rev 285802)
@@ -218,44 +218,21 @@
const auto& applicationID = getApplicationID();
m_instanceId = applicationID.isEmpty() ? makeString("org.mpris.MediaPlayer2.webkit.instance", getpid(), "-", identifier.toUInt64()) : makeString("org.mpris.MediaPlayer2.", applicationID.ascii().data(), "-", identifier.toUInt64());
- m_ownerId = g_bus_own_name_on_connection(m_connection.get(), m_instanceId.ascii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr,
- reinterpret_cast<GBusNameLostCallback>(+[](GDBusConnection* connection, const char*, gpointer userData) {
- auto& session = *reinterpret_cast<MediaSessionGLib*>(userData);
- session.nameLost(connection);
- }), this, nullptr);
+ m_ownerId = g_bus_own_name_on_connection(m_connection.get(), m_instanceId.ascii().data(), G_BUS_NAME_OWNER_FLAGS_NONE, nullptr, nullptr, this, nullptr);
}
MediaSessionGLib::~MediaSessionGLib()
{
+ if (m_connection) {
+ if (m_rootRegistrationId && !g_dbus_connection_unregister_object(m_connection.get(), m_rootRegistrationId))
+ g_warning("Unable to unregister MPRIS D-Bus object.");
+ if (m_playerRegistrationId && !g_dbus_connection_unregister_object(m_connection.get(), m_playerRegistrationId))
+ g_warning("Unable to unregister MPRIS D-Bus player object.");
+ }
if (m_ownerId)
g_bus_unown_name(m_ownerId);
}
-void MediaSessionGLib::nameLost(GDBusConnection* connection)
-{
- if (UNLIKELY(!m_connection)) {
- g_warning("Unable to acquire MPRIS D-Bus session ownership for name %s", m_instanceId.ascii().data());
- return;
- }
-
- m_connection = nullptr;
- if (!m_rootRegistrationId)
- return;
-
- if (g_dbus_connection_unregister_object(connection, m_rootRegistrationId))
- m_rootRegistrationId = 0;
- else
- g_warning("Unable to unregister MPRIS D-Bus object.");
-
- if (!m_playerRegistrationId)
- return;
-
- if (g_dbus_connection_unregister_object(connection, m_playerRegistrationId))
- m_playerRegistrationId = 0;
- else
- g_warning("Unable to unregister MPRIS D-Bus player object.");
-}
-
void MediaSessionGLib::emitPositionChanged(double time)
{
GUniqueOutPtr<GError> error;
Modified: trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.h (285801 => 285802)
--- trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.h 2021-11-15 11:12:32 UTC (rev 285801)
+++ trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.h 2021-11-15 12:57:16 UTC (rev 285802)
@@ -44,7 +44,6 @@
GVariant* getPositionAsGVariant();
GVariant* canSeekAsGVariant();
- void nameLost(GDBusConnection*);
void emitPositionChanged(double time);
void updateNowPlaying(NowPlayingInfo&);
void playbackStatusChanged(PlatformMediaSession&);