<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>121436</bug_id>
          
          <creation_ts>2013-09-16 08:51:49 -0700</creation_ts>
          <short_desc>Buildfix in WebResourceBuffer.h to make GCC 4.6 happy</short_desc>
          <delta_ts>2013-09-17 08:03:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>110141</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Csaba Osztrogonác">ossy</reporter>
          <assigned_to name="Csaba Osztrogonác">ossy</assigned_to>
          <cc>beidson</cc>
    
    <cc>kbalazs</cc>
    
    <cc>ossy</cc>
    
    <cc>skyul</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>929732</commentid>
    <comment_count>0</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-09-16 08:51:49 -0700</bug_when>
    <thetext>WebResourceBuffer.h is only used by NetworkProcess now and the following
build failure was revealed by https://bugs.webkit.org/show_bug.cgi?id=110141:

/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp:34:1: error: prototype for ‘WebKit::WebResourceBuffer::WebResourceBuffer(WTF::PassRefPtr&lt;WebKit::ShareableResource&gt;)’ does not match any in class ‘WebKit::WebResourceBuffer’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:36:7: error: candidates are: WebKit::WebResourceBuffer::WebResourceBuffer(const WebKit::WebResourceBuffer&amp;)
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:47:5: error:                 WebKit::WebResourceBuffer::WebResourceBuffer(WTF::PassRefPtr&lt;ShareableResource&gt;)
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp: In member function ‘virtual const char* WebKit::WebResourceBuffer::data() const’:
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp:46:52: error: invalid use of incomplete type ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:32:7: error: forward declaration of ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp: In member function ‘virtual unsigned int WebKit::WebResourceBuffer::size() const’:
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp:51:22: error: invalid use of incomplete type ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:32:7: error: forward declaration of ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp: In member function ‘virtual bool WebKit::WebResourceBuffer::isEmpty() const’:
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp:56:38: error: invalid use of incomplete type ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:32:7: error: forward declaration of ‘struct ShareableResource’
In file included from /home/ossy/WebKitNix/Source/WTF/wtf/RefPtr.h:29:0,
                 from /home/ossy/WebKitNix/Source/WTF/wtf/VectorTraits.h:26,
                 from /home/ossy/WebKitNix/Source/WTF/wtf/Vector.h:31,
                 from /home/ossy/WebKitNix/Source/WebCore/platform/SharedBuffer.h:33,
                 from /home/ossy/WebKitNix/Source/WebCore/loader/ResourceBuffer.h:29,
                 from /home/ossy/WebKitNix/WebKitBuild/Release/DerivedSources/WebKit2/include/WebCore/ResourceBuffer.h:1,
                 from /home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:30,
                 from /home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.cpp:27:
/home/ossy/WebKitNix/Source/WTF/wtf/PassRefPtr.h: In function ‘void WTF::derefIfNotNull(T*) [with T = ShareableResource]’:
/home/ossy/WebKitNix/Source/WTF/wtf/PassRefPtr.h:67:39:   instantiated from ‘WTF::PassRefPtr&lt;T&gt;::~PassRefPtr() [with T = ShareableResource]’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:38:137:   instantiated from here
/home/ossy/WebKitNix/Source/WTF/wtf/PassRefPtr.h:52:13: error: invalid use of incomplete type ‘struct ShareableResource’
/home/ossy/WebKitNix/Source/WebKit2/Shared/WebResourceBuffer.h:32:7: error: forward declaration of ‘struct ShareableResource’

related comments:
------------------
-https://bugs.webkit.org/show_bug.cgi?id=110141#c8
Kwang Yul Seo: &quot;Changed forward declaration of ShareableResource to actual include because GCC requires a definition of the type for passing it in a PassOwnPtr.&quot;

- https://bugs.webkit.org/show_bug.cgi?id=110141#c11
Brady Eidson: &quot; The ChangeLog indicates this undesirable change is because of GCC requirements.
Why does GCC have this deficiency?
Was the deficiency in GCC fixed in a later version?
There&apos;s been a vocal and public push to move the compiler dependencies in the project forward, and WebKit2 has traditionally been the flagship of this effort.  Is it truly unavoidable to have to make this type of change?&quot;

- https://bugs.webkit.org/show_bug.cgi?id=110141#c12
Kwang Yul Seo: &quot;This change was in the original patch written by Balazs Kelemen. I double-checked and found that this is not needed at least in GCC 4.7. I will revert the change because we already limit the supported compilers to GCC &gt;= 4.7 and Clang &gt;= 3.0 (Bug 109932). Balazs, do you remember the version of GCC you had this problem?&quot;

- https://bugs.webkit.org/show_bug.cgi?id=110141#c21 by me
- https://bugs.webkit.org/show_bug.cgi?id=110141#c22 by kbalazs
- https://bugs.webkit.org/show_bug.cgi?id=110141#c23 by me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929735</commentid>
    <comment_count>1</comment_count>
      <attachid>211795</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-09-16 08:56:12 -0700</bug_when>
    <thetext>Created attachment 211795
Patch

I don&apos;t think if we should drop GCC 4.6 (default GCC on the latest Ubuntu LTS - 12.04) support at all if we can fix it with this simple patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929828</commentid>
    <comment_count>2</comment_count>
      <attachid>211795</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-09-16 11:27:26 -0700</bug_when>
    <thetext>Comment on attachment 211795
Patch

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

&gt; Source/WebKit2/ChangeLog:12
&gt; +        * Shared/WebResourceBuffer.h: Changed forward declaration of ShareableResource to
&gt; +        actual include because GCC requires a definition of the type for passing it in a PassOwnPtr.

That explanation doesn’t make sense. This header doesn’t have any PassOwnPtr.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929830</commentid>
    <comment_count>3</comment_count>
      <attachid>211795</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-09-16 11:28:18 -0700</bug_when>
    <thetext>Comment on attachment 211795
Patch

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

&gt; Source/WebKit2/Shared/WebResourceBuffer.h:29
&gt; +#include &quot;ShareableResource.h&quot;

Does adding this include to the WebResourceBuffer.cpp file fix the compilation of that file? I don’t think this is needed in the header.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>929853</commentid>
    <comment_count>4</comment_count>
      <attachid>211795</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-09-16 12:12:09 -0700</bug_when>
    <thetext>Comment on attachment 211795
Patch

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

&gt;&gt; Source/WebKit2/ChangeLog:12
&gt;&gt; +        actual include because GCC requires a definition of the type for passing it in a PassOwnPtr.
&gt; 
&gt; That explanation doesn’t make sense. This header doesn’t have any PassOwnPtr.

Good point, it seems it was a typo, not PassOwnPtr, but PassRefPtr.

&gt;&gt; Source/WebKit2/Shared/WebResourceBuffer.h:29
&gt;&gt; +#include &quot;ShareableResource.h&quot;
&gt; 
&gt; Does adding this include to the WebResourceBuffer.cpp file fix the compilation of that file? I don’t think this is needed in the header.

Thanks the idea, maybe it is enough, I&apos;ll check it tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>930219</commentid>
    <comment_count>5</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2013-09-17 08:03:11 -0700</bug_when>
    <thetext>I checked it again and it seems we don&apos;t need this workaround anymore
after http://trac.webkit.org/changeset/155232/trunk/Source/WTF/wtf/PassRefPtr.h 

The problem was the hack removed by r155232 used inline instead of 
always inline. But now it works fine.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>211795</attachid>
            <date>2013-09-16 08:56:12 -0700</date>
            <delta_ts>2013-09-16 12:12:33 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-121436-20130916175610.patch</filename>
            <type>text/plain</type>
            <size>1600</size>
            <attacher name="Csaba Osztrogonác">ossy</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTU1ODU5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0Mi9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViS2l0Mi9DaGFuZ2VMb2cKaW5kZXggMzhmMjI5M2E5Y2VjNmRm
ZDE2NTE3NmVhMDY1ZTZiOTZiY2IwZTU1OC4uMjYyODdjMGQ4NWZkYjA2M2MxMTMwYjE0ZWQzZjlj
YmMwNTk2MzhjMyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdDIvQ2hhbm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