| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GeolocationWatchers_h | 5 #ifndef GeolocationWatchers_h |
| 6 #define GeolocationWatchers_h | 6 #define GeolocationWatchers_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class GeoNotifier; | 12 class GeoNotifier; |
| 13 | 13 |
| 14 class GeolocationWatchers { | 14 class GeolocationWatchers { |
| 15 DISALLOW_ALLOCATION(); | 15 DISALLOW_ALLOCATION(); |
| 16 | 16 |
| 17 public: | 17 public: |
| 18 GeolocationWatchers() { } | 18 GeolocationWatchers() { } |
| 19 void trace(Visitor*); | 19 void trace(Visitor*); |
| 20 | 20 |
| 21 bool add(int id, GeoNotifier*); | 21 bool add(int id, GeoNotifier*); |
| 22 GeoNotifier* find(int id); | 22 GeoNotifier* find(int id); |
| 23 void remove(int id); | 23 void remove(int id); |
| 24 void remove(GeoNotifier*); | 24 void remove(GeoNotifier*); |
| 25 bool contains(GeoNotifier*) const; | 25 bool contains(GeoNotifier*) const; |
| 26 void clear(); | 26 void clear(); |
| 27 bool isEmpty() const; | 27 bool isEmpty() const; |
| 28 | 28 |
| 29 void getNotifiersVector(HeapVector<Member<GeoNotifier> >&) const; | 29 void getNotifiersVector(HeapVector<Member<GeoNotifier>>&) const; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 typedef HeapHashMap<int, Member<GeoNotifier> > IdToNotifierMap; | 32 typedef HeapHashMap<int, Member<GeoNotifier>> IdToNotifierMap; |
| 33 typedef HeapHashMap<Member<GeoNotifier>, int> NotifierToIdMap; | 33 typedef HeapHashMap<Member<GeoNotifier>, int> NotifierToIdMap; |
| 34 | 34 |
| 35 IdToNotifierMap m_idToNotifierMap; | 35 IdToNotifierMap m_idToNotifierMap; |
| 36 NotifierToIdMap m_notifierToIdMap; | 36 NotifierToIdMap m_notifierToIdMap; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 } // namespace blink | 39 } // namespace blink |
| 40 | 40 |
| 41 #endif // GeolocationWatchers_h | 41 #endif // GeolocationWatchers_h |
| OLD | NEW |