OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 | 148 |
149 void GeolocationController::positionChanged(GeolocationPosition* position) | 149 void GeolocationController::positionChanged(GeolocationPosition* position) |
150 { | 150 { |
151 position = m_inspectorAgent->overrideGeolocationPosition(position); | 151 position = m_inspectorAgent->overrideGeolocationPosition(position); |
152 if (!position) { | 152 if (!position) { |
153 errorOccurred(GeolocationError::create(GeolocationError::PositionUnavail
able, "PositionUnavailable").get()); | 153 errorOccurred(GeolocationError::create(GeolocationError::PositionUnavail
able, "PositionUnavailable").get()); |
154 return; | 154 return; |
155 } | 155 } |
156 m_lastPosition = position; | 156 m_lastPosition = position; |
157 WillBePersistentHeapVector<RefPtrWillBeMember<Geolocation> > observersVector
; | 157 WillBeHeapVector<RefPtrWillBeMember<Geolocation> > observersVector; |
158 copyToVector(m_observers, observersVector); | 158 copyToVector(m_observers, observersVector); |
159 for (size_t i = 0; i < observersVector.size(); ++i) | 159 for (size_t i = 0; i < observersVector.size(); ++i) |
160 observersVector[i]->positionChanged(); | 160 observersVector[i]->positionChanged(); |
161 } | 161 } |
162 | 162 |
163 void GeolocationController::errorOccurred(GeolocationError* error) | 163 void GeolocationController::errorOccurred(GeolocationError* error) |
164 { | 164 { |
165 WillBePersistentHeapVector<RefPtrWillBeMember<Geolocation> > observersVector
; | 165 WillBeHeapVector<RefPtrWillBeMember<Geolocation> > observersVector; |
166 copyToVector(m_observers, observersVector); | 166 copyToVector(m_observers, observersVector); |
167 for (size_t i = 0; i < observersVector.size(); ++i) | 167 for (size_t i = 0; i < observersVector.size(); ++i) |
168 observersVector[i]->setError(error); | 168 observersVector[i]->setError(error); |
169 } | 169 } |
170 | 170 |
171 GeolocationPosition* GeolocationController::lastPosition() | 171 GeolocationPosition* GeolocationController::lastPosition() |
172 { | 172 { |
173 if (m_lastPosition.get()) | 173 if (m_lastPosition.get()) |
174 return m_lastPosition.get(); | 174 return m_lastPosition.get(); |
175 | 175 |
(...skipping 26 matching lines...) Expand all Loading... |
202 { | 202 { |
203 return "GeolocationController"; | 203 return "GeolocationController"; |
204 } | 204 } |
205 | 205 |
206 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) | 206 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) |
207 { | 207 { |
208 Supplement<LocalFrame>::provideTo(frame, GeolocationController::supplementNa
me(), GeolocationController::create(frame, client)); | 208 Supplement<LocalFrame>::provideTo(frame, GeolocationController::supplementNa
me(), GeolocationController::create(frame, client)); |
209 } | 209 } |
210 | 210 |
211 } // namespace WebCore | 211 } // namespace WebCore |
OLD | NEW |