diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:23:55 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-04-27 17:07:03 +0100 |
commit | 692e5dbf12901edacf14812a6fae25462920af42 (patch) | |
tree | d62802373a429e0a9dc093b6046c166b2c514285 /WebKit/gtk/webkit/webkitdownload.cpp | |
parent | e24bea4efef1c414137d36a9778aa4e142e10c7d (diff) | |
download | external_webkit-692e5dbf12901edacf14812a6fae25462920af42.zip external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.gz external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.bz2 |
Merge webkit.org at r55033 : Initial merge by git
Change-Id: I98a4af828067cc243ec3dc5e5826154dd88074b5
Diffstat (limited to 'WebKit/gtk/webkit/webkitdownload.cpp')
-rw-r--r-- | WebKit/gtk/webkit/webkitdownload.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp index 1912a12..8f3214e 100644 --- a/WebKit/gtk/webkit/webkitdownload.cpp +++ b/WebKit/gtk/webkit/webkitdownload.cpp @@ -70,7 +70,7 @@ class DownloadClient : public Noncopyable, public ResourceHandleClient { struct _WebKitDownloadPrivate { gchar* destinationURI; gchar* suggestedFilename; - guint currentSize; + guint64 currentSize; GTimer* timer; WebKitDownloadStatus status; GFileOutputStream* outputStream; @@ -228,10 +228,14 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass) /** * WebKitDownload::error: * @download: the object on which the signal is emitted - * @current_bytes: the current count of bytes downloaded - * @total_bytes: the total bytes count in the downloaded file, aka file size. + * @error_code: the corresponding error code + * @error_detail: detailed error code for the error, see + * #WebKitDownloadError + * @reason: a string describing the error * - * Indicates an error in the download. + * Emitted when @download is interrupted either by user action or by + * network errors, @error_detail will take any value of + * #WebKitDownloadError. * * Since: 1.1.2 */ @@ -409,7 +413,8 @@ WebKitDownload* webkit_download_new_with_handle(WebKitNetworkRequest* request, W g_return_val_if_fail(request, NULL); ResourceHandleInternal* d = handle->getInternal(); - soup_session_pause_message(webkit_get_default_session(), d->m_msg); + if (d->m_msg) + soup_session_pause_message(webkit_get_default_session(), d->m_msg); WebKitDownload* download = WEBKIT_DOWNLOAD(g_object_new(WEBKIT_TYPE_DOWNLOAD, "network-request", request, NULL)); WebKitDownloadPrivate* priv = download->priv; @@ -480,7 +485,8 @@ void webkit_download_start(WebKitDownload* download) priv->resourceHandle->setClient(priv->downloadClient); ResourceHandleInternal* d = priv->resourceHandle->getInternal(); - soup_session_unpause_message(webkit_get_default_session(), d->m_msg); + if (d->m_msg) + soup_session_unpause_message(webkit_get_default_session(), d->m_msg); } priv->timer = g_timer_new(); @@ -755,7 +761,7 @@ guint64 webkit_download_get_total_size(WebKitDownload* download) if (!message) return 0; - return MAX(priv->currentSize, soup_message_headers_get_content_length(message->response_headers)); + return MAX(priv->currentSize, static_cast<guint64>(soup_message_headers_get_content_length(message->response_headers))); } /** |