Bug 212289

Summary: Do not send a second sync request for positition information to the web process if we have not recieved information since the previous sync request.
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Status: RESOLVED FIXED    
Severity: Normal CC: thorton
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing none

Description Megan Gardner 2020-05-22 16:49:07 PDT
Do not send a second sync request for positition information to the web process if we have not recieved information since the previous sync request.
Comment 1 Megan Gardner 2020-05-22 16:55:48 PDT
Created attachment 400090 [details]
Patch
Comment 2 Megan Gardner 2020-05-22 16:56:12 PDT
<rdar://problem/58494578>
Comment 3 Megan Gardner 2020-05-27 14:26:20 PDT
Created attachment 400382 [details]
Patch
Comment 4 Tim Horton 2020-05-27 15:46:28 PDT
Comment on attachment 400382 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2245
> +    if (!_isWaitingOnPositionInformation) {

I would flip this around into an early return (don't wait if we're already waiting)

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2253
> +    return _isWaitingOnPositionInformation;

Why do we return YES (that we have valid state) in the case where we're already waiting??
Comment 5 Megan Gardner 2020-05-27 16:35:35 PDT
Created attachment 400401 [details]
Patch
Comment 6 Tim Horton 2020-05-27 20:15:05 PDT
Comment on attachment 400401 [details]
Patch

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

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:2245
> +    if (_isWaitingOnPositionInformation)

I think this can just check _outstandingPositionInformationRequest, no need for a new bool, right?
Comment 7 Megan Gardner 2020-05-28 12:28:30 PDT
Created attachment 400493 [details]
Patch for landing
Comment 8 Megan Gardner 2020-05-28 12:33:13 PDT
I know I looked at using that bool, but concluded that it would not be enough information.
Comment 9 Megan Gardner 2020-05-28 12:34:42 PDT
Oh, right because it will be true after we ask for position information, thus we will never attempt a waitForAndDispatchImmediately, which is not what we want.
Comment 10 EWS 2020-05-28 13:10:17 PDT
Committed r262255: <https://trac.webkit.org/changeset/262255>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400493 [details].