<?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>194823</bug_id>
          
          <creation_ts>2019-02-19 11:40:39 -0800</creation_ts>
          <short_desc>Always call CompletionHandlers after r240909</short_desc>
          <delta_ts>2019-02-20 14:59:53 -0800</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>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alex Christensen">achristensen</reporter>
          <assigned_to name="Alex Christensen">achristensen</assigned_to>
          <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dbates</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>ggaren</cc>
    
    <cc>japhet</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1507743</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-19 11:40:39 -0800</bug_when>
    <thetext>Always call CompletionHandlers after r240909</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507744</commentid>
    <comment_count>1</comment_count>
      <attachid>362404</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-19 11:40:59 -0800</bug_when>
    <thetext>Created attachment 362404
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507770</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-19 12:23:27 -0800</bug_when>
    <thetext>Looks like the patch isn&apos;t building??</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507781</commentid>
    <comment_count>3</comment_count>
      <attachid>362417</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-19 12:57:20 -0800</bug_when>
    <thetext>Created attachment 362417
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507801</commentid>
    <comment_count>4</comment_count>
      <attachid>362417</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-19 13:48:12 -0800</bug_when>
    <thetext>Comment on attachment 362417
Patch

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

&gt; Source/WebCore/loader/PolicyChecker.cpp:196
&gt;          if (!responseIdentifier.isValidFor(requestIdentifier))
&gt; -            return;
&gt; +            return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad);

I don&apos;t think this is quite right.

When the response identifier is less than what we have,
it means the response was for some other resource we had requested a policy check in the past.
It’s still possible to receive the right policy check response in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507816</commentid>
    <comment_count>5</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-19 14:18:23 -0800</bug_when>
    <thetext>We definitely need to do something with the CompletionHandlers.  If we don&apos;t call them we need to store them somewhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507965</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-19 19:01:50 -0800</bug_when>
    <thetext>(In reply to Alex Christensen from comment #5)
&gt; We definitely need to do something with the CompletionHandlers.  If we don&apos;t
&gt; call them we need to store them somewhere.

Oh, that&apos;s a good point. Maybe we DO need to fail in this case because we don&apos;t store the completion handler anywhere.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1507966</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-19 19:02:55 -0800</bug_when>
    <thetext>But hang on, if we did that, wouldn&apos;t it mean that WebKit layer&apos;s listener map would still contain a stale completion handler which would never get called anyway?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508121</commentid>
    <comment_count>8</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-20 10:17:38 -0800</bug_when>
    <thetext>No</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508215</commentid>
    <comment_count>9</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-20 13:35:38 -0800</bug_when>
    <thetext>(In reply to Alex Christensen from comment #8)
&gt; No

Why not? If we&apos;ve reached this point, it means that we&apos;ve got listenerID confused, and invoked the wrong listener with a policy check response. That would mean that the other listener for which this policy check response was really meant for would be left in the map. How does the other listener ever get a policy check response?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508233</commentid>
    <comment_count>10</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-02-20 14:05:04 -0800</bug_when>
    <thetext>listenerID corresponds to WebFrame&apos;s m_policyFunction, and if they don&apos;t line up then WebFrame::invalidatePolicyListener calls the CompletionHandler owned by the WebFrame in that case.  The CompletionHandlers being fixed by this patch are not owned by anything.  They need to be called or owned.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508235</commentid>
    <comment_count>11</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-20 14:07:29 -0800</bug_when>
    <thetext>(In reply to Alex Christensen from comment #10)
&gt; listenerID corresponds to WebFrame&apos;s m_policyFunction, and if they don&apos;t
&gt; line up then WebFrame::invalidatePolicyListener calls the CompletionHandler
&gt; owned by the WebFrame in that case.

Oh, that&apos;s a good point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508278</commentid>
    <comment_count>12</comment_count>
      <attachid>362417</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-20 14:52:24 -0800</bug_when>
    <thetext>Comment on attachment 362417
Patch

Clearing flags on attachment: 362417

Committed r241842: &lt;https://trac.webkit.org/changeset/241842&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508279</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-02-20 14:52:25 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1508284</commentid>
    <comment_count>14</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-02-20 14:59:53 -0800</bug_when>
    <thetext>&lt;rdar://problem/48253351&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>362404</attachid>
            <date>2019-02-19 11:40:59 -0800</date>
            <delta_ts>2019-02-19 12:57:18 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-194823-20190219114058.patch</filename>
            <type>text/plain</type>
            <size>1776</size>
            <attacher name="Alex Christensen">achristensen</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI0MTc2NykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDE5LTAyLTE5ICBBbGV4IENo
cmlzdGVuc2VuICA8YWNocmlzdGVuc2VuQHdlYmtpdC5vcmc+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WN5QWN0aW9u
LCBQb2xpY3lDaGVja0lkZW50aWZpZXIgcmVzcG9uc2VJZGVudGlmaWVyKSBtdXRhYmxlIHsKIAog
ICAgICAgICBpZiAoIXJlc3BvbnNlSWRlbnRpZmllci5pc1ZhbGlkRm9yKHJlcXVlc3RJZGVudGlm
aWVyKSkKLSAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih7
IH0sIG51bGxwdHIsIE5hdmlnYXRpb25Qb2xpY3lEZWNpc2lvbjo6SWdub3JlTG9hZCk7CiAKICAg
ICAgICAgbV9kZWxlZ2F0ZUlzRGVjaWRpbmdOYXZpZ2F0aW9uUG9saWN5ID0gZmFsc2U7CiAKQEAg
LTIzNCw3ICsyMzQsNyBAQCB2b2lkIFBvbGljeUNoZWNrZXI6OmNoZWNrTmV3V2luZG93UG9saWN5
CiAgICAgICAgIHJlcXVlc3RJZGVudGlmaWVyXSAoUG9saWN5QWN0aW9uIHBvbGljeUFjdGlvbiwg
UG9saWN5Q2hlY2tJZGVudGlmaWVyIHJlc3BvbnNlSWRlbnRpZmllcikgbXV0YWJsZSB7CiAKICAg
ICAgICAgaWYgKCFyZXNwb25zZUlkZW50aWZpZXIuaXNWYWxpZEZvcihyZXF1ZXN0SWRlbnRpZmll
cikpCi0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oeyB9
LCBudWxscHRyLCBOYXZpZ2F0aW9uUG9saWN5RGVjaXNpb246Oklnbm9yZUxvYWQpOwogCiAgICAg
ICAgIHN3aXRjaCAocG9saWN5QWN0aW9uKSB7CiAgICAgICAgIGNhc2UgUG9saWN5QWN0aW9uOjpE
b3dubG9hZDoK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>362417</attachid>
            <date>2019-02-19 12:57:20 -0800</date>
            <delta_ts>2019-02-20 14:52:24 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-194823-20190219125719.patch</filename>
            <type>text/plain</type>
            <size>1768</size>
            <attacher name="Alex Christensen">achristensen</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDI0MTc2NykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDE5LTAyLTE5ICBBbGV4IENo
cmlzdGVuc2VuICA8YWNocmlzdGVuc2VuQHdlYmtpdC5vcmc+CisKKyAgICAgICAgQWx3YXlzIGNh
bGwgQ29tcGxldGlvbkhhbmRsZXJzIGFmdGVyIHIyNDA5MDkKKyAgICAgICAgaHR0cHM6Ly9idWdz
LndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE5NDgyMworCisgICAgICAgIFJldmlld2VkIGJ5
IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogbG9hZGVyL1BvbGljeUNoZWNrZXIuY3BwOgor
ICAgICAgICAoV2ViQ29yZTo6UG9saWN5Q2hlY2tlcjo6Y2hlY2tOYXZpZ2F0aW9uUG9saWN5KToK
KyAgICAgICAgKFdlYkNvcmU6OlBvbGljeUNoZWNrZXI6OmNoZWNrTmV3V2luZG93UG9saWN5KToK
KwogMjAxOS0wMi0xOSAgQ29tbWl0IFF1ZXVlICA8Y29tbWl0LXF1ZXVlQHdlYmtpdC5vcmc+CiAK
ICAgICAgICAgVW5yZXZpZXdlZCwgcm9sbGluZyBvdXQgcjI0MTcyMi4KSW5kZXg6IFNvdXJjZS9X
ZWJDb3JlL2xvYWRlci9Qb2xpY3lDaGVja2VyLmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09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50aWZpZXIuaXNWYWxpZEZvcihyZXF1ZXN0SWRlbnRpZmll
cikpCi0gICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oeyB9
LCBudWxscHRyLCB7IH0sIHsgfSwgU2hvdWxkQ29udGludWU6Ok5vKTsKIAogICAgICAgICBzd2l0
Y2ggKHBvbGljeUFjdGlvbikgewogICAgICAgICBjYXNlIFBvbGljeUFjdGlvbjo6RG93bmxvYWQ6
Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>