[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 15:59:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 3389c058d1f1022d8df07a3e32c815aea70411bc
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Nov 17 17:28:34 2010 +0000
2010-11-17 John Knottenbelt <jknotten at chromium.org>
Reviewed by Jeremy Orlow.
Introduce GeoNotifierVector typedef for increased readability
https://bugs.webkit.org/show_bug.cgi?id=49597
* page/Geolocation.cpp:
(WebCore::Geolocation::Watchers::getNotifiersVector):
(WebCore::Geolocation::sendError):
(WebCore::Geolocation::sendPosition):
(WebCore::Geolocation::stopTimer):
(WebCore::Geolocation::stopTimersForOneShots):
(WebCore::Geolocation::stopTimersForWatchers):
(WebCore::Geolocation::cancelRequests):
(WebCore::Geolocation::cancelAllRequests):
(WebCore::Geolocation::handleError):
(WebCore::Geolocation::makeSuccessCallbacks):
* page/Geolocation.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a6c0b3..4cb79e1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,26 @@
Reviewed by Jeremy Orlow.
+ Introduce GeoNotifierVector typedef for increased readability
+ https://bugs.webkit.org/show_bug.cgi?id=49597
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::Watchers::getNotifiersVector):
+ (WebCore::Geolocation::sendError):
+ (WebCore::Geolocation::sendPosition):
+ (WebCore::Geolocation::stopTimer):
+ (WebCore::Geolocation::stopTimersForOneShots):
+ (WebCore::Geolocation::stopTimersForWatchers):
+ (WebCore::Geolocation::cancelRequests):
+ (WebCore::Geolocation::cancelAllRequests):
+ (WebCore::Geolocation::handleError):
+ (WebCore::Geolocation::makeSuccessCallbacks):
+ * page/Geolocation.h:
+
+2010-11-17 John Knottenbelt <jknotten at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
Convert correctly between GeolocationPosition and Geoposition
timestamp formats.
https://bugs.webkit.org/show_bug.cgi?id=48518
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 2a2b522..7686ca9 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -208,7 +208,7 @@ bool Geolocation::Watchers::isEmpty() const
return m_idToNotifierMap.isEmpty();
}
-void Geolocation::Watchers::getNotifiersVector(Vector<RefPtr<GeoNotifier> >& copy) const
+void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const
{
copyValuesToVector(m_idToNotifierMap, copy);
}
@@ -453,10 +453,10 @@ void Geolocation::setIsAllowed(bool allowed)
makeCachedPositionCallbacks();
}
-void Geolocation::sendError(Vector<RefPtr<GeoNotifier> >& notifiers, PositionError* error)
+void Geolocation::sendError(GeoNotifierVector& notifiers, PositionError* error)
{
- Vector<RefPtr<GeoNotifier> >::const_iterator end = notifiers.end();
- for (Vector<RefPtr<GeoNotifier> >::const_iterator it = notifiers.begin(); it != end; ++it) {
+ GeoNotifierVector::const_iterator end = notifiers.end();
+ for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
RefPtr<GeoNotifier> notifier = *it;
if (notifier->m_errorCallback)
@@ -464,10 +464,10 @@ void Geolocation::sendError(Vector<RefPtr<GeoNotifier> >& notifiers, PositionErr
}
}
-void Geolocation::sendPosition(Vector<RefPtr<GeoNotifier> >& notifiers, Geoposition* position)
+void Geolocation::sendPosition(GeoNotifierVector& notifiers, Geoposition* position)
{
- Vector<RefPtr<GeoNotifier> >::const_iterator end = notifiers.end();
- for (Vector<RefPtr<GeoNotifier> >::const_iterator it = notifiers.begin(); it != end; ++it) {
+ GeoNotifierVector::const_iterator end = notifiers.end();
+ for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
RefPtr<GeoNotifier> notifier = *it;
ASSERT(notifier->m_successCallback);
@@ -475,10 +475,10 @@ void Geolocation::sendPosition(Vector<RefPtr<GeoNotifier> >& notifiers, Geoposit
}
}
-void Geolocation::stopTimer(Vector<RefPtr<GeoNotifier> >& notifiers)
+void Geolocation::stopTimer(GeoNotifierVector& notifiers)
{
- Vector<RefPtr<GeoNotifier> >::const_iterator end = notifiers.end();
- for (Vector<RefPtr<GeoNotifier> >::const_iterator it = notifiers.begin(); it != end; ++it) {
+ GeoNotifierVector::const_iterator end = notifiers.end();
+ for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
RefPtr<GeoNotifier> notifier = *it;
notifier->m_timer.stop();
}
@@ -486,7 +486,7 @@ void Geolocation::stopTimer(Vector<RefPtr<GeoNotifier> >& notifiers)
void Geolocation::stopTimersForOneShots()
{
- Vector<RefPtr<GeoNotifier> > copy;
+ GeoNotifierVector copy;
copyToVector(m_oneShots, copy);
stopTimer(copy);
@@ -494,7 +494,7 @@ void Geolocation::stopTimersForOneShots()
void Geolocation::stopTimersForWatchers()
{
- Vector<RefPtr<GeoNotifier> > copy;
+ GeoNotifierVector copy;
m_watchers.getNotifiersVector(copy);
stopTimer(copy);
@@ -506,16 +506,16 @@ void Geolocation::stopTimers()
stopTimersForWatchers();
}
-void Geolocation::cancelRequests(Vector<RefPtr<GeoNotifier> >& notifiers)
+void Geolocation::cancelRequests(GeoNotifierVector& notifiers)
{
- Vector<RefPtr<GeoNotifier> >::const_iterator end = notifiers.end();
- for (Vector<RefPtr<GeoNotifier> >::const_iterator it = notifiers.begin(); it != end; ++it)
+ GeoNotifierVector::const_iterator end = notifiers.end();
+ for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
(*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, framelessDocumentErrorMessage));
}
void Geolocation::cancelAllRequests()
{
- Vector<RefPtr<GeoNotifier> > copy;
+ GeoNotifierVector copy;
copyToVector(m_oneShots, copy);
cancelRequests(copy);
m_watchers.getNotifiersVector(copy);
@@ -526,10 +526,10 @@ void Geolocation::handleError(PositionError* error)
{
ASSERT(error);
- Vector<RefPtr<GeoNotifier> > oneShotsCopy;
+ GeoNotifierVector oneShotsCopy;
copyToVector(m_oneShots, oneShotsCopy);
- Vector<RefPtr<GeoNotifier> > watchersCopy;
+ GeoNotifierVector watchersCopy;
m_watchers.getNotifiersVector(watchersCopy);
// Clear the lists before we make the callbacks, to avoid clearing notifiers
@@ -588,10 +588,10 @@ void Geolocation::makeSuccessCallbacks()
ASSERT(lastPosition());
ASSERT(isAllowed());
- Vector<RefPtr<GeoNotifier> > oneShotsCopy;
+ GeoNotifierVector oneShotsCopy;
copyToVector(m_oneShots, oneShotsCopy);
- Vector<RefPtr<GeoNotifier> > watchersCopy;
+ GeoNotifierVector watchersCopy;
m_watchers.getNotifiersVector(watchersCopy);
// Clear the lists before we make the callbacks, to avoid clearing notifiers
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index 2b60922..a3a79f9 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -109,6 +109,9 @@ private:
GeoNotifier(Geolocation*, PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
};
+ typedef Vector<RefPtr<GeoNotifier> > GeoNotifierVector;
+ typedef HashSet<RefPtr<GeoNotifier> > GeoNotifierSet;
+
class Watchers {
public:
void set(int id, PassRefPtr<GeoNotifier>);
@@ -117,7 +120,7 @@ private:
bool contains(GeoNotifier*) const;
void clear();
bool isEmpty() const;
- void getNotifiersVector(Vector<RefPtr<GeoNotifier> >&) const;
+ void getNotifiersVector(GeoNotifierVector&) const;
private:
typedef HashMap<int, RefPtr<GeoNotifier> > IdToNotifierMap;
typedef HashMap<RefPtr<GeoNotifier>, int> NotifierToIdMap;
@@ -127,15 +130,15 @@ private:
bool hasListeners() const { return !m_oneShots.isEmpty() || !m_watchers.isEmpty(); }
- void sendError(Vector<RefPtr<GeoNotifier> >&, PositionError*);
- void sendPosition(Vector<RefPtr<GeoNotifier> >&, Geoposition*);
+ void sendError(GeoNotifierVector&, PositionError*);
+ void sendPosition(GeoNotifierVector&, Geoposition*);
- static void stopTimer(Vector<RefPtr<GeoNotifier> >&);
+ static void stopTimer(GeoNotifierVector&);
void stopTimersForOneShots();
void stopTimersForWatchers();
void stopTimers();
- void cancelRequests(Vector<RefPtr<GeoNotifier> >&);
+ void cancelRequests(GeoNotifierVector&);
void cancelAllRequests();
void positionChangedInternal();
@@ -165,8 +168,6 @@ private:
bool haveSuitableCachedPosition(PositionOptions*);
void makeCachedPositionCallbacks();
- typedef HashSet<RefPtr<GeoNotifier> > GeoNotifierSet;
-
GeoNotifierSet m_oneShots;
Watchers m_watchers;
Frame* m_frame;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list