diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/Geolocation')
-rw-r--r-- | Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp | 19 | ||||
-rw-r--r-- | Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h | 2 |
2 files changed, 14 insertions, 7 deletions
diff --git a/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp b/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp index c40cf6681..9b2bb7652 100644 --- a/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp +++ b/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp @@ -32,10 +32,12 @@ #include "WebFrame.h" #include "WebPage.h" #include "WebPageProxyMessages.h" +#include <WebCore/Document.h> #include <WebCore/Frame.h> #include <WebCore/FrameLoader.h> #include <WebCore/Geolocation.h> #include <WebCore/SecurityOrigin.h> +#include <WebCore/SecurityOriginData.h> using namespace WebCore; @@ -54,20 +56,25 @@ GeolocationPermissionRequestManager::GeolocationPermissionRequestManager(WebPage void GeolocationPermissionRequestManager::startRequestForGeolocation(Geolocation* geolocation) { + Frame* frame = geolocation->frame(); + + ASSERT_WITH_MESSAGE(frame, "It is not well understood in which cases the Geolocation is alive after its frame goes away. If you hit this assertion, please add a test covering this case."); + if (!frame) { + geolocation->setIsAllowed(false); + return; + } + uint64_t geolocationID = generateGeolocationID(); m_geolocationToIDMap.set(geolocation, geolocationID); m_idToGeolocationMap.set(geolocationID, geolocation); - Frame* frame = geolocation->frame(); - - WebFrameLoaderClient* webFrameLoaderClient = toWebFrameLoaderClient(frame->loader().client()); - WebFrame* webFrame = webFrameLoaderClient ? webFrameLoaderClient->webFrame() : 0; + WebFrame* webFrame = WebFrame::fromCoreFrame(*frame); ASSERT(webFrame); - SecurityOrigin* origin = frame->document()->securityOrigin(); + SecurityOrigin& origin = frame->document()->securityOrigin(); - m_page->send(Messages::WebPageProxy::RequestGeolocationPermissionForFrame(geolocationID, webFrame->frameID(), origin->databaseIdentifier())); + m_page->send(Messages::WebPageProxy::RequestGeolocationPermissionForFrame(geolocationID, webFrame->frameID(), SecurityOriginData::fromSecurityOrigin(origin).databaseIdentifier())); } void GeolocationPermissionRequestManager::cancelRequestForGeolocation(Geolocation* geolocation) diff --git a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h index 95908f619..5fa2fbbb8 100644 --- a/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h +++ b/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h @@ -58,7 +58,7 @@ public: private: // IPC::MessageReceiver - virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override; + void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; bool isUpdating() const { return !m_pageSet.isEmpty(); } bool isHighAccuracyEnabled() const { return !m_highAccuracyPageSet.isEmpty(); } |