| 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 #include "modules/geolocation/GeolocationWatchers.h" | 5 #include "modules/geolocation/GeolocationWatchers.h" |
| 6 | 6 |
| 7 #include "modules/geolocation/GeoNotifier.h" | 7 #include "modules/geolocation/GeoNotifier.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 m_notifierToIdMap.set(notifier, id); | 22 m_notifierToIdMap.set(notifier, id); |
| 23 return true; | 23 return true; |
| 24 } | 24 } |
| 25 | 25 |
| 26 GeoNotifier* GeolocationWatchers::find(int id) | 26 GeoNotifier* GeolocationWatchers::find(int id) |
| 27 { | 27 { |
| 28 ASSERT(id > 0); | 28 ASSERT(id > 0); |
| 29 IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id); | 29 IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id); |
| 30 if (iter == m_idToNotifierMap.end()) | 30 if (iter == m_idToNotifierMap.end()) |
| 31 return 0; | 31 return 0; |
| 32 return iter->value.get(); | 32 return iter->value; |
| 33 } | 33 } |
| 34 | 34 |
| 35 void GeolocationWatchers::remove(int id) | 35 void GeolocationWatchers::remove(int id) |
| 36 { | 36 { |
| 37 ASSERT(id > 0); | 37 ASSERT(id > 0); |
| 38 IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id); | 38 IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id); |
| 39 if (iter == m_idToNotifierMap.end()) | 39 if (iter == m_idToNotifierMap.end()) |
| 40 return; | 40 return; |
| 41 m_notifierToIdMap.remove(iter->value); | 41 m_notifierToIdMap.remove(iter->value); |
| 42 m_idToNotifierMap.remove(iter); | 42 m_idToNotifierMap.remove(iter); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 66 { | 66 { |
| 67 return m_idToNotifierMap.isEmpty(); | 67 return m_idToNotifierMap.isEmpty(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void GeolocationWatchers::getNotifiersVector(HeapVector<Member<GeoNotifier>>& co
py) const | 70 void GeolocationWatchers::getNotifiersVector(HeapVector<Member<GeoNotifier>>& co
py) const |
| 71 { | 71 { |
| 72 copyValuesToVector(m_idToNotifierMap, copy); | 72 copyValuesToVector(m_idToNotifierMap, copy); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |