Title: [229126] trunk/Source/WebKit
Revision
229126
Author
carlo...@webkit.org
Date
2018-03-01 01:24:24 -0800 (Thu, 01 Mar 2018)

Log Message

REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
https://bugs.webkit.org/show_bug.cgi?id=183091

Reviewed by Michael Catanzaro.

Invalidate the surface in the page map when the backing store is destroyed.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::willDestroySurface):
* UIProcess/gtk/WaylandCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (229125 => 229126)


--- trunk/Source/WebKit/ChangeLog	2018-03-01 07:35:30 UTC (rev 229125)
+++ trunk/Source/WebKit/ChangeLog	2018-03-01 09:24:24 UTC (rev 229126)
@@ -1,3 +1,16 @@
+2018-03-01  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
+        https://bugs.webkit.org/show_bug.cgi?id=183091
+
+        Reviewed by Michael Catanzaro.
+
+        Invalidate the surface in the page map when the backing store is destroyed.
+
+        * UIProcess/gtk/WaylandCompositor.cpp:
+        (WebKit::WaylandCompositor::willDestroySurface):
+        * UIProcess/gtk/WaylandCompositor.h:
+
 2018-02-28  Brian Burg  <bb...@apple.com>
 
         [Cocoa] Web Automation: provide a way to ask clients the type of a _javascript_ dialog

Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp (229125 => 229126)


--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2018-03-01 07:35:30 UTC (rev 229125)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp	2018-03-01 09:24:24 UTC (rev 229126)
@@ -350,6 +350,7 @@
             wl_resource_set_implementation(surfaceResource, &surfaceInterface, new WaylandCompositor::Surface(),
                 [](struct wl_resource* resource) {
                     auto* surface = static_cast<WaylandCompositor::Surface*>(wl_resource_get_user_data(resource));
+                    WaylandCompositor::singleton().willDestroySurface(surface);
                     delete surface;
                 });
         } else
@@ -562,6 +563,16 @@
         surface->setWebPage(nullptr);
 }
 
+void WaylandCompositor::willDestroySurface(Surface* surface)
+{
+    for (auto it : m_pageMap) {
+        if (it.value == surface) {
+            it.value = nullptr;
+            return;
+        }
+    }
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(WAYLAND) && USE(EGL)

Modified: trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h (229125 => 229126)


--- trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h	2018-03-01 07:35:30 UTC (rev 229125)
+++ trunk/Source/WebKit/UIProcess/gtk/WaylandCompositor.h	2018-03-01 09:24:24 UTC (rev 229126)
@@ -113,6 +113,7 @@
     void bindSurfaceToWebPage(Surface*, uint64_t pageID);
     void registerWebPage(WebPageProxy&);
     void unregisterWebPage(WebPageProxy&);
+    void willDestroySurface(Surface*);
 
     bool getTexture(WebPageProxy&, unsigned&, WebCore::IntSize&);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to