Log Message
[GTK] Remove virtual methods of WebKitDownload signals in WebKit2 GTK+ API https://bugs.webkit.org/show_bug.cgi?id=79804
Reviewed by Martin Robinson. That comes from the first patch that followed the approach of the first LoaderClient implementation. With current implementation download signals, except decide-destination, don't need to be true_handled, and they won't have a default handler implementation. Also the download object is not supposed to be inheritable, since instances are created privately by the WebContext, so it's not possible to override the virtual methods in derived classes. * UIProcess/API/gtk/WebKitDownload.cpp: (webkit_download_class_init): (webkitDownloadNotifyProgress): (webkitDownloadFailed): (webkitDownloadFinished): * UIProcess/API/gtk/WebKitDownload.h: (_WebKitDownloadClass): * UIProcess/API/gtk/webkit2marshal.list:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (109116 => 109117)
--- trunk/Source/WebKit2/ChangeLog 2012-02-28 17:44:18 UTC (rev 109116)
+++ trunk/Source/WebKit2/ChangeLog 2012-02-28 17:56:35 UTC (rev 109117)
@@ -1,3 +1,28 @@
+2012-02-28 Carlos Garcia Campos <[email protected]>
+
+ [GTK] Remove virtual methods of WebKitDownload signals in WebKit2 GTK+ API
+ https://bugs.webkit.org/show_bug.cgi?id=79804
+
+ Reviewed by Martin Robinson.
+
+ That comes from the first patch that followed the approach of the
+ first LoaderClient implementation. With current implementation
+ download signals, except decide-destination, don't need to be
+ true_handled, and they won't have a default handler
+ implementation. Also the download object is not supposed to be
+ inheritable, since instances are created privately by the
+ WebContext, so it's not possible to override the virtual methods
+ in derived classes.
+
+ * UIProcess/API/gtk/WebKitDownload.cpp:
+ (webkit_download_class_init):
+ (webkitDownloadNotifyProgress):
+ (webkitDownloadFailed):
+ (webkitDownloadFinished):
+ * UIProcess/API/gtk/WebKitDownload.h:
+ (_WebKitDownloadClass):
+ * UIProcess/API/gtk/webkit2marshal.list:
+
2012-02-28 Caio Marcelo de Oliveira Filho <[email protected]>
[Qt] Fix build for WK2, do not use enum type if values can be outside the enum
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp (109116 => 109117)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp 2012-02-28 17:44:18 UTC (rev 109116)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp 2012-02-28 17:56:35 UTC (rev 109117)
@@ -169,18 +169,14 @@
* This signal is emitted after response is received,
* every time new data has been written to the destination. It's
* useful to know the progress of the download operation.
- *
- * Returns: %TRUE to stop other handlers from being invoked for the event.
- * %FALSE to propagate the event further.
*/
signals[RECEIVED_DATA] =
g_signal_new("received-data",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitDownloadClass, received_data),
- g_signal_accumulator_true_handled, NULL,
- webkit_marshal_BOOLEAN__UINT64,
- G_TYPE_BOOLEAN, 1,
+ 0, 0, 0,
+ webkit_marshal_VOID__UINT64,
+ G_TYPE_NONE, 1,
G_TYPE_UINT64);
/**
@@ -189,18 +185,14 @@
*
* This signal is emitted when download finishes successfully or due to an error.
* In case of errors #WebKitDownload::failed signal is emitted before this one.
- *
- * Returns: %TRUE to stop other handlers from being invoked for the event.
- * %FALSE to propagate the event further.
*/
signals[FINISHED] =
g_signal_new("finished",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitDownloadClass, finished),
- g_signal_accumulator_true_handled, NULL,
- webkit_marshal_BOOLEAN__VOID,
- G_TYPE_BOOLEAN, 0);
+ 0, 0, 0,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
/**
* WebKitDownload::failed:
@@ -213,18 +205,14 @@
* with webkit_download_cancel(), this signal is emitted with error
* %WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER. The download operation finishes
* after an error and #WebKitDownload::finished signal is emitted after this one.
- *
- * Returns: %TRUE to stop other handlers from being invoked for the event.
- * %FALSE to propagate the event further.
*/
signals[FAILED] =
g_signal_new("failed",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitDownloadClass, failed),
- g_signal_accumulator_true_handled, NULL,
- webkit_marshal_BOOLEAN__POINTER,
- G_TYPE_BOOLEAN, 1,
+ 0, 0, 0,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
G_TYPE_POINTER);
/**
@@ -258,17 +246,13 @@
* This signal is emitted after #WebKitDownload::decide-destination and before
* #WebKitDownload::received-data to notify that destination file has been
* created successfully at @destination.
- *
- * Returns: %TRUE to stop other handlers from being invoked for the event.
- * %FALSE to propagate the event further.
*/
signals[CREATED_DESTINATION] =
g_signal_new("created-destination",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET(WebKitDownloadClass, created_destination),
- g_signal_accumulator_true_handled, NULL,
- webkit_marshal_BOOLEAN__STRING,
+ 0, 0, 0,
+ g_cclosure_marshal_VOID__STRING,
G_TYPE_BOOLEAN, 1,
G_TYPE_STRING);
@@ -304,8 +288,7 @@
download->priv->timer.set(g_timer_new());
priv->currentSize += bytesReceived;
- gboolean returnValue;
- g_signal_emit(download, signals[RECEIVED_DATA], 0, bytesReceived, &returnValue);
+ g_signal_emit(download, signals[RECEIVED_DATA], 0, bytesReceived);
// Throttle progress notification to not consume high amounts of
// CPU on fast links, except when the last notification occured
@@ -333,9 +316,9 @@
resourceError.localizedDescription().utf8().data()));
if (download->priv->timer)
g_timer_stop(download->priv->timer.get());
- gboolean returnValue;
- g_signal_emit(download, signals[FAILED], 0, webError.get(), &returnValue);
- g_signal_emit(download, signals[FINISHED], 0, &returnValue);
+
+ g_signal_emit(download, signals[FAILED], 0, webError.get());
+ g_signal_emit(download, signals[FINISHED], 0, NULL);
}
void webkitDownloadCancelled(WebKitDownload* download)
@@ -356,8 +339,7 @@
}
if (download->priv->timer)
g_timer_stop(download->priv->timer.get());
- gboolean returnValue;
- g_signal_emit(download, signals[FINISHED], 0, &returnValue);
+ g_signal_emit(download, signals[FINISHED], 0, NULL);
}
CString webkitDownloadDecideDestinationWithSuggestedFilename(WebKitDownload* download, const CString& suggestedFilename)
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.h (109116 => 109117)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.h 2012-02-28 17:44:18 UTC (rev 109116)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.h 2012-02-28 17:56:35 UTC (rev 109117)
@@ -50,15 +50,8 @@
struct _WebKitDownloadClass {
GObjectClass parent_class;
- gboolean (* received_data) (WebKitDownload *download,
- guint64 data_length);
- gboolean (* finished) (WebKitDownload *download);
- gboolean (* failed) (WebKitDownload *download,
- GError *error);
gboolean (* decide_destination) (WebKitDownload *download,
const gchar *suggested_filename);
- gboolean (* created_destination) (WebKitDownload *download,
- const gchar *destination);
};
WEBKIT_API GType
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list (109116 => 109117)
--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list 2012-02-28 17:44:18 UTC (rev 109116)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2marshal.list 2012-02-28 17:56:35 UTC (rev 109117)
@@ -1,15 +1,11 @@
BOOLEAN:ENUM,STRING,POINTER
BOOLEAN:OBJECT
BOOLEAN:OBJECT,ENUM
-BOOLEAN:OBJECT,STRING,POINTER
-BOOLEAN:POINTER
BOOLEAN:STRING
BOOLEAN:STRING,POINTER
BOOLEAN:STRING,STRING,POINTER
-BOOLEAN:UINT64
-BOOLEAN:VOID
OBJECT:VOID
-VOID:ENUM
VOID:OBJECT,UINT
VOID:OBJECT,POINTER
+VOID:UINT64
_______________________________________________ webkit-changes mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
