Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK] Fix return value of WebKitDownload::created-destination
https://bugs.webkit.org/show_bug.cgi?id=126741

Reviewed by Martin Robinson.

Source/WebKit2:

WebKitDownload::created-destination signal should be void instead
of gboolean. This doesn't break the API/ABI.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkit_download_class_init):
(webkitDownloadDestinationCreated):

Tools:

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp: Fix return
value of several callbacks.

Canonical link: https://commits.webkit.org/144804@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Jan 12, 2014
1 parent 1fa60ca commit 5ab7587
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
14 changes: 14 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,17 @@
2014-01-12 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Fix return value of WebKitDownload::created-destination
https://bugs.webkit.org/show_bug.cgi?id=126741

Reviewed by Martin Robinson.

WebKitDownload::created-destination signal should be void instead
of gboolean. This doesn't break the API/ABI.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkit_download_class_init):
(webkitDownloadDestinationCreated):

2014-01-11 Yongjun Zhang <yongjun_zhang@apple.com>

Support bool argument for encoding/decoding invocations.
Expand Down
18 changes: 9 additions & 9 deletions Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp
Expand Up @@ -264,13 +264,14 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass)
* created successfully at @destination.
*/
signals[CREATED_DESTINATION] =
g_signal_new("created-destination",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
0, 0, 0,
g_cclosure_marshal_VOID__STRING,
G_TYPE_BOOLEAN, 1,
G_TYPE_STRING);
g_signal_new(
"created-destination",
G_TYPE_FROM_CLASS(objectClass),
G_SIGNAL_RUN_LAST,
0, 0, 0,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
}

WebKitDownload* webkitDownloadCreate(DownloadProxy* downloadProxy)
Expand Down Expand Up @@ -382,8 +383,7 @@ void webkitDownloadDestinationCreated(WebKitDownload* download, const CString& d
{
if (download->priv->isCancelled)
return;
gboolean returnValue;
g_signal_emit(download, signals[CREATED_DESTINATION], 0, destinationURI.data(), &returnValue);
g_signal_emit(download, signals[CREATED_DESTINATION], 0, destinationURI.data(), nullptr);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,13 @@
2014-01-12 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Fix return value of WebKitDownload::created-destination
https://bugs.webkit.org/show_bug.cgi?id=126741

Reviewed by Martin Robinson.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp: Fix return
value of several callbacks.

2014-01-11 Sam Weinig <sam@webkit.org>

Add support for null StringViews
Expand Down
12 changes: 4 additions & 8 deletions Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp
Expand Up @@ -52,31 +52,27 @@ class DownloadTest: public Test {
test->receivedResponse(download);
}

static gboolean createdDestinationCallback(WebKitDownload* download, const gchar* destination, DownloadTest* test)
static void createdDestinationCallback(WebKitDownload* download, const gchar* destination, DownloadTest* test)
{
g_assert(webkit_download_get_destination(download));
g_assert_cmpstr(webkit_download_get_destination(download), ==, destination);
test->createdDestination(download, destination);
return TRUE;
}

static gboolean receivedDataCallback(WebKitDownload* download, guint64 dataLength, DownloadTest* test)
static void receivedDataCallback(WebKitDownload* download, guint64 dataLength, DownloadTest* test)
{
test->receivedData(download, dataLength);
return TRUE;
}

static gboolean finishedCallback(WebKitDownload* download, DownloadTest* test)
static void finishedCallback(WebKitDownload* download, DownloadTest* test)
{
test->finished(download);
return TRUE;
}

static gboolean failedCallback(WebKitDownload* download, GError* error, DownloadTest* test)
static void failedCallback(WebKitDownload* download, GError* error, DownloadTest* test)
{
g_assert(error);
test->failed(download, error);
return TRUE;
}

static gboolean decideDestinationCallback(WebKitDownload* download, const gchar* suggestedFilename, DownloadTest* test)
Expand Down

0 comments on commit 5ab7587

Please sign in to comment.