[WK2][GTK] Unneeded GError field in internal structure in WebKitFaviconDatabase.cpp
authormario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2012 09:27:41 +0000 (09:27 +0000)
committermario@webkit.org <mario@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2012 09:27:41 +0000 (09:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=99564

Reviewed by Carlos Garcia Campos.

Removed field 'error' from GetFaviconSurfaceAsyncData and updated
the code accordingly, by using g_simple_async_result_take_error().

* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(GetFaviconSurfaceAsyncData): Removed unneeded field.
(processPendingIconsForPageURL): Avoid using g_propagate_error and
use g_simple_async_result_take_error directly instead.
(webkit_favicon_database_get_favicon_finish): Remove unneeded code.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp

index 9992871..66197e1 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-17  Mario Sanchez Prada  <msanchez@igalia.com>
+
+        [WK2][GTK] Unneeded GError field in internal structure in WebKitFaviconDatabase.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=99564
+
+        Reviewed by Carlos Garcia Campos.
+
+        Removed field 'error' from GetFaviconSurfaceAsyncData and updated
+        the code accordingly, by using g_simple_async_result_take_error().
+
+        * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
+        (GetFaviconSurfaceAsyncData): Removed unneeded field.
+        (processPendingIconsForPageURL): Avoid using g_propagate_error and
+        use g_simple_async_result_take_error directly instead.
+        (webkit_favicon_database_get_favicon_finish): Remove unneeded code.
+
 2012-10-17  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL][WK2] Start using OwnPtr for non-ref counted ewk types
index cb016ab..aa4bafb 100644 (file)
@@ -110,7 +110,6 @@ struct GetFaviconSurfaceAsyncData {
     GRefPtr<WebKitFaviconDatabase> faviconDatabase;
     String pageURL;
     RefPtr<cairo_surface_t> icon;
-    GOwnPtr<GError> error;
     GRefPtr<GCancellable> cancellable;
 };
 WEBKIT_DEFINE_ASYNC_DATA_STRUCT(GetFaviconSurfaceAsyncData)
@@ -160,7 +159,7 @@ static void processPendingIconsForPageURL(WebKitFaviconDatabase* database, const
         GetFaviconSurfaceAsyncData* data = static_cast<GetFaviconSurfaceAsyncData*>(g_simple_async_result_get_op_res_gpointer(result));
         if (!g_cancellable_is_cancelled(data->cancellable.get())) {
             if (error)
-                g_propagate_error(&data->error.outPtr(), error.release());
+                g_simple_async_result_take_error(result, error.release());
             else
                 data->icon = icon;
         }
@@ -345,11 +344,6 @@ cairo_surface_t* webkit_favicon_database_get_favicon_finish(WebKitFaviconDatabas
 
     GetFaviconSurfaceAsyncData* data = static_cast<GetFaviconSurfaceAsyncData*>(g_simple_async_result_get_op_res_gpointer(simpleResult));
     ASSERT(data);
-    if (data->error) {
-        g_propagate_error(error, data->error.release());
-        return 0;
-    }
-
     return cairo_surface_reference(data->icon.get());
 }