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

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

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.h
diff --git a/Source/modules/geolocation/Geolocation.h b/Source/modules/geolocation/Geolocation.h
index caa59adbbcc89f07a7f81df7de4ad54aa8c82876..f7b79bb7e52c1f76fce33adb4fd606129ccf396f 100644
--- a/Source/modules/geolocation/Geolocation.h
+++ b/Source/modules/geolocation/Geolocation.h
@@ -31,6 +31,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ActiveDOMObject.h"
#include "modules/geolocation/GeoNotifier.h"
+#include "modules/geolocation/GeolocationWatchers.h"
Michael van Ouwerkerk 2014/07/18 12:07:39 I think you can forward declare GeolocationWatcher
kihong 2014/07/18 14:28:25 You are right, I made a mistake. I will change it
kihong 2014/07/18 15:36:06 I have got misunderstanding, I think you've got it
#include "modules/geolocation/Geoposition.h"
#include "modules/geolocation/PositionCallback.h"
#include "modules/geolocation/PositionError.h"
@@ -111,25 +112,6 @@ private:
typedef HeapVector<Member<GeoNotifier> > GeoNotifierVector;
typedef HeapHashSet<Member<GeoNotifier> > GeoNotifierSet;
- class Watchers {
- DISALLOW_ALLOCATION();
- public:
- 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(GeoNotifierVector&) const;
- private:
- typedef HeapHashMap<int, Member<GeoNotifier> > IdToNotifierMap;
- typedef HeapHashMap<Member<GeoNotifier>, int> NotifierToIdMap;
- IdToNotifierMap m_idToNotifierMap;
- NotifierToIdMap m_notifierToIdMap;
- };
-
bool hasListeners() const { return !m_oneShots.isEmpty() || !m_watchers.isEmpty(); }
void sendError(GeoNotifierVector&, PositionError*);
@@ -188,7 +170,7 @@ private:
void makeCachedPositionCallbacks();
GeoNotifierSet m_oneShots;
- Watchers m_watchers;
+ GeolocationWatchers m_watchers;
GeoNotifierSet m_pendingForPermissionNotifiers;
Member<Geoposition> m_lastPosition;

Powered by Google App Engine
This is Rietveld 408576698