Bug 212289 - 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.
Summary: Do not send a second sync request for positition information to the web proce...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-22 16:49 PDT by Megan Gardner
Modified: 2020-05-28 13:10 PDT (History)
1 user (show)

See Also:


Attachments
Patch (4.80 KB, patch)
2020-05-22 16:55 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (5.16 KB, patch)
2020-05-27 14:26 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (4.96 KB, patch)
2020-05-27 16:35 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch for landing (4.95 KB, patch)
2020-05-28 12:28 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].