Geolocation should use a ScriptExecutionContext as its context object
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Mar 2012 18:17:58 +0000 (18:17 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Mar 2012 18:17:58 +0000 (18:17 +0000)
commitc4126c91e82b8c5c5b9956a622cca58ae5a2b621
tree9f730d8a66618f2e09891c6b7553203af9068729
parent96c148e544aec9d9d3c1861dd403d650de1ba352
Geolocation should use a ScriptExecutionContext as its context object
https://bugs.webkit.org/show_bug.cgi?id=80248

Reviewed by Kentaro Hara.

Source/WebCore:

This patch updates Geolocation to use some more modern WebCore
mechanisms.  Previously, Geolocation used a Frame as a context object,
which required a bunch of manual integration with the PageCache as well
as custom signaling for Geolocation::reset().  After this patch,
Geolocation subclasses ActiveDOMObject, which does all this work
automatically.

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::create):
(WebCore):
(WebCore::Geolocation::Geolocation):
(WebCore::Geolocation::~Geolocation):
(WebCore::Geolocation::document):
(WebCore::Geolocation::frame):
(WebCore::Geolocation::page):
(WebCore::Geolocation::stop):
(WebCore::Geolocation::getCurrentPosition):
(WebCore::Geolocation::watchPosition):
(WebCore::Geolocation::requestPermission):
(WebCore::Geolocation::clearWatch):
(WebCore::Geolocation::setIsAllowed):
* Modules/geolocation/Geolocation.h:
(WebCore):
(Geolocation):
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore):
(WebCore::NavigatorGeolocation::geolocation):
* Modules/geolocation/NavigatorGeolocation.h:
(NavigatorGeolocation):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(Document):
* history/PageCache.cpp:
(WebCore::logCanCacheFrameDecision):
(WebCore::PageCache::canCachePageContainingThisFrame):

Source/WebKit/chromium:

Rather than indirecting through the Frame to get the SecurityOrigin, we
should get the SecurityOrigin directly from ScriptExecutionContext.

* src/WebGeolocationPermissionRequest.cpp:
(WebKit::WebGeolocationPermissionRequest::securityOrigin):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _cacheabilityDictionary]):
    - We no longer special-case Geolocation.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/geolocation/Geolocation.h
Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp
Source/WebCore/Modules/geolocation/NavigatorGeolocation.h
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/history/PageCache.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm