Changeset 41401 in webkit
- Timestamp:
- Mar 3, 2009 11:48:22 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r41357 r41401 1 2009-03-03 Gustavo Noronha Silva <gns@gnome.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 https://bugs.webkit.org/show_bug.cgi?id=16826 6 [Gtk] Implement WebKitDownload 7 8 Adding new files related to WebKitDownload to the GTK+ port. 9 10 * GNUmakefile.am: 11 1 12 2009-03-02 Gustavo Noronha Silva <gns@gnome.org> 2 13 -
trunk/GNUmakefile.am
r41357 r41401 305 305 WebKit/gtk/webkit/webkit.h \ 306 306 WebKit/gtk/webkit/webkitdefines.h \ 307 WebKit/gtk/webkit/webkitdownload.h \ 307 308 WebKit/gtk/webkit/webkitnetworkrequest.h \ 308 309 WebKit/gtk/webkit/webkitversion.h \ … … 349 350 WebKit/gtk/webkit/webkitwebpolicydecision.cpp \ 350 351 WebKit/gtk/webkit/webkitwebsettings.cpp \ 352 WebKit/gtk/webkit/webkitdownload.cpp \ 351 353 WebKit/gtk/webkit/webkitwebview.cpp \ 352 354 WebKit/gtk/webkit/webkitwebwindowfeatures.cpp -
trunk/WebCore/ChangeLog
r41399 r41401 1 2009-03-03 Gustavo Noronha Silva <gns@gnome.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 https://bugs.webkit.org/show_bug.cgi?id=16826 6 [Gtk] Implement WebKitDownload 7 8 Make the Soup backend able to handle requests without a frame, 9 since we may have such things now that we support downloads. 10 11 * platform/network/ResourceHandleInternal.h: 12 * platform/network/soup/ResourceHandleSoup.cpp: 13 (WebCore::ResourceHandle::start): 14 1 15 2009-03-03 Dimitri Glazkov <dglazkov@chromium.org> 2 16 -
trunk/WebCore/platform/network/soup/ResourceHandleSoup.cpp
r41333 r41401 546 546 ASSERT(!d->m_msg); 547 547 548 // If we are no longer attached to a Page, this must be an attempted load from an 549 // onUnload handler, so let's just block it. 550 if (!frame->page()) 548 549 // The frame could be null if the ResourceHandle is not associated to any 550 // Frame, e.g. if we are downloading a file. 551 // If the frame is not null but the page is null this must be an attempted 552 // load from an onUnload handler, so let's just block it. 553 if (frame && !frame->page()) 551 554 return false; 552 555 -
trunk/WebKit/gtk/ChangeLog
r41341 r41401 1 2009-03-03 Gustavo Noronha Silva <gns@gnome.org> 2 3 Reviewed by Alexey Proskuryakov. 4 5 https://bugs.webkit.org/show_bug.cgi?id=16826 6 [Gtk] Implement WebKitDownload 7 8 Implement download, and provide a nice object wrapping the 9 download process. Initial work done by Marco Barisione and 10 Pierre-Luc Beaudoin for Collabora. 11 12 * WebCoreSupport/ContextMenuClientGtk.cpp: 13 (WebKit::ContextMenuClient::downloadURL): 14 * WebCoreSupport/FrameLoaderClientGtk.cpp: 15 (WebKit::FrameLoaderClient::download): 16 (WebKit::FrameLoaderClient::startDownload): 17 * webkit/webkit.h: 18 * webkit/webkitdefines.h: 19 * webkit/webkitdownload.cpp: Added. 20 (_WebKitDownloadPrivate::): 21 (_WebKitDownloadPrivate::webkit_download_dispose): 22 (_WebKitDownloadPrivate::webkit_download_finalize): 23 (_WebKitDownloadPrivate::webkit_download_get_property): 24 (_WebKitDownloadPrivate::webkit_download_set_property): 25 (_WebKitDownloadPrivate::webkit_download_class_init): 26 (_WebKitDownloadPrivate::webkit_download_init): 27 (_WebKitDownloadPrivate::webkit_download_new): 28 (_WebKitDownloadPrivate::webkit_download_open_stream_for_uri): 29 (_WebKitDownloadPrivate::webkit_download_close_stream): 30 (_WebKitDownloadPrivate::webkit_download_start): 31 (_WebKitDownloadPrivate::webkit_download_cancel): 32 (_WebKitDownloadPrivate::webkit_download_get_uri): 33 (_WebKitDownloadPrivate::webkit_download_get_network_request): 34 (_WebKitDownloadPrivate::webkit_download_set_response): 35 (_WebKitDownloadPrivate::webkit_download_get_suggested_filename): 36 (_WebKitDownloadPrivate::webkit_download_get_destination_uri): 37 (_WebKitDownloadPrivate::webkit_download_set_destination_uri): 38 (_WebKitDownloadPrivate::webkit_download_get_state): 39 (_WebKitDownloadPrivate::webkit_download_get_total_size): 40 (_WebKitDownloadPrivate::webkit_download_get_current_size): 41 (_WebKitDownloadPrivate::webkit_download_get_progress): 42 (_WebKitDownloadPrivate::webkit_download_get_elapsed_time): 43 (_WebKitDownloadPrivate::webkit_download_received_data): 44 (_WebKitDownloadPrivate::webkit_download_finished_loading): 45 (_WebKitDownloadPrivate::webkit_download_error): 46 (_WebKitDownloadPrivate::DownloadClient::DownloadClient): 47 (_WebKitDownloadPrivate::DownloadClient::didReceiveResponse): 48 (_WebKitDownloadPrivate::DownloadClient::didReceiveData): 49 (_WebKitDownloadPrivate::DownloadClient::didFinishLoading): 50 (_WebKitDownloadPrivate::DownloadClient::didFail): 51 (_WebKitDownloadPrivate::DownloadClient::wasBlocked): 52 (_WebKitDownloadPrivate::DownloadClient::cannotShowURL): 53 * webkit/webkitdownload.h: Added. 54 * webkit/webkitprivate.h: 55 * webkit/webkitwebview.cpp: 56 * webkitmarshal.list: 57 1 58 2009-03-01 Jan Michael Alonzo <jmalonzo@webkit.org> 2 59 -
trunk/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
r37779 r41401 1 1 /* 2 2 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org> 3 4 * 4 5 * This library is free software; you can redistribute it and/or … … 21 22 #include "ContextMenuClientGtk.h" 22 23 24 #include "CString.h" 23 25 #include "HitTestResult.h" 24 26 #include "KURL.h" … … 164 166 void ContextMenuClient::downloadURL(const KURL& url) 165 167 { 166 notImplemented(); 168 WebKitNetworkRequest* network_request = webkit_network_request_new(url.string().utf8().data()); 169 WebKitDownload* download = webkit_download_new(network_request); 170 g_object_unref(network_request); 171 172 gboolean handled; 173 g_signal_emit_by_name(m_webView, "download-requested", download, &handled); 174 175 if (!handled) { 176 webkit_download_cancel(download); 177 g_object_unref(download); 178 return; 179 } 180 181 webkit_download_start(download); 167 182 } 168 183 -
trunk/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r41313 r41401 4 4 * Copyright (C) 2007 Christian Dywan <christian@twotoasts.de> 5 5 * Copyright (C) 2008 Collabora Ltd. All rights reserved. 6 * Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org> 6 7 * 7 8 * This library is free software; you can redistribute it and/or … … 43 44 #include "PluginDatabase.h" 44 45 #include "RenderPart.h" 46 #include "ResourceHandle.h" 45 47 #include "ResourceRequest.h" 46 48 #include "CString.h" … … 775 777 } 776 778 777 void FrameLoaderClient::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) 778 { 779 notImplemented(); 779 void FrameLoaderClient::download(ResourceHandle* handle, const ResourceRequest& request, const ResourceRequest&, const ResourceResponse&) 780 { 781 // FIXME: We could reuse the same handle here, but when I tried 782 // implementing that the main load would fail and stop, so I have 783 // simplified this case for now. 784 handle->cancel(); 785 startDownload(request); 780 786 } 781 787 … … 863 869 } 864 870 865 void FrameLoaderClient::startDownload(const ResourceRequest&) 866 { 867 notImplemented(); 871 void FrameLoaderClient::startDownload(const ResourceRequest& request) 872 { 873 WebKitNetworkRequest* networkRequest = webkit_network_request_new(request.url().string().utf8().data()); 874 WebKitDownload* download = webkit_download_new(networkRequest); 875 g_object_unref(networkRequest); 876 877 WebKitWebView* view = getViewFromFrame(m_frame); 878 gboolean handled; 879 g_signal_emit_by_name(view, "download-requested", download, &handled); 880 881 if (!handled) { 882 webkit_download_cancel(download); 883 g_object_unref(download); 884 return; 885 } 886 887 webkit_download_start(download); 868 888 } 869 889 -
trunk/WebKit/gtk/webkit/webkit.h
r39421 r41401 24 24 #include <webkit/webkitversion.h> 25 25 #include <webkit/webkitdefines.h> 26 #include <webkit/webkitdownload.h> 26 27 #include <webkit/webkitnetworkrequest.h> 27 28 #include <webkit/webkitwebframe.h> -
trunk/WebKit/gtk/webkit/webkitdefines.h
r39421 r41401 69 69 typedef struct _WebKitWebViewClass WebKitWebViewClass; 70 70 71 typedef struct _WebKitDownload WebKitDownload; 72 typedef struct _WebKitDownloadClass WebKitDownloadClass; 73 71 74 G_END_DECLS 72 75 -
trunk/WebKit/gtk/webkit/webkitprivate.h
r41341 r41401 29 29 30 30 #include <webkit/webkitdefines.h> 31 #include <webkit/webkitdownload.h> 31 32 #include <webkit/webkitwebview.h> 32 33 #include <webkit/webkitwebframe.h> … … 44 45 #include "InspectorClientGtk.h" 45 46 #include "FrameLoaderClient.h" 47 #include "ResourceHandle.h" 48 #include "ResourceResponse.h" 46 49 #include "WindowFeatures.h" 47 50 48 51 #include <glib.h> 52 53 class DownloadClient; 49 54 50 55 namespace WebKit { -
trunk/WebKit/gtk/webkit/webkitwebview.cpp
r41337 r41401 27 27 #include "config.h" 28 28 29 #include "webkitdownload.h" 29 30 #include "webkitwebview.h" 30 31 #include "webkitenumtypes.h" … … 135 136 PASTE_CLIPBOARD, 136 137 CUT_CLIPBOARD, 138 DOWNLOAD_REQUESTED, 137 139 LAST_SIGNAL 138 140 }; … … 1116 1118 G_TYPE_POINTER, 1117 1119 G_TYPE_POINTER); 1120 1121 /** 1122 * WebKitWebView::download-requested: 1123 * @web_view: the object on which the signal is emitted 1124 * @download: the message text 1125 * @return: TRUE if the download was handled. 1126 * 1127 * A new Download is being requested. By default, if the signal is 1128 * not handled, the download is cancelled. 1129 * 1130 * Since: 1.1.2 1131 */ 1132 webkit_web_view_signals[DOWNLOAD_REQUESTED] = g_signal_new("download-requested", 1133 G_TYPE_FROM_CLASS(webViewClass), 1134 (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), 1135 0, 1136 g_signal_accumulator_true_handled, 1137 NULL, 1138 webkit_marshal_BOOLEAN__OBJECT, 1139 G_TYPE_BOOLEAN, 1, 1140 G_TYPE_OBJECT); 1118 1141 1119 1142 /** -
trunk/WebKit/gtk/webkitmarshal.list
r41251 r41401 1 BOOLEAN:INT,INT,STRING 2 BOOLEAN:OBJECT 1 3 BOOLEAN:OBJECT,OBJECT,OBJECT,OBJECT 2 4 BOOLEAN:OBJECT,OBJECT,STRING,OBJECT
Note: See TracChangeset
for help on using the changeset viewer.