RESOLVED FIXED 98009
[GTK] WebKitDownload: use more of GOwnPtr/GRefPtr
https://bugs.webkit.org/show_bug.cgi?id=98009
Summary [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr
Claudio Saavedra
Reported 2012-10-01 03:41:42 PDT
There are plenty of uses of raw pointers here, so let's fix a few.
Attachments
[GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 (4.76 KB, patch)
2012-10-01 03:44 PDT, Claudio Saavedra
cgarcia: review-
cgarcia: commit-queue-
[GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 (4.78 KB, patch)
2012-10-01 03:59 PDT, Claudio Saavedra
no flags
Claudio Saavedra
Comment 1 2012-10-01 03:44:58 PDT
Created attachment 166441 [details] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 Reviewed by NOBODY (OOPS!). Use more GOwnPtr/GRefPtr in WebKitDownload * webkit/webkitdownload.cpp: (webkit_download_open_stream_for_uri): Use GRefPtr for a GFile and GOwnPtr for GError. (webkit_download_set_destination_uri): Ditto. (webkit_download_received_data): Use GOwnPtr for GError.
WebKit Review Bot
Comment 2 2012-10-01 03:48:15 PDT
Attachment 166441 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/gtk/ChangeLog', u'Source/Web..." exit_code: 1 Source/WebKit/gtk/webkit/webkitdownload.cpp:862: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 3 2012-10-01 03:49:49 PDT
Comment on attachment 166441 [details] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 View in context: https://bugs.webkit.org/attachment.cgi?id=166441&action=review Thanks, GRefPtr increases the ref counter in the assign operator, so you need to adopt the ref to avoid it. > Source/WebKit/gtk/webkit/webkitdownload.cpp:463 > + GRefPtr<GFile> file = g_file_new_for_uri(uri); You need to adopt the ref, use GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(uri)); > Source/WebKit/gtk/webkit/webkitdownload.cpp:698 > + GRefPtr<GFile> src = g_file_new_for_uri(priv->destinationURI); > + GRefPtr<GFile> dest = g_file_new_for_uri(destination_uri); These should be adopted too. > Source/WebKit/gtk/webkit/webkitdownload.cpp:701 > + g_file_move(src.get(), dest.get(), G_FILE_COPY_BACKUP, NULL, NULL, NULL, &error.outPtr()); Use 0 instead of NULL now that you are changing this line.
Claudio Saavedra
Comment 4 2012-10-01 03:59:46 PDT
Created attachment 166443 [details] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 Reviewed by NOBODY (OOPS!). Use more GOwnPtr/GRefPtr in WebKitDownload * webkit/webkitdownload.cpp: (webkit_download_open_stream_for_uri): Use GRefPtr for a GFile and GOwnPtr for GError. (webkit_download_set_destination_uri): Ditto. (webkit_download_received_data): Use GOwnPtr for GError.
WebKit Review Bot
Comment 5 2012-10-01 04:03:46 PDT
Attachment 166443 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/gtk/ChangeLog', u'Source/Web..." exit_code: 1 Source/WebKit/gtk/webkit/webkitdownload.cpp:862: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 6 2012-10-01 04:06:03 PDT
Comment on attachment 166443 [details] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 Perfect!
WebKit Review Bot
Comment 7 2012-10-01 04:30:26 PDT
Comment on attachment 166443 [details] [GTK] WebKitDownload: use more of GOwnPtr/GRefPtr https://bugs.webkit.org/show_bug.cgi?id=98009 Clearing flags on attachment: 166443 Committed r130036: <http://trac.webkit.org/changeset/130036>
WebKit Review Bot
Comment 8 2012-10-01 04:30:29 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.