Bug 118568 - Use GOwnPtr in PluginProcessProxyUnix to manage stdOut variable
Summary: Use GOwnPtr in PluginProcessProxyUnix to manage stdOut variable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Correia (qrwteyrutiyoup)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-11 09:21 PDT by Sergio Correia (qrwteyrutiyoup)
Modified: 2013-07-12 07:45 PDT (History)
7 users (show)

See Also:


Attachments
Patch (2.00 KB, patch)
2013-07-11 09:22 PDT, Sergio Correia (qrwteyrutiyoup)
no flags Details | Formatted Diff | Diff
Patch (2.43 KB, patch)
2013-07-11 10:20 PDT, Sergio Correia (qrwteyrutiyoup)
mrobinson: review+
mrobinson: commit-queue-
Details | Formatted Diff | Diff
Patch (2.43 KB, patch)
2013-07-11 10:52 PDT, Sergio Correia (qrwteyrutiyoup)
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion (629.18 KB, application/zip)
2013-07-11 11:25 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Correia (qrwteyrutiyoup) 2013-07-11 09:21:12 PDT
[WK2][UNIX] Free standard output obtained from g_spawn_sync() with g_free
Comment 1 Sergio Correia (qrwteyrutiyoup) 2013-07-11 09:22:50 PDT
Created attachment 206471 [details]
Patch
Comment 2 Martin Robinson 2013-07-11 09:35:04 PDT
Comment on attachment 206471 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206471&action=review

I'm not sure that g_free is necessarily better than free, but a GOwnptr probably makes sense. :)

> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:73
> -    char* stdOut = 0;
> +    gchar* stdOut = 0;

Why is this necessary? They are the same type and in WebKit code we typically use the non-Glib versions.

> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:91
> +        g_free(stdOut);

Why not switch to using GOwnPtr here?
Comment 3 Sergio Correia (qrwteyrutiyoup) 2013-07-11 09:52:50 PDT
(In reply to comment #2)
> (From update of attachment 206471 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=206471&action=review
> 
> I'm not sure that g_free is necessarily better than free, but a GOwnptr probably makes sense. :)
> 
> > Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:73
> > -    char* stdOut = 0;
> > +    gchar* stdOut = 0;
> 
> Why is this necessary? They are the same type and in WebKit code we typically use the non-Glib versions.
>

Good point. We should keep using char, then.
 
> > Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:91
> > +        g_free(stdOut);
> 
> Why not switch to using GOwnPtr here?

Yeah, I thought of using it, but since this code is also shared with EFL, I wasn't sure it would be okay. I am going to upload an updated version using GOwnPtr. Thanks for the review.
Comment 4 Chris Dumez 2013-07-11 10:03:20 PDT
Comment on attachment 206471 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206471&action=review

>>> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:91
>>> +        g_free(stdOut);
>> 
>> Why not switch to using GOwnPtr here?
> 
> Yeah, I thought of using it, but since this code is also shared with EFL, I wasn't sure it would be okay. I am going to upload an updated version using GOwnPtr. Thanks for the review.

Yes, it is fine for the EFL port. This file uses glib already (e.g. g_spawn_sync()).
Comment 5 Sergio Correia (qrwteyrutiyoup) 2013-07-11 10:20:54 PDT
Created attachment 206474 [details]
Patch
Comment 6 Martin Robinson 2013-07-11 10:28:36 PDT
Comment on attachment 206474 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206474&action=review

Looks good except for the include line.

> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:39
> +#include <GOwnPtr.h>

I think you want <wtf/gobject/GOwnPr.h> here.
Comment 7 Sergio Correia (qrwteyrutiyoup) 2013-07-11 10:44:03 PDT
Comment on attachment 206474 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206474&action=review

>> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:39
>> +#include <GOwnPtr.h>
> 
> I think you want <wtf/gobject/GOwnPr.h> here.

My bad, this time I did only an EFL build here. I am finishing the Gtk build with the include fix and once it finishes I will reupload and ask for cq. Thanks.
Comment 8 Sergio Correia (qrwteyrutiyoup) 2013-07-11 10:52:46 PDT
Created attachment 206476 [details]
Patch

Include fixed.
Comment 9 Build Bot 2013-07-11 11:25:31 PDT
Comment on attachment 206474 [details]
Patch

Attachment 206474 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/962174

New failing tests:
svg/batik/masking/maskRegions.svg
Comment 10 Build Bot 2013-07-11 11:25:34 PDT
Created attachment 206478 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.3
Comment 11 WebKit Commit Bot 2013-07-11 12:41:03 PDT
Comment on attachment 206476 [details]
Patch

Clearing flags on attachment: 206476

Committed r152575: <http://trac.webkit.org/changeset/152575>