From 5277f3a59aa76c1a40995a47261b9710c284f877 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 2 Feb 2010 18:21:08 +0000 Subject: [PATCH] Merge webkit.org at r54127 : Resolve Geolocation conflicts. Keep ours for maximumAge code. Take theirs for client-based Geolocation code. Change-Id: I72baa0026b1cd1bec617843a992dfb6008ca774d --- WebCore/page/Geolocation.cpp | 41 ------------------------------ WebCore/page/Geolocation.h | 8 ------ WebCore/page/GeolocationController.cpp | 26 ------------------- WebCore/page/GeolocationControllerClient.h | 3 --- WebCore/page/GeolocationError.h | 7 ----- WebCore/page/GeolocationPosition.h | 3 --- WebKit/mac/WebView/WebView.mm | 4 --- WebKit/win/WebView.cpp | 4 --- 8 files changed, 96 deletions(-) diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 0843e8126..e55d2b127 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -142,7 +142,6 @@ void Geolocation::GeoNotifier::timerFired(Timer*) m_errorCallback->handleEvent(m_fatalError.get()); // This will cause this notifier to be deleted. m_geolocation->fatalErrorOccurred(this); -<<<<<<< HEAD return; } @@ -151,8 +150,6 @@ void Geolocation::GeoNotifier::timerFired(Timer*) // will continue to run. m_useCachedPosition = false; m_geolocation->requestUsesCachedPosition(this); -======= ->>>>>>> webkit.org at r54127 return; } @@ -211,12 +208,8 @@ void Geolocation::Watchers::getNotifiersVector(Vector >& cop } Geolocation::Geolocation(Frame* frame) -<<<<<<< HEAD : EventListener(GeolocationEventListenerType) , m_frame(frame) -======= - : m_frame(frame) ->>>>>>> webkit.org at r54127 #if !ENABLE(CLIENT_BASED_GEOLOCATION) , m_service(GeolocationService::create(this)) #endif @@ -239,10 +232,6 @@ Geolocation::~Geolocation() m_frame->domWindow()->removeEventListener(eventNames().unloadEvent, this, false); } -Geolocation::~Geolocation() -{ -} - void Geolocation::disconnectFrame() { stopUpdating(); @@ -299,7 +288,6 @@ PassRefPtr Geolocation::startRequest(PassRefPtrsetFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage)); else { -<<<<<<< HEAD if (haveSuitableCachedPosition(notifier->m_options.get())) notifier->setUseCachedPosition(); else { @@ -312,16 +300,6 @@ PassRefPtr Geolocation::startRequest(PassRefPtrsetFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "Failed to start Geolocation service")); } -======= - if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) { -#if ENABLE(CLIENT_BASED_GEOLOCATION) - // Only start timer if we're not waiting for user permission. - if (!m_startRequestPermissionNotifier) -#endif - notifier->startTimerIfNeeded(); - } else - notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "Failed to start Geolocation service")); ->>>>>>> webkit.org at r54127 } return notifier.release(); @@ -344,7 +322,6 @@ void Geolocation::requestTimedOut(GeoNotifier* notifier) if (!hasListeners()) stopUpdating(); -<<<<<<< HEAD } void Geolocation::requestUsesCachedPosition(GeoNotifier* notifier) @@ -406,8 +383,6 @@ bool Geolocation::haveSuitableCachedPosition(PositionOptions* options) return false; DOMTimeStamp currentTimeMillis = currentTime() * 1000.0; return m_positionCache->cachedPosition()->timestamp() > currentTimeMillis - options->maximumAge(); -======= ->>>>>>> webkit.org at r54127 } void Geolocation::clearWatch(int watchId) @@ -460,15 +435,8 @@ void Geolocation::setIsAllowed(bool allowed) return; } #endif -<<<<<<< HEAD if (!isAllowed()) { -======= - - if (isAllowed()) - makeSuccessCallbacks(); - else { ->>>>>>> webkit.org at r54127 RefPtr error = PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage); error->setIsFatal(true); handleError(error.get()); @@ -583,11 +551,8 @@ void Geolocation::requestPermission() void Geolocation::positionChanged(PassRefPtr newPosition) { m_currentPosition = newPosition; -<<<<<<< HEAD m_positionCache->setCachedPosition(m_currentPosition.get()); -======= ->>>>>>> webkit.org at r54127 // Stop all currently running timers. stopTimers(); @@ -654,12 +619,9 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service) { ASSERT(service->lastError()); -<<<<<<< HEAD // Note that we do not stop timers here. For one-shots, the request is // cleared in handleError. For watchers, the spec requires that the timer is // not cleared. -======= ->>>>>>> webkit.org at r54127 handleError(service->lastError()); } @@ -707,7 +669,6 @@ void Geolocation::stopUpdating() } -<<<<<<< HEAD bool Geolocation::operator==(const EventListener& listener) { if (listener.type() != GeolocationEventListenerType) @@ -726,6 +687,4 @@ void Geolocation::handleEvent(ScriptExecutionContext*, Event* event) m_watchers.clear(); } -======= ->>>>>>> webkit.org at r54127 } // namespace WebCore diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index fc6365e3a..ade4ffefb 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -54,11 +54,7 @@ class GeolocationPosition; class GeolocationError; #endif -<<<<<<< HEAD class Geolocation : public EventListener -======= -class Geolocation : public RefCounted ->>>>>>> webkit.org at r54127 #if !ENABLE(CLIENT_BASED_GEOLOCATION) , public GeolocationServiceClient #endif @@ -87,11 +83,7 @@ public: bool shouldClearCache() const { return m_shouldClearCache; } #if ENABLE(CLIENT_BASED_GEOLOCATION) -<<<<<<< HEAD - void setPostion(GeolocationPosition*); -======= void setPosition(GeolocationPosition*); ->>>>>>> webkit.org at r54127 void setError(GeolocationError*); #endif diff --git a/WebCore/page/GeolocationController.cpp b/WebCore/page/GeolocationController.cpp index bb082e50f..fd18b4502 100644 --- a/WebCore/page/GeolocationController.cpp +++ b/WebCore/page/GeolocationController.cpp @@ -40,11 +40,8 @@ GeolocationController::GeolocationController(Page* page, GeolocationControllerCl GeolocationController::~GeolocationController() { -<<<<<<< HEAD -======= if (m_client) m_client->geolocationDestroyed(); ->>>>>>> webkit.org at r54127 } void GeolocationController::addObserver(Geolocation* observer) @@ -53,11 +50,7 @@ void GeolocationController::addObserver(Geolocation* observer) bool wasEmpty = m_observers.isEmpty(); m_observers.add(observer); -<<<<<<< HEAD - if (wasEmpty) -======= if (wasEmpty && m_client) ->>>>>>> webkit.org at r54127 m_client->startUpdating(); } @@ -67,50 +60,31 @@ void GeolocationController::removeObserver(Geolocation* observer) return; m_observers.remove(observer); -<<<<<<< HEAD - if (m_observers.isEmpty()) -======= if (m_observers.isEmpty() && m_client) ->>>>>>> webkit.org at r54127 m_client->stopUpdating(); } void GeolocationController::positionChanged(GeolocationPosition* position) { -<<<<<<< HEAD - HashSet >::const_iterator end = m_observers.end(); - for (HashSet >::const_iterator it = m_observers.begin(); it != end; ++it) - (*it)->setPosition(position); -======= Vector > observersVector; copyToVector(m_observers, observersVector); for (size_t i = 0; i < observersVector.size(); ++i) observersVector[i]->setPosition(position); ->>>>>>> webkit.org at r54127 } void GeolocationController::errorOccurred(GeolocationError* error) { -<<<<<<< HEAD - HashSet >::const_iterator end = m_observers.end(); - for (HashSet >::const_iterator it = m_observers.begin(); it != end; ++it) - (*it)->setError(error); -======= Vector > observersVector; copyToVector(m_observers, observersVector); for (size_t i = 0; i < observersVector.size(); ++i) observersVector[i]->setError(error); ->>>>>>> webkit.org at r54127 } GeolocationPosition* GeolocationController::lastPosition() { -<<<<<<< HEAD -======= if (!m_client) return 0; ->>>>>>> webkit.org at r54127 return m_client->lastPosition(); } diff --git a/WebCore/page/GeolocationControllerClient.h b/WebCore/page/GeolocationControllerClient.h index 01b1a2744..cc0e1e4ac 100644 --- a/WebCore/page/GeolocationControllerClient.h +++ b/WebCore/page/GeolocationControllerClient.h @@ -32,11 +32,8 @@ class GeolocationPosition; class GeolocationControllerClient { public: -<<<<<<< HEAD -======= virtual void geolocationDestroyed() = 0; ->>>>>>> webkit.org at r54127 virtual void startUpdating() = 0; virtual void stopUpdating() = 0; virtual GeolocationPosition* lastPosition() = 0; diff --git a/WebCore/page/GeolocationError.h b/WebCore/page/GeolocationError.h index 5c3df150d..2a3bad4a9 100644 --- a/WebCore/page/GeolocationError.h +++ b/WebCore/page/GeolocationError.h @@ -30,10 +30,7 @@ #include "PlatformString.h" #include -<<<<<<< HEAD -======= #include ->>>>>>> webkit.org at r54127 #include namespace WebCore { @@ -51,15 +48,11 @@ public: const String& message() const { return m_message; } private: -<<<<<<< HEAD - GeolocationError(ErrorCode code, const String& message); -======= GeolocationError(ErrorCode code, const String& message) : m_code(code) , m_message(message) { } ->>>>>>> webkit.org at r54127 ErrorCode m_code; String m_message; diff --git a/WebCore/page/GeolocationPosition.h b/WebCore/page/GeolocationPosition.h index 91bd37943..9f25b1147 100644 --- a/WebCore/page/GeolocationPosition.h +++ b/WebCore/page/GeolocationPosition.h @@ -29,10 +29,7 @@ #if ENABLE(CLIENT_BASED_GEOLOCATION) #include -<<<<<<< HEAD -======= #include ->>>>>>> webkit.org at r54127 #include namespace WebCore { diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 6dcbfb44c..e583bb5ee 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -623,16 +623,12 @@ static bool shouldEnableLoadDeferring() didOneTimeInitialization = true; } -<<<<<<< HEAD - _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), new WebPluginHalterClient(self), 0); -======= #if ENABLE(CLIENT_BASED_GEOLOCATION) WebGeolocationControllerClient* geolocationControllerClient = new WebGeolocationControllerClient(self); #else WebGeolocationControllerClient* geolocationControllerClient = 0; #endif _private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self), new WebPluginHalterClient(self), geolocationControllerClient); ->>>>>>> webkit.org at r54127 _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index b4b47cdb3..4d67110a3 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -2434,11 +2434,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( if (SUCCEEDED(m_preferences->shouldUseHighResolutionTimers(&useHighResolutionTimer))) Settings::setShouldUseHighResolutionTimers(useHighResolutionTimer); -<<<<<<< HEAD - m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), new WebPluginHalterClient(this), 0); -======= m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this), new WebPluginHalterClient(this), geolocationControllerClient); ->>>>>>> webkit.org at r54127 BSTR localStoragePath; if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) { -- 2.11.0