diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp | 19 |
1 files changed, 13 insertions, 6 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) |