Title: [261230] trunk/Source/WebKit
Revision
261230
Author
[email protected]
Date
2020-05-06 08:32:00 -0700 (Wed, 06 May 2020)

Log Message

[GTK] Cleanup KeyBindingTranslator on WebView disposal
https://bugs.webkit.org/show_bug.cgi?id=211465

Reviewed by Carlos Garcia Campos.

Fixes assertion in debug mode when a test failed and the widget
followed a destruction pattern where KeyBindingTranslator would be
destroyed before the container widget is cleaned up.

Also renamed the method from 'destroyed' to 'invalidate' to try to
better convey the action being performed on the KeyBindingTranslator.

Covered by existing tests.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseContainerRemove): Update method name.
(webkitWebViewBaseDispose): Cleanup keyBindingTranslator when
disposing this widget.
* UIProcess/gtk/KeyBindingTranslator.h:
(WebKit::KeyBindingTranslator::invalidate): Renamed from destroyed.
(WebKit::KeyBindingTranslator::destroyed): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261229 => 261230)


--- trunk/Source/WebKit/ChangeLog	2020-05-06 15:30:16 UTC (rev 261229)
+++ trunk/Source/WebKit/ChangeLog	2020-05-06 15:32:00 UTC (rev 261230)
@@ -1,3 +1,27 @@
+2020-05-06  Lauro Moura  <[email protected]>
+
+        [GTK] Cleanup KeyBindingTranslator on WebView disposal
+        https://bugs.webkit.org/show_bug.cgi?id=211465
+
+        Reviewed by Carlos Garcia Campos.
+
+        Fixes assertion in debug mode when a test failed and the widget
+        followed a destruction pattern where KeyBindingTranslator would be
+        destroyed before the container widget is cleaned up.
+
+        Also renamed the method from 'destroyed' to 'invalidate' to try to
+        better convey the action being performed on the KeyBindingTranslator.
+
+        Covered by existing tests.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseContainerRemove): Update method name.
+        (webkitWebViewBaseDispose): Cleanup keyBindingTranslator when
+        disposing this widget.
+        * UIProcess/gtk/KeyBindingTranslator.h:
+        (WebKit::KeyBindingTranslator::invalidate): Renamed from destroyed.
+        (WebKit::KeyBindingTranslator::destroyed): Deleted.
+
 2020-05-06  Darin Adler  <[email protected]>
 
         Reduce HAVE(HOSTED_CORE_ANIMATION)

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (261229 => 261230)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2020-05-06 15:30:16 UTC (rev 261229)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2020-05-06 15:32:00 UTC (rev 261230)
@@ -529,7 +529,7 @@
         if (gtk_widget_get_visible(widgetContainer))
             gtk_widget_grab_focus(widgetContainer);
     } else if (priv->keyBindingTranslator.widget() == widget)
-        priv->keyBindingTranslator.destroyed();
+        priv->keyBindingTranslator.invalidate();
     else {
         ASSERT(priv->children.contains(widget));
         priv->children.remove(widget);
@@ -600,6 +600,7 @@
     webView->priv->pageProxy->close();
     webView->priv->acceleratedBackingStore = nullptr;
     webView->priv->sleepDisabler = nullptr;
+    webView->priv->keyBindingTranslator.invalidate();
     G_OBJECT_CLASS(webkit_web_view_base_parent_class)->dispose(gobject);
 }
 

Modified: trunk/Source/WebKit/UIProcess/gtk/KeyBindingTranslator.h (261229 => 261230)


--- trunk/Source/WebKit/UIProcess/gtk/KeyBindingTranslator.h	2020-05-06 15:30:16 UTC (rev 261229)
+++ trunk/Source/WebKit/UIProcess/gtk/KeyBindingTranslator.h	2020-05-06 15:32:00 UTC (rev 261230)
@@ -37,7 +37,7 @@
     ~KeyBindingTranslator();
 
     GtkWidget* widget() const { return m_nativeWidget; }
-    void destroyed() { m_nativeWidget = nullptr; }
+    void invalidate() { m_nativeWidget = nullptr; }
 
 #if USE(GTK4)
     Vector<String> commandsForKeyEvent(GtkEventControllerKey*);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to