<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add SPI for handling geolocation authorization requests"
   href="https://bugs.webkit.org/show_bug.cgi?id=170362#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add SPI for handling geolocation authorization requests"
   href="https://bugs.webkit.org/show_bug.cgi?id=170362">bug 170362</a>
              from <span class="vcard"><a class="email" href="mailto:david_quesada&#64;apple.com" title="David Quesada &lt;david_quesada&#64;apple.com&gt;"> <span class="fn">David Quesada</span></a>
</span></b>
        <pre>(In reply to Alex Christensen from <a href="show_bug.cgi?id=170362#c6">comment #6</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=306015&amp;action=diff" name="attach_306015" title="Patch">attachment 306015</a> <a href="attachment.cgi?id=306015&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=306015&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=306015&amp;action=review</a>
&gt; 
&gt; Test failure seems unrelated.  This looks good.  It seems like we had a
&gt; synchronous callback and this adds an asynchronous one.</span >

As far as I know, nothing uses the synchronous method (specifically, it is not being used for the purpose for which it was added), so I would like to get rid of it. But removing SPI probably isn't something I can just bundle in with another change.

<span class="quote">&gt; You should make an API test that opens a page that requests geolocation data
&gt; and asynchronously call the decisionHandler with a callOnMainThread in the
&gt; delegate callback that calls the decisionHandler.  Then we can do things
&gt; like test the behavior if the delegate callback isn't there, test the
&gt; behavior if we call the callback twice, make sure there are no
&gt; use-after-free bugs on the asan bots, make sure the expected behavior
&gt; happens in JavaScript when a request is accepted and denied, etc.</span >

I can look into doing this. I wasn't sure API tests would work out-of-the-box for this, since we would possibly have to either (1) entitle TestWebKitAPI for location services access or (2) expose more about WKGeolocationProviderIOS and WebGeolocationCoreLocationProvider so the API tests can configure WKGeolocationProviderIOS to go through its motions without actually touching CoreLocation.

If we didn't make either of these changes, the API tests would fail or get stuck at the system location prompt when TestWebKitAPI tries to request location permission. If we only did (1), there may be flakiness when running the tests if geolocation isn’t available on the machine running the simulator and tests. (2) is more architectural work than I would have liked to do for this, but I’ll make these changes if this is the best approach. What are your thoughts?

<span class="quote">&gt; 
&gt; &gt; Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.mm:185
&gt; &gt; +            URL requestFrameURL(URL(), request.frame-&gt;url());
&gt; 
&gt; Can't we just call the copy constructor here?</span >

Sorry, I lazily copied this from the synchronous delegate call. That would make it just &quot;URL requestFrameURL(request.frame-&gt;url());&quot; , right?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>