Changeset 130036 in webkit
- Timestamp:
- Oct 1, 2012, 4:30:40 AM (13 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r129924 r130036 1 2012-10-01 Claudio Saavedra <csaavedra@igalia.com> 2 3 [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr 4 https://bugs.webkit.org/show_bug.cgi?id=98009 5 6 Reviewed by Carlos Garcia Campos. 7 8 Use more GOwnPtr/GRefPtr in WebKitDownload 9 10 * webkit/webkitdownload.cpp: 11 (webkit_download_open_stream_for_uri): Use GRefPtr 12 for a GFile and GOwnPtr for GError. 13 (webkit_download_set_destination_uri): Ditto. 14 (webkit_download_received_data): Use GOwnPtr for GError. 15 1 16 2012-09-28 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 17 -
trunk/Source/WebKit/gtk/webkit/webkitdownload.cpp
r116525 r130036 39 39 #include <glib/gstdio.h> 40 40 #include <wtf/Noncopyable.h> 41 #include <wtf/gobject/GOwnPtr.h> 41 42 #include <wtf/gobject/GRefPtr.h> 42 43 #include <wtf/text/CString.h> … … 460 461 461 462 WebKitDownloadPrivate* priv = download->priv; 462 G File* file = g_file_new_for_uri(uri);463 G Error* error = NULL;463 GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(uri)); 464 GOwnPtr<GError> error; 464 465 465 466 if (append) 466 priv->outputStream = g_file_append_to(file , G_FILE_CREATE_NONE, NULL, &error);467 priv->outputStream = g_file_append_to(file.get(), G_FILE_CREATE_NONE, NULL, &error.outPtr()); 467 468 else 468 priv->outputStream = g_file_replace(file, NULL, TRUE, G_FILE_CREATE_NONE, NULL, &error); 469 470 g_object_unref(file); 469 priv->outputStream = g_file_replace(file.get(), NULL, TRUE, G_FILE_CREATE_NONE, NULL, &error.outPtr()); 471 470 472 471 if (error) { 473 472 webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message)); 474 g_error_free(error);475 473 return FALSE; 476 474 } … … 697 695 webkit_download_close_stream(download); 698 696 699 GFile* src = g_file_new_for_uri(priv->destinationURI); 700 GFile* dest = g_file_new_for_uri(destination_uri); 701 GError* error = NULL; 702 703 g_file_move(src, dest, G_FILE_COPY_BACKUP, NULL, NULL, NULL, &error); 704 705 g_object_unref(src); 706 g_object_unref(dest); 697 GRefPtr<GFile> src = adoptGRef(g_file_new_for_uri(priv->destinationURI)); 698 GRefPtr<GFile> dest = adoptGRef(g_file_new_for_uri(destination_uri)); 699 GOwnPtr<GError> error; 700 701 g_file_move(src.get(), dest.get(), G_FILE_COPY_BACKUP, 0, 0, 0, &error.outPtr()); 707 702 708 703 g_free(priv->destinationURI); … … 711 706 if (error) { 712 707 webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message)); 713 g_error_free(error);714 708 return; 715 709 } … … 863 857 864 858 gsize bytes_written; 865 G Error* error = NULL;859 GOwnPtr<GError> error; 866 860 867 861 g_output_stream_write_all(G_OUTPUT_STREAM(priv->outputStream), 868 data, length, &bytes_written, NULL, &error );862 data, length, &bytes_written, NULL, &error.outPtr()); 869 863 870 864 if (error) { 871 865 webkitDownloadEmitError(download, downloadDestinationError(core(priv->networkResponse), error->message)); 872 g_error_free(error);873 866 return; 874 867 }
Note:
See TracChangeset
for help on using the changeset viewer.