Changeset 112720 in webkit


Ignore:
Timestamp:
Mar 30, 2012 1:50:09 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

GEOLOCATION should be implemented as Page Supplement
https://bugs.webkit.org/show_bug.cgi?id=82228

Patch by Mark Pilgrim <pilgrim@chromium.org> on 2012-03-30
Reviewed by Adam Barth.

Source/WebCore:

Geolocation now uses the Supplement interface instead of
keeping an instance variable on Page. This allows us to
remove all geolocation-related functions, variables, and
ifdefs out of Page and into Modules/geolocation/.

  • Modules/geolocation/Geolocation.cpp:

(WebCore::Geolocation::stop):
(WebCore::Geolocation::lastPosition):
(WebCore::Geolocation::requestPermission):
(WebCore::Geolocation::startUpdating):
(WebCore::Geolocation::stopUpdating):

  • Modules/geolocation/Geolocation.h:

(WebCore):

  • Modules/geolocation/GeolocationController.cpp:

(WebCore::GeolocationController::supplementName):
(WebCore):
(WebCore::provideGeolocationTo):

  • Modules/geolocation/GeolocationController.h:

(GeolocationController):
(WebCore::GeolocationController::from):

  • WebCore.exp.in:
  • page/GeolocationClient.h:

(WebCore):
(GeolocationClient):

  • page/Page.cpp:

(WebCore::Page::Page):
(WebCore::Page::PageClients::PageClients):

  • page/Page.h:

(WebCore):
(PageClients):
(Page):

Source/WebKit/blackberry:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::init):

  • WebCoreSupport/GeolocationControllerClientBlackBerry.cpp:

(GeolocationControllerClientBlackBerry::onLocationUpdate):
(GeolocationControllerClientBlackBerry::onLocationError):

  • WebKitSupport/DumpRenderTreeSupport.cpp:

(DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests):
(DumpRenderTreeSupport::resetGeolocationMock):
(DumpRenderTreeSupport::setMockGeolocationError):
(DumpRenderTreeSupport::setMockGeolocationPermission):
(DumpRenderTreeSupport::setMockGeolocationPosition):

Source/WebKit/chromium:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::WebViewImpl):

Source/WebKit/gtk:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • WebCoreSupport/DumpRenderTreeSupportGtk.cpp:

(DumpRenderTreeSupportGtk::resetGeolocationClientMock):
(DumpRenderTreeSupportGtk::setMockGeolocationPermission):
(DumpRenderTreeSupportGtk::setMockGeolocationPosition):
(DumpRenderTreeSupportGtk::setMockGeolocationError):
(DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests):

  • WebCoreSupport/GeolocationClientGtk.cpp:

(WebKit::GeolocationClient::updatePosition):
(WebKit::GeolocationClient::errorOccured):

  • webkit/webkitwebview.cpp:

(webkit_web_view_init):

Source/WebKit/mac:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _geolocationDidChangePosition:]):
(-[WebView _geolocationDidFailWithError:]):

Source/WebKit/qt:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • Api/qwebpage.cpp:

(QWebPagePrivate::QWebPagePrivate):

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp:

(DumpRenderTreeSupportQt::resetGeolocationMock):
(DumpRenderTreeSupportQt::setMockGeolocationPermission):
(DumpRenderTreeSupportQt::setMockGeolocationPosition):
(DumpRenderTreeSupportQt::setMockGeolocationError):
(DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests):

  • WebCoreSupport/GeolocationClientQt.cpp:

(WebCore::GeolocationClientQt::positionUpdated):
(WebCore::GeolocationClientQt::startUpdating):

Source/WebKit/win:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • WebView.cpp:

(WebView::initWithFrame):
(WebView::geolocationDidChangePosition):
(WebView::geolocationDidFailWithError):

Source/WebKit2:

Geolocation is now a Supplement in Page so the interface
has changed for setting up the page's geolocation client
initially and accessing the controller later.

  • WebProcess/Geolocation/WebGeolocationManager.cpp:

(WebKit::WebGeolocationManager::didChangePosition):
(WebKit::WebGeolocationManager::didFailToDeterminePosition):

  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::setGeoLocationPermission):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::WebPage):

Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112719 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation now uses the Supplement interface instead of
     9        keeping an instance variable on Page. This allows us to
     10        remove all geolocation-related functions, variables, and
     11        ifdefs out of Page and into Modules/geolocation/.
     12
     13        * Modules/geolocation/Geolocation.cpp:
     14        (WebCore::Geolocation::stop):
     15        (WebCore::Geolocation::lastPosition):
     16        (WebCore::Geolocation::requestPermission):
     17        (WebCore::Geolocation::startUpdating):
     18        (WebCore::Geolocation::stopUpdating):
     19        * Modules/geolocation/Geolocation.h:
     20        (WebCore):
     21        * Modules/geolocation/GeolocationController.cpp:
     22        (WebCore::GeolocationController::supplementName):
     23        (WebCore):
     24        (WebCore::provideGeolocationTo):
     25        * Modules/geolocation/GeolocationController.h:
     26        (GeolocationController):
     27        (WebCore::GeolocationController::from):
     28        * WebCore.exp.in:
     29        * page/GeolocationClient.h:
     30        (WebCore):
     31        (GeolocationClient):
     32        * page/Page.cpp:
     33        (WebCore::Page::Page):
     34        (WebCore::Page::PageClients::PageClients):
     35        * page/Page.h:
     36        (WebCore):
     37        (PageClients):
     38        (Page):
     39
    1402012-03-30  Anders Carlsson  <andersca@apple.com>
    241
  • trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp

    r112592 r112720  
    276276    Page* page = this->page();
    277277    if (page && m_allowGeolocation == InProgress)
    278         page->geolocationController()->cancelPermissionRequest(this);
     278        GeolocationController::from(page)->cancelPermissionRequest(this);
    279279    // The frame may be moving to a new page and we want to get the permissions from the new page's client.
    280280    m_allowGeolocation = Unknown;
     
    292292        return 0;
    293293
    294     m_lastPosition = createGeoposition(page->geolocationController()->lastPosition());
     294    m_lastPosition = createGeoposition(GeolocationController::from(page)->lastPosition());
    295295
    296296    return m_lastPosition.get();
     
    615615
    616616    // Ask the embedder: it maintains the geolocation challenge policy itself.
    617     page->geolocationController()->requestPermission(this);
     617    GeolocationController::from(page)->requestPermission(this);
    618618}
    619619
     
    672672        return false;
    673673
    674     page->geolocationController()->addObserver(this, notifier->options()->enableHighAccuracy());
     674    GeolocationController::from(page)->addObserver(this, notifier->options()->enableHighAccuracy());
    675675    return true;
    676676}
     
    682682        return;
    683683
    684     page->geolocationController()->removeObserver(this);
     684    GeolocationController::from(page)->removeObserver(this);
    685685}
    686686
  • trunk/Source/WebCore/Modules/geolocation/Geolocation.h

    r112592 r112720  
    4242class Document;
    4343class Frame;
     44class GeolocationController;
     45class GeolocationError;
    4446class GeolocationPosition;
    45 class GeolocationError;
    4647class Page;
    4748class ScriptExecutionContext;
  • trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp

    r112559 r112720  
    126126}
    127127
     128const AtomicString& GeolocationController::supplementName()
     129{
     130    DEFINE_STATIC_LOCAL(AtomicString, name, ("GeolocationController"));
     131    return name;
     132}
     133
     134void provideGeolocationTo(Page* page, GeolocationClient* client)
     135{
     136    Supplement<Page>::provideTo(page, GeolocationController::supplementName(), GeolocationController::create(page, client));
     137}
     138   
    128139} // namespace WebCore
    129140
  • trunk/Source/WebCore/Modules/geolocation/GeolocationController.h

    r112559 r112720  
    3030
    3131#include "Geolocation.h"
     32#include "Page.h"
    3233#include <wtf/HashSet.h>
    3334#include <wtf/Noncopyable.h>
     
    4142class Page;
    4243
    43 class GeolocationController {
     44class GeolocationController : public Supplement<Page> {
    4445    WTF_MAKE_NONCOPYABLE(GeolocationController);
    4546public:
     
    6162    GeolocationClient* client() { return m_client; }
    6263
     64    static const AtomicString& supplementName();
     65    static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
     66
    6367private:
    6468    GeolocationController(Page*, GeolocationClient*);
  • trunk/Source/WebCore/WebCore.exp.in

    r112707 r112720  
    17221722__ZN7WebCore11GeolocationD1Ev
    17231723__ZNK7WebCore11Geolocation5frameEv
     1724__ZN7WebCore20provideGeolocationToEPNS_4PageEPNS_17GeolocationClientE
    17241725__ZN7WebCore21GeolocationClientMock13setPermissionEb
    17251726__ZN7WebCore21GeolocationController13errorOccurredEPNS_16GeolocationErrorE
     1727__ZN7WebCore21GeolocationController14supplementNameEv
    17261728__ZN7WebCore21GeolocationController15positionChangedEPNS_19GeolocationPositionE
    17271729#endif
  • trunk/Source/WebCore/page/GeolocationClient.h

    r112559 r112720  
    3131class Geolocation;
    3232class GeolocationPosition;
     33class Page;
    3334
    3435class GeolocationClient {
     
    4849    virtual void cancelPermissionRequest(Geolocation*) = 0;
    4950
     51    void provideGeolocationTo(Page*, GeolocationClient*);
     52
    5053protected:
    5154    virtual ~GeolocationClient() { }
    5255};
    5356
     57void provideGeolocationTo(Page*, GeolocationClient*);
     58
    5459} // namespace WebCore
    5560
  • trunk/Source/WebCore/page/Page.cpp

    r112559 r112720  
    4444#include "FrameTree.h"
    4545#include "FrameView.h"
    46 #include "GeolocationController.h"
    4746#include "HTMLElement.h"
    4847#include "HistoryItem.h"
     
    123122    , m_inspectorController(InspectorController::create(this, pageClients.inspectorClient))
    124123#endif
    125 #if ENABLE(GEOLOCATION)
    126     , m_geolocationController(GeolocationController::create(this, pageClients.geolocationClient))
    127 #endif
    128124#if ENABLE(POINTER_LOCK)
    129125    , m_pointerLockController(PointerLockController::create(this))
     
    11211117    , dragClient(0)
    11221118    , inspectorClient(0)
    1123     , geolocationClient(0)
    11241119{
    11251120}
  • trunk/Source/WebCore/page/Page.h

    r112559 r112720  
    6464    class Frame;
    6565    class FrameSelection;
    66     class GeolocationClient;
    67     class GeolocationController;
    6866    class HaltablePlugin;
    6967    class HistoryItem;
     
    109107            DragClient* dragClient;
    110108            InspectorClient* inspectorClient;
    111             GeolocationClient* geolocationClient;
    112109            RefPtr<BackForwardList> backForwardClient;
    113110        };
     
    167164#if ENABLE(INSPECTOR)
    168165        InspectorController* inspectorController() const { return m_inspectorController.get(); }
    169 #endif
    170 #if ENABLE(GEOLOCATION)
    171         GeolocationController* geolocationController() const { return m_geolocationController.get(); }
    172166#endif
    173167#if ENABLE(POINTER_LOCK)
     
    363357        OwnPtr<InspectorController> m_inspectorController;
    364358#endif
    365 #if ENABLE(GEOLOCATION)
    366         OwnPtr<GeolocationController> m_geolocationController;
    367 #endif
    368359#if ENABLE(POINTER_LOCK)
    369360        OwnPtr<PointerLockController> m_pointerLockController;
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r112559 r112720  
    326326    , m_pluginMouseButtonPressed(false)
    327327    , m_pluginMayOpenNewTab(false)
    328     , m_geolocationClient(0)
    329328    , m_inRegionScrollStartingNode(0)
    330329#if USE(ACCELERATED_COMPOSITING)
     
    429428    pageClients.inspectorClient = inspectorClient;
    430429
    431     // Note the object will be destroyed when the page is destroyed.
     430    m_page = new Page(pageClients);
    432431#if ENABLE_DRT
    433     if (getenv("drtRun"))
    434         pageClients.geolocationClient = new GeolocationClientMock();
    435     else
    436 #endif
    437         pageClients.geolocationClient = m_geolocationClient = new GeolocationControllerClientBlackBerry(this);
     432    if (getenv("drtRun")) {
     433        // In case running in DumpRenderTree mode set the controller to mock provider.
     434        GeolocationClientMock* mock = new GeolocationClientMock();
     435        WebCore::provideGeolocationTo(m_page, mock);
     436        mock->setController(WebCore::GeolocationController::from(m_page));
     437    } else
    438438#else
    439     pageClients.geolocationClient = m_geolocationClient;
    440 
    441     m_page = new Page(pageClients);
     439        WebCore::provideGeolocationTo(m_page, new GeolocationControllerClientBlackBerry(this));
     440#endif
    442441    WebCore::provideDeviceOrientationTo(m_page, new DeviceOrientationClientBlackBerry(this));
    443442    WebCore::provideDeviceMotionTo(m_page, new DeviceMotionClientBlackBerry(this));
     
    445444#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    446445    WebCore::provideNotification(m_page, NotificationPresenterImpl::instance());
    447 #endif
    448 
    449 #if ENABLE_DRT
    450     // In case running in DumpRenderTree mode set the controller to mock provider.
    451     if (getenv("drtRun"))
    452         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(m_page->geolocationController());
    453446#endif
    454447
  • trunk/Source/WebKit/blackberry/ChangeLog

    r112658 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * Api/WebPage.cpp:
     13        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
     14        (BlackBerry::WebKit::WebPagePrivate::init):
     15        * WebCoreSupport/GeolocationControllerClientBlackBerry.cpp:
     16        (GeolocationControllerClientBlackBerry::onLocationUpdate):
     17        (GeolocationControllerClientBlackBerry::onLocationError):
     18        * WebKitSupport/DumpRenderTreeSupport.cpp:
     19        (DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests):
     20        (DumpRenderTreeSupport::resetGeolocationMock):
     21        (DumpRenderTreeSupport::setMockGeolocationError):
     22        (DumpRenderTreeSupport::setMockGeolocationPermission):
     23        (DumpRenderTreeSupport::setMockGeolocationPosition):
     24
    1252012-03-30  Keishi Hattori  <keishi@webkit.org>
    226
  • trunk/Source/WebKit/blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp

    r112559 r112720  
    8383    m_lastPosition = GeolocationPosition::create(timestamp, latitude, longitude, accuracy, altitudeValid, altitude, altitudeAccuracyValid,
    8484                                                 altitudeAccuracy, headingValid, heading, speedValid, speed);
    85     m_webPagePrivate->m_page->geolocationController()->positionChanged(m_lastPosition.get());
     85    GeolocationController::from(m_webPagePrivate->m_page)->positionChanged(m_lastPosition.get());
    8686}
    8787
     
    8989{
    9090    RefPtr<GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, String::fromUTF8(errorStr));
    91     m_webPagePrivate->m_page->geolocationController()->errorOccurred(error.get());
     91    GeolocationController::from(m_webPagePrivate->m_page)->errorOccurred(error.get());
    9292}
    9393
  • trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp

    r112559 r112720  
    9797int DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(WebPage* webPage)
    9898{
    99     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage(webPage)->geolocationController()->client());
     99    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController(corePage(webPage))->client());
    100100    return mockClient->numberOfPendingPermissionRequests();
    101101}
     
    103103void DumpRenderTreeSupport::resetGeolocationMock(WebPage* webPage)
    104104{
    105     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage(webPage)->geolocationController()->client());
     105    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client());
    106106    mockClient->reset();
    107107}
     
    119119    }
    120120
    121     GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(corePage(webPage)->geolocationController()->client());
     121    GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage(webPage))->client());
    122122    mockClient->setError(GeolocationError::create(code, message));
    123123}
     
    125125void DumpRenderTreeSupport::setMockGeolocationPermission(WebPage* webPage, bool allowed)
    126126{
    127     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage(webPage)->geolocationController()->client());
     127    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client());
    128128    mockClient->setPermission(allowed);
    129129}
     
    131131void DumpRenderTreeSupport::setMockGeolocationPosition(WebPage* webPage, double latitude, double longitude, double accuracy)
    132132{
    133     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage(webPage)->geolocationController()->client());
     133    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client());
    134134    mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy));
    135135}
  • trunk/Source/WebKit/chromium/ChangeLog

    r112708 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebViewImpl::WebViewImpl):
     14
    1152012-03-30  Ian Vollick  <vollick@chromium.org>
    216
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r112690 r112720  
    6464#include "FrameView.h"
    6565#include "GeolocationClientProxy.h"
     66#include "GeolocationController.h"
    6667#include "GraphicsContext.h"
    6768#include "GraphicsContext3D.h"
     
    388389    pageClients.dragClient = &m_dragClientImpl;
    389390    pageClients.inspectorClient = &m_inspectorClientImpl;
    390     pageClients.geolocationClient = m_geolocationClientProxy.get();
    391391    pageClients.backForwardClient = BackForwardListChromium::create(this);
    392392
     
    406406
    407407    provideDeviceOrientationTo(m_page.get(), m_deviceOrientationClientProxy.get());
    408     m_geolocationClientProxy->setController(m_page->geolocationController());
    409 
     408    provideGeolocationTo(m_page.get(), m_geolocationClientProxy.get());
     409    m_geolocationClientProxy->setController(GeolocationController::from(m_page.get()));
     410   
    410411    m_page->setGroupName(pageGroupName);
    411412
  • trunk/Source/WebKit/gtk/ChangeLog

    r112559 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     13        (DumpRenderTreeSupportGtk::resetGeolocationClientMock):
     14        (DumpRenderTreeSupportGtk::setMockGeolocationPermission):
     15        (DumpRenderTreeSupportGtk::setMockGeolocationPosition):
     16        (DumpRenderTreeSupportGtk::setMockGeolocationError):
     17        (DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests):
     18        * WebCoreSupport/GeolocationClientGtk.cpp:
     19        (WebKit::GeolocationClient::updatePosition):
     20        (WebKit::GeolocationClient::errorOccured):
     21        * webkit/webkitwebview.cpp:
     22        (webkit_web_view_init):
     23
    1242012-03-29  Sheriff Bot  <webkit.review.bot@gmail.com>
    225
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r112559 r112720  
    795795{
    796796#if ENABLE(GEOLOCATION)
    797     GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(core(webView)->geolocationController()->client());
     797    GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client());
    798798    mock->reset();
    799799#endif
     
    803803{
    804804#if ENABLE(GEOLOCATION)
    805     GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(core(webView)->geolocationController()->client());
     805    GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client());
    806806    mock->setPermission(allowed);
    807807#endif
     
    811811{
    812812#if ENABLE(GEOLOCATION)
    813     GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(core(webView)->geolocationController()->client());
     813    GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client());
    814814
    815815    double timestamp = g_get_real_time() / 1000000.0;
     
    821821{
    822822#if ENABLE(GEOLOCATION)
    823     GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(core(webView)->geolocationController()->client());
     823    GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client());
    824824
    825825    GeolocationError::ErrorCode code;
     
    841841{
    842842#if ENABLE(GEOLOCATION)
    843     GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(core(webView)->geolocationController()->client());
     843    GeolocationClientMock* mock = static_cast<GeolocationClientMock*>(GeolocationController::from(core(webView))->client());
    844844    return mock->numberOfPendingPermissionRequests();
    845845#endif
  • trunk/Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.cpp

    r112559 r112720  
    176176    m_lastPosition = WebCore::GeolocationPosition::create(static_cast<double>(m_timestamp), m_latitude, m_longitude, m_accuracy,
    177177                                                          true, m_altitude, true, m_altitudeAccuracy, false, 0, false, 0);
    178     core(m_webView)->geolocationController()->positionChanged(m_lastPosition.get());
     178    WebCore::GeolocationController::from(core(m_webView))->positionChanged(m_lastPosition.get());
    179179}
    180180
     
    182182{
    183183    RefPtr<WebCore::GeolocationError> error = WebCore::GeolocationError::create(WebCore::GeolocationError::PositionUnavailable, message);
    184     core(m_webView)->geolocationController()->errorOccurred(error.get());
     184    WebCore::GeolocationController::from(core(m_webView))->errorOccurred(error.get());
    185185}
    186186
  • trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp

    r112559 r112720  
    6060#include "FrameLoaderTypes.h"
    6161#include "FrameView.h"
     62#include "GOwnPtrGtk.h"
    6263#include "GeolocationClientGtk.h"
    6364#include "GeolocationClientMock.h"
    64 #include "GOwnPtrGtk.h"
     65#include "GeolocationController.h"
    6566#include "GraphicsContext.h"
    6667#include "GtkUtilities.h"
     
    35683569    pageClients.dragClient = new WebKit::DragClient(webView);
    35693570    pageClients.inspectorClient = new WebKit::InspectorClient(webView);
     3571
     3572    priv->corePage = new Page(pageClients);
     3573
    35703574#if ENABLE(GEOLOCATION)
    3571     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled())
    3572         pageClients.geolocationClient = new GeolocationClientMock;
    3573     else
    3574         pageClients.geolocationClient = new WebKit::GeolocationClient(webView);
     3575    if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
     3576        GeolocationClientMock* mock = new GeolocationClientMock;
     3577        WebCore::provideGeolocationTo(priv->corePage, mock);
     3578        mock->setController(GeolocationController::from(priv->corePage));
     3579    } else
     3580        WebCore::provideGeolocationTo(priv->corePage, new WebKit::GeolocationClient(webView));
    35753581#endif
    3576 
    3577     priv->corePage = new Page(pageClients);
    3578 
    35793582#if ENABLE(DEVICE_ORIENTATION)
    35803583    WebCore::provideDeviceMotionTo(priv->corePage, new DeviceMotionClientGtk);
     
    35873590
    35883591    if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
    3589 #if ENABLE(GEOLOCATION)
    3590         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController());
    3591 #endif
    35923592        // Set some testing-specific settings
    35933593        priv->corePage->settings()->setInteractiveFormValidationEnabled(true);
  • trunk/Source/WebKit/mac/ChangeLog

    r112658 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * WebView/WebView.mm:
     13        (-[WebView _commonInitializationWithFrameName:groupName:]):
     14        (-[WebView _geolocationDidChangePosition:]):
     15        (-[WebView _geolocationDidFailWithError:]):
     16
    1172012-03-30  Keishi Hattori  <keishi@webkit.org>
    218
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r112571 r112720  
    737737    pageClients.dragClient = new WebDragClient(self);
    738738    pageClients.inspectorClient = new WebInspectorClient(self);
     739    _private->page = new Page(pageClients);
    739740#if ENABLE(GEOLOCATION)
    740     pageClients.geolocationClient = new WebGeolocationClient(self);
    741 #endif
    742     _private->page = new Page(pageClients);
     741    WebCore::provideGeolocationTo(_private->page, new WebGeolocationClient(self));
     742#endif
    743743#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    744744    WebCore::provideNotification(_private->page, new WebNotificationClient(self));
     
    63896389#if ENABLE(GEOLOCATION)
    63906390    if (_private && _private->page)
    6391         _private->page->geolocationController()->positionChanged(core(position));
     6391        WebCore::GeolocationController::from(_private->page)->positionChanged(core(position));
    63926392#endif // ENABLE(GEOLOCATION)
    63936393}
     
    63986398    if (_private && _private->page) {
    63996399        RefPtr<GeolocationError> geolocatioError = GeolocationError::create(GeolocationError::PositionUnavailable, [error localizedDescription]);
    6400         _private->page->geolocationController()->errorOccurred(geolocatioError.get());
     6400        WebCore::GeolocationController::from(_private->page)->errorOccurred(geolocatioError.get());
    64016401    }
    64026402#endif // ENABLE(GEOLOCATION)
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r112559 r112720  
    6868#include "GeolocationClientMock.h"
    6969#include "GeolocationClientQt.h"
     70#include "GeolocationController.h"
    7071#endif
    7172#include "GeolocationPermissionClientQt.h"
     
    327328    pageClients.dragClient = new DragClientQt(q);
    328329    pageClients.inspectorClient = new InspectorClientQt(q);
     330    page = new Page(pageClients);
    329331#if ENABLE(GEOLOCATION)
    330     if (useMock)
    331         pageClients.geolocationClient = new GeolocationClientMock;
    332     else
    333         pageClients.geolocationClient = new GeolocationClientQt(q);
    334 #endif
    335     page = new Page(pageClients);
     332    if (useMock) {
     333        // In case running in DumpRenderTree mode set the controller to mock provider.
     334        GeolocationClientMock* mock = new GeolocationClientMock;
     335        WebCore::provideGeolocationTo(page, mock);
     336        mock->setController(WebCore::GeolocationController::from(page));
     337    } else
     338        WebCore::provideGeolocationTo(page, new GeolocationClientQt(q));
     339#endif
    336340#if ENABLE(DEVICE_ORIENTATION)
    337341    if (useMock)
     
    352356    page->setGroupName("Default Group");
    353357
    354     // In case running in DumpRenderTree mode set the controller to mock provider.
    355 #if ENABLE(GEOLOCATION)
    356     if (QWebPagePrivate::drtRun)
    357         static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(page->geolocationController());
    358 #endif
    359358    settings = new QWebSettings(page->settings());
    360359
  • trunk/Source/WebKit/qt/ChangeLog

    r112651 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * Api/qwebpage.cpp:
     13        (QWebPagePrivate::QWebPagePrivate):
     14        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     15        (DumpRenderTreeSupportQt::resetGeolocationMock):
     16        (DumpRenderTreeSupportQt::setMockGeolocationPermission):
     17        (DumpRenderTreeSupportQt::setMockGeolocationPosition):
     18        (DumpRenderTreeSupportQt::setMockGeolocationError):
     19        (DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests):
     20        * WebCoreSupport/GeolocationClientQt.cpp:
     21        (WebCore::GeolocationClientQt::positionUpdated):
     22        (WebCore::GeolocationClientQt::startUpdating):
     23
    1242012-03-29  Ádám Kallai  <kadam@inf.u-szeged.hu>
    225
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r112559 r112720  
    841841#if ENABLE(GEOLOCATION)
    842842    Page* corePage = QWebPagePrivate::core(page);
    843     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     843    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
    844844    mockClient->reset();
    845845#endif
     
    850850#if ENABLE(GEOLOCATION)
    851851    Page* corePage = QWebPagePrivate::core(page);
    852     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     852    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
    853853    mockClient->setPermission(allowed);
    854854#endif
     
    859859#if ENABLE(GEOLOCATION)
    860860    Page* corePage = QWebPagePrivate::core(page);
    861     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     861    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
    862862    mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy));
    863863#endif
     
    879879    }
    880880
    881     GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(corePage->geolocationController()->client());
     881    GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage)->client());
    882882    mockClient->setError(GeolocationError::create(code, message));
    883883#endif
     
    888888#if ENABLE(GEOLOCATION)
    889889    Page* corePage = QWebPagePrivate::core(page);
    890     GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client());
     890    GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage)->client());
    891891    return mockClient->numberOfPendingPermissionRequests();
    892892#else
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp

    r112559 r112720  
    9595
    9696    WebCore::Page* page = QWebPagePrivate::core(m_page);
    97     page->geolocationController()->positionChanged(m_lastPosition.get());
     97    GeolocationController::from(page)->positionChanged(m_lastPosition.get());
    9898}
    9999
     
    106106        WebCore::Page* page = QWebPagePrivate::core(m_page);
    107107        RefPtr<WebCore::GeolocationError> error = GeolocationError::create(GeolocationError::PositionUnavailable, failedToStartServiceErrorMessage);
    108         page->geolocationController()->errorOccurred(error.get());
     108        GeolocationController::from(page)->errorOccurred(error.get());
    109109        return;
    110110    }
  • trunk/Source/WebKit/win/ChangeLog

    r112559 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * WebView.cpp:
     13        (WebView::initWithFrame):
     14        (WebView::geolocationDidChangePosition):
     15        (WebView::geolocationDidFailWithError):
     16
    1172012-03-29  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebKit/win/WebView.cpp

    r112559 r112720  
    26672667    pageClients.dragClient = new WebDragClient(this);
    26682668    pageClients.inspectorClient = m_inspectorClient;
    2669     pageClients.geolocationClient = new WebGeolocationClient(this);
    26702669    m_page = new Page(pageClients);
     2670    provideGeolocationTo(m_page, new WebGeolocationClient(this));
    26712671
    26722672    BSTR localStoragePath;
     
    65676567    if (!m_page)
    65686568        return E_FAIL;
    6569     m_page->geolocationController()->positionChanged(core(position));
     6569    GeolocationController::from(m_page)->positionChanged(core(position));
    65706570    return S_OK;
    65716571}
     
    65856585
    65866586    RefPtr<GeolocationError> geolocationError = GeolocationError::create(GeolocationError::PositionUnavailable, descriptionString);
    6587     m_page->geolocationController()->errorOccurred(geolocationError.get());
     6587    GeolocationController::from(m_page)->errorOccurred(geolocationError.get());
    65886588    return S_OK;
    65896589}
  • trunk/Source/WebKit2/ChangeLog

    r112707 r112720  
     12012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        GEOLOCATION should be implemented as Page Supplement
     4        https://bugs.webkit.org/show_bug.cgi?id=82228
     5
     6        Reviewed by Adam Barth.
     7
     8        Geolocation is now a Supplement in Page so the interface
     9        has changed for setting up the page's geolocation client
     10        initially and accessing the controller later.
     11
     12        * WebProcess/Geolocation/WebGeolocationManager.cpp:
     13        (WebKit::WebGeolocationManager::didChangePosition):
     14        (WebKit::WebGeolocationManager::didFailToDeterminePosition):
     15        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     16        (WebKit::InjectedBundle::setGeoLocationPermission):
     17        * WebProcess/WebPage/WebPage.cpp:
     18        (WebKit::WebPage::WebPage):
     19
    1202012-03-30  Anders Carlsson  <andersca@apple.com>
    221
  • trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp

    r112559 r112720  
    8282        WebPage* page = *it;
    8383        if (page->corePage())
    84             page->corePage()->geolocationController()->positionChanged(position.get());
     84            GeolocationController::from(page->corePage())->positionChanged(position.get());
    8585    }
    8686#endif // ENABLE(GEOLOCATION)
     
    9898        WebPage* page = *it;
    9999        if (page->corePage())
    100             page->corePage()->geolocationController()->errorOccurred(error.get());
     100            GeolocationController::from(page->corePage())->errorOccurred(error.get());
    101101    }
    102102#endif // ENABLE(GEOLOCATION)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r112559 r112720  
    199199    const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
    200200    for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
    201         static_cast<GeolocationClientMock*>((*iter)->geolocationController()->client())->setPermission(enabled);
     201        static_cast<GeolocationClientMock*>(GeolocationController::from(*iter)->client())->setPermission(enabled);
    202202#endif // ENABLE(GEOLOCATION)
    203203}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r112707 r112720  
    232232    pageClients.dragClient = new WebDragClient(this);
    233233    pageClients.backForwardClient = WebBackForwardListProxy::create(this);
    234 #if ENABLE(GEOLOCATION)
    235     pageClients.geolocationClient = new WebGeolocationClient(this);
    236 #endif
    237234#if ENABLE(INSPECTOR)
    238235    pageClients.inspectorClient = new WebInspectorClient(this);
     
    241238    m_page = adoptPtr(new Page(pageClients));
    242239
     240#if ENABLE(GEOLOCATION)
     241    WebCore::provideGeolocationTo(m_page.get(), new WebGeolocationClient(this));
     242#endif
    243243#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    244244    WebCore::provideNotification(m_page.get(), new WebNotificationClient(this));
Note: See TracChangeset for help on using the changeset viewer.