Title: [218923] trunk/Source/WebKit2
Revision
218923
Author
[email protected]
Date
2017-06-29 05:09:04 -0700 (Thu, 29 Jun 2017)

Log Message

Unreviewed. Fix GTK+ unit tests crashing after r218922.

We need to check if icon database exists and is open now on dispose and API entry points.

* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseDispose):
(webkit_favicon_database_get_favicon_uri):
(webkit_favicon_database_clear):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218922 => 218923)


--- trunk/Source/WebKit2/ChangeLog	2017-06-29 10:00:19 UTC (rev 218922)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-29 12:09:04 UTC (rev 218923)
@@ -1,5 +1,16 @@
 2017-06-29  Carlos Garcia Campos  <[email protected]>
 
+        Unreviewed. Fix GTK+ unit tests crashing after r218922.
+
+        We need to check if icon database exists and is open now on dispose and API entry points.
+
+        * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
+        (webkitFaviconDatabaseDispose):
+        (webkit_favicon_database_get_favicon_uri):
+        (webkit_favicon_database_clear):
+
+2017-06-29  Carlos Garcia Campos  <[email protected]>
+
         [GTK][WPE] Implement API::IconLoadingClient and rework WebKitFaviconDatabase to use IconDatabase directly
         https://bugs.webkit.org/show_bug.cgi?id=173877
 

Modified: trunk/Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabase.cpp (218922 => 218923)


--- trunk/Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabase.cpp	2017-06-29 10:00:19 UTC (rev 218922)
+++ trunk/Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabase.cpp	2017-06-29 12:09:04 UTC (rev 218923)
@@ -88,9 +88,8 @@
 {
     WebKitFaviconDatabase* database = WEBKIT_FAVICON_DATABASE(object);
 
-    WebKitFaviconDatabasePrivate* priv = database->priv;
-    if (priv->iconDatabase->isOpen())
-        priv->iconDatabase->close();
+    if (webkitFaviconDatabaseIsOpen(database))
+        database->priv->iconDatabase->close();
 
     G_OBJECT_CLASS(webkit_favicon_database_parent_class)->dispose(object);
 }
@@ -458,6 +457,9 @@
     g_return_val_if_fail(pageURL, nullptr);
     ASSERT(RunLoop::isMain());
 
+    if (!webkitFaviconDatabaseIsOpen(database))
+        return nullptr;
+
     String iconURLForPageURL = database->priv->iconDatabase->synchronousIconURLForPageURL(String::fromUTF8(pageURL));
     if (iconURLForPageURL.isEmpty())
         return nullptr;
@@ -475,5 +477,8 @@
 {
     g_return_if_fail(WEBKIT_IS_FAVICON_DATABASE(database));
 
+    if (!webkitFaviconDatabaseIsOpen(database))
+        return;
+
     database->priv->iconDatabase->removeAllIcons();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to