<?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>119390</bug_id>
          
          <creation_ts>2013-08-01 04:59:01 -0700</creation_ts>
          <short_desc>Remove dependency on CoreFoundation from WebURLResponse</short_desc>
          <delta_ts>2013-08-07 00:18:39 -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>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick R. Gansterer">paroga</reporter>
          <assigned_to name="Patrick R. Gansterer">paroga</assigned_to>
          <cc>andersca</cc>
    
    <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>913705</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-01 04:59:01 -0700</bug_when>
    <thetext>Remove dependency on CoreFoundation from WebURLResponse</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>913706</commentid>
    <comment_count>1</comment_count>
      <attachid>207913</attachid>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-01 05:00:10 -0700</bug_when>
    <thetext>Created attachment 207913
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914165</commentid>
    <comment_count>2</comment_count>
      <attachid>207913</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-02 08:53:54 -0700</bug_when>
    <thetext>Comment on attachment 207913
Patch

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

This is really more a renaming than actually removing a dependency (I guess the CFIndex type definition might have forced a CoreFoundation reference).  Looks fine to me.  Was there a CoreFoundation include that could be removed here as well?

&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);

Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914183</commentid>
    <comment_count>3</comment_count>
      <attachid>207913</attachid>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-02 09:53:00 -0700</bug_when>
    <thetext>Comment on attachment 207913
Patch

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

&gt;&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt;&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);
&gt; 
&gt; Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.

but then i need to change the whole function implementation, do you think it makes sense for this function? imho it&apos;s not called so often...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914193</commentid>
    <comment_count>4</comment_count>
      <attachid>207913</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-02 10:27:35 -0700</bug_when>
    <thetext>Comment on attachment 207913
Patch

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

&gt;&gt;&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt;&gt;&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);
&gt;&gt; 
&gt;&gt; Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.
&gt; 
&gt; but then i need to change the whole function implementation, do you think it makes sense for this function? imho it&apos;s not called so often...

What? Why?  Does the BString constructor want a non-const String argument?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914230</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-02 11:53:11 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 207913 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=207913&amp;action=review
&gt; 
&gt; &gt;&gt;&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt; &gt;&gt;&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);
&gt; &gt;&gt; 
&gt; &gt;&gt; Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.
&gt; &gt; 
&gt; &gt; but then i need to change the whole function implementation, do you think it makes sense for this function? imho it&apos;s not called so often...
&gt; 
&gt; What? Why?  Does the BString constructor want a non-const String argument?

AFAIK WEB_UI_STRING returns String by value and not as a const reference (http://trac.webkit.org/browser/trunk/Source/WebCore/platform/LocalizedStrings.h?rev=152117#L263), so we must return String by value.
Maybe it&apos;s already too late for me today and I can&apos;t find my C++ knowledge about return values and object lifetime. :-)
BString is good with a const reference.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914248</commentid>
    <comment_count>6</comment_count>
      <attachid>207913</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2013-08-02 13:17:58 -0700</bug_when>
    <thetext>Comment on attachment 207913
Patch

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

&gt;&gt;&gt;&gt;&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt;&gt;&gt;&gt;&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.
&gt;&gt;&gt; 
&gt;&gt;&gt; but then i need to change the whole function implementation, do you think it makes sense for this function? imho it&apos;s not called so often...
&gt;&gt; 
&gt;&gt; What? Why?  Does the BString constructor want a non-const String argument?
&gt; 
&gt; AFAIK WEB_UI_STRING returns String by value and not as a const reference (http://trac.webkit.org/browser/trunk/Source/WebCore/platform/LocalizedStrings.h?rev=152117#L263), so we must return String by value.
&gt; Maybe it&apos;s already too late for me today and I can&apos;t find my C++ knowledge about return values and object lifetime. :-)
&gt; BString is good with a const reference.

Right.  But under C++03 and newer, when you bind a temporary return value to a const reference, the compiler extends the lifetime of the return value to the lifetime of the const reference.  See http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ for a brief overview.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914698</commentid>
    <comment_count>7</comment_count>
      <attachid>208149</attachid>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-05 14:41:32 -0700</bug_when>
    <thetext>Created attachment 208149
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>914702</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2013-08-05 14:48:26 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 207913 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=207913&amp;action=review
&gt; 
&gt; &gt;&gt;&gt;&gt;&gt; Source/WebKit/win/WebURLResponse.cpp:375
&gt; &gt;&gt;&gt;&gt;&gt; +    String statusText = localizedShortDescriptionForStatusCode(statusCode);
&gt; &gt;&gt;&gt;&gt; 
&gt; &gt;&gt;&gt;&gt; Seems like this could be &quot;const String&amp; statusText&quot; = ...; might allow return-value-optimization.
&gt; &gt;&gt;&gt; 
&gt; &gt;&gt;&gt; but then i need to change the whole function implementation, do you think it makes sense for this function? imho it&apos;s not called so often...
&gt; &gt;&gt; 
&gt; &gt;&gt; What? Why?  Does the BString constructor want a non-const String argument?
&gt; &gt; 
&gt; &gt; AFAIK WEB_UI_STRING returns String by value and not as a const reference (http://trac.webkit.org/browser/trunk/Source/WebCore/platform/LocalizedStrings.h?rev=152117#L263), so we must return String by value.
&gt; &gt; Maybe it&apos;s already too late for me today and I can&apos;t find my C++ knowledge about return values and object lifetime. :-)
&gt; &gt; BString is good with a const reference.
&gt; 
&gt; Right.  But under C++03 and newer, when you bind a temporary return value to a const reference, the compiler extends the lifetime of the return value to the lifetime of the const reference.  See http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/ for a brief overview.

Sorry, I though about changing the return value to const ref... My fault!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>915047</commentid>
    <comment_count>9</comment_count>
      <attachid>208149</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-08-07 00:18:38 -0700</bug_when>
    <thetext>Comment on attachment 208149
Patch

Clearing flags on attachment: 208149

Committed r153779: &lt;http://trac.webkit.org/changeset/153779&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>915048</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-08-07 00:18:39 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>207913</attachid>
            <date>2013-08-01 05:00:10 -0700</date>
            <delta_ts>2013-08-05 14:41:23 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-119390.patch</filename>
            <type>text/plain</type>
            <size>1573</size>
            <attacher name="Patrick R. Gansterer">paroga</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvd2luL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQv
d2luL0NoYW5nZUxvZwppbmRleCAwNjhlMGJjLi5lNzkxMmEyIDEwMDY0NAotLS0gYS9Tb3VyY2Uv
V2ViS2l0L3dpbi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdC93aW4vQ2hhbmdlTG9nCkBA
IC0xLDMgKzEsMTQgQEA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c2NyaXB0aW9uRm9yU3RhdHVzQ29kZShDRkluZGV4IHN0YXR1c0NvZGUpCitzdGF0aWMgU3Ry
aW5nIGxvY2FsaXplZFNob3J0RGVzY3JpcHRpb25Gb3JTdGF0dXNDb2RlKGludCBzdGF0dXNDb2Rl
KQogewogICAgIFN0cmluZyByZXN1bHQ7CiAgICAgaWYgKHN0YXR1c0NvZGUgPCAxMDAgfHwgc3Rh
dHVzQ29kZSA+PSA2MDApCkBAIC0zNzIsNyArMzcyLDcgQEAgSFJFU1VMVCBTVERNRVRIT0RDQUxM
VFlQRSBXZWJVUkxSZXNwb25zZTo6bG9jYWxpemVkU3RyaW5nRm9yU3RhdHVzQ29kZSgKICAgICBB
U1NFUlQobV9yZXNwb25zZS5pc0hUVFAoKSk7CiAgICAgaWYgKHN0YXR1c1N0cmluZykKICAgICAg
ICAgKnN0YXR1c1N0cmluZyA9IDA7Ci0gICAgU3RyaW5nIHN0YXR1c1RleHQgPSBDRkhUVFBNZXNz
YWdlQ29weUxvY2FsaXplZFNob3J0RGVzY3JpcHRpb25Gb3JTdGF0dXNDb2RlKHN0YXR1c0NvZGUp
OworICAgIFN0cmluZyBzdGF0dXNUZXh0ID0gbG9jYWxpemVkU2hvcnREZXNjcmlwdGlvbkZvclN0
YXR1c0NvZGUoc3RhdHVzQ29kZSk7CiAgICAgaWYgKCFzdGF0dXNUZXh0KQogICAgICAgICByZXR1
cm4gRV9GQUlMOwogICAgIGlmIChzdGF0dXNTdHJpbmcpCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>208149</attachid>
            <date>2013-08-05 14:41:32 -0700</date>
            <delta_ts>2013-08-07 00:18:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-119390-20130805234128.patch</filename>
            <type>text/plain</type>
            <size>1721</size>
            <attacher name="Patrick R. Gansterer">paroga</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTUzNzI0CmRp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