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

Unified Diff: Source/modules/geolocation/GeolocationWatchers.h

Issue 402563002: Separate GeolocationWatchers from Geolocation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing 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
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | Source/modules/geolocation/GeolocationWatchers.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | Source/modules/geolocation/GeolocationWatchers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698