Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1584)

Unified Diff: Source/modules/geolocation/Geolocation.cpp

Issue 402563002: Separate GeolocationWatchers from Geolocation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/geolocation/Geolocation.cpp
diff --git a/Source/modules/geolocation/Geolocation.cpp b/Source/modules/geolocation/Geolocation.cpp
index a386ae6f1b0ccffb76767f09f5d44caf530c5f1d..3b1dd3ce9ff6b2a2d1b91d9069b7de37bc486b5a 100644
--- a/Source/modules/geolocation/Geolocation.cpp
+++ b/Source/modules/geolocation/Geolocation.cpp
@@ -36,6 +36,7 @@
#include "modules/geolocation/GeolocationController.h"
#include "modules/geolocation/GeolocationError.h"
#include "modules/geolocation/GeolocationPosition.h"
+#include "modules/geolocation/GeolocationWatchers.h"
kihong 2014/07/18 15:36:58 This is duplicated include. I will remove this bef
#include "wtf/CurrentTime.h"
namespace WebCore {
@@ -79,70 +80,6 @@ static PositionError* createPositionError(GeolocationError* error)
return PositionError::create(code, error->message());
}
-void Geolocation::Watchers::trace(Visitor* visitor)
-{
- visitor->trace(m_idToNotifierMap);
- visitor->trace(m_notifierToIdMap);
-}
-
-bool Geolocation::Watchers::add(int id, GeoNotifier* notifier)
-{
- ASSERT(id > 0);
- if (!m_idToNotifierMap.add(id, notifier).isNewEntry)
- return false;
- m_notifierToIdMap.set(notifier, id);
- return true;
-}
-
-GeoNotifier* Geolocation::Watchers::find(int id)
-{
- ASSERT(id > 0);
- IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
- if (iter == m_idToNotifierMap.end())
- return 0;
- return iter->value.get();
-}
-
-void Geolocation::Watchers::remove(int id)
-{
- ASSERT(id > 0);
- IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
- if (iter == m_idToNotifierMap.end())
- return;
- m_notifierToIdMap.remove(iter->value);
- m_idToNotifierMap.remove(iter);
-}
-
-void Geolocation::Watchers::remove(GeoNotifier* notifier)
-{
- NotifierToIdMap::iterator iter = m_notifierToIdMap.find(notifier);
- if (iter == m_notifierToIdMap.end())
- return;
- m_idToNotifierMap.remove(iter->value);
- m_notifierToIdMap.remove(iter);
-}
-
-bool Geolocation::Watchers::contains(GeoNotifier* notifier) const
-{
- return m_notifierToIdMap.contains(notifier);
-}
-
-void Geolocation::Watchers::clear()
-{
- m_idToNotifierMap.clear();
- m_notifierToIdMap.clear();
-}
-
-bool Geolocation::Watchers::isEmpty() const
-{
- return m_idToNotifierMap.isEmpty();
-}
-
-void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const
-{
- copyValuesToVector(m_idToNotifierMap, copy);
-}
-
Geolocation* Geolocation::create(ExecutionContext* context)
{
Geolocation* geolocation = new Geolocation(context);

Powered by Google App Engine
This is Rietveld 408576698