Geolocation request not complete when watch request was started in a different web...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 09:36:29 +0000 (09:36 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 09:36:29 +0000 (09:36 +0000)
commita377006055886e9de3603a9ac004cdc92324705d
tree877e7708d7608e2bb09d99cfe750c1f236d06d51
parent675aa9b70b2f16dba00728711986809ef2be5159
Geolocation request not complete when watch request was started in a different web process
https://bugs.webkit.org/show_bug.cgi?id=195996

Reviewed by Alex Christensen.

Source/WebKit:

In WebGeolocationManagerProxy::startUpdating() we do nothing when the provider is already updating. We should
reply with a DidChangePosition using the last known position, if available. If we are updating, but we still
don't have a known position, the request will be completed when
WebGeolocationManagerProxy::providerDidChangePosition() is called since it always notifies all web
processes.

* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::providerDidChangePosition): Cache the position.
(WebKit::WebGeolocationManagerProxy::startUpdating): Reply using cached position if already known.
* UIProcess/WebGeolocationManagerProxy.h:
(WebKit::WebGeolocationManagerProxy::lastPosition const): Return cached position.
* WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
(WebKit::WebGeolocationClient::lastPosition): Remove the FIXME since we don't want this feature.

Tools:

Add a test case.

* TestWebKitAPI/Tests/WebKit/Geolocation.cpp:
(TestWebKitAPI::runJavaScriptAlert):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebGeolocationManagerProxy.cpp
Source/WebKit/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit/WebProcess/WebCoreSupport/WebGeolocationClient.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit/Geolocation.cpp