Index: Source/modules/geolocation/GeolocationWatchers.h |
diff --git a/Source/modules/geolocation/GeolocationWatchers.h b/Source/modules/geolocation/GeolocationWatchers.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20ca5492669fc15020c234d5b060a7a353412023 |
--- /dev/null |
+++ b/Source/modules/geolocation/GeolocationWatchers.h |
@@ -0,0 +1,41 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef GeolocationWatchers_h |
+#define GeolocationWatchers_h |
+ |
+#include "platform/heap/Handle.h" |
+ |
+namespace WebCore { |
+ |
+class GeoNotifier; |
+ |
+class GeolocationWatchers { |
+ DISALLOW_ALLOCATION(); |
+ |
+public: |
+ GeolocationWatchers() { } |
+ void trace(Visitor*); |
+ |
+ bool add(int id, GeoNotifier*); |
+ GeoNotifier* find(int id); |
+ void remove(int id); |
+ void remove(GeoNotifier*); |
+ bool contains(GeoNotifier*) const; |
+ void clear(); |
+ bool isEmpty() const; |
+ |
+ void getNotifiersVector(HeapVector<Member<GeoNotifier> >&) const; |
+ |
+private: |
+ typedef HeapHashMap<int, Member<GeoNotifier> > IdToNotifierMap; |
+ typedef HeapHashMap<Member<GeoNotifier>, int> NotifierToIdMap; |
+ |
+ IdToNotifierMap m_idToNotifierMap; |
+ NotifierToIdMap m_notifierToIdMap; |
+}; |
+ |
+} // namespace WebCore |
+ |
+#endif // GeolocationWatchers_h |