OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 { | 160 { |
161 if (m_isActive && !m_controllerTimer.isActive()) | 161 if (m_isActive && !m_controllerTimer.isActive()) |
162 m_controllerTimer.startOneShot(0, FROM_HERE); | 162 m_controllerTimer.startOneShot(0, FROM_HERE); |
163 } | 163 } |
164 | 164 |
165 void GeolocationClientMock::controllerTimerFired(Timer<GeolocationClientMock>* t
imer) | 165 void GeolocationClientMock::controllerTimerFired(Timer<GeolocationClientMock>* t
imer) |
166 { | 166 { |
167 ASSERT_UNUSED(timer, timer == &m_controllerTimer); | 167 ASSERT_UNUSED(timer, timer == &m_controllerTimer); |
168 | 168 |
169 // Make a copy of the set of controllers since it might be modified while it
erating. | 169 // Make a copy of the set of controllers since it might be modified while it
erating. |
170 HashSet<GeolocationController*> controllers = m_controllers; | 170 GeolocationControllers controllers = m_controllers; |
171 if (m_lastPosition.get()) { | 171 if (m_lastPosition.get()) { |
172 ASSERT(!m_hasError); | 172 ASSERT(!m_hasError); |
173 for (HashSet<GeolocationController*>::iterator it = controllers.begin();
it != controllers.end(); ++it) | 173 for (GeolocationControllers::iterator it = controllers.begin(); it != co
ntrollers.end(); ++it) |
174 (*it)->positionChanged(m_lastPosition.get()); | 174 (*it)->positionChanged(m_lastPosition.get()); |
175 } else if (m_hasError) { | 175 } else if (m_hasError) { |
176 for (HashSet<GeolocationController*>::iterator it = controllers.begin();
it != controllers.end(); ++it) | 176 for (GeolocationControllers::iterator it = controllers.begin(); it != co
ntrollers.end(); ++it) |
177 (*it)->errorOccurred(GeolocationError::create(GeolocationError::Posi
tionUnavailable, m_errorMessage)); | 177 (*it)->errorOccurred(GeolocationError::create(GeolocationError::Posi
tionUnavailable, m_errorMessage)); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 void GeolocationClientMock::clearError() | 181 void GeolocationClientMock::clearError() |
182 { | 182 { |
183 m_hasError = false; | 183 m_hasError = false; |
184 m_errorMessage = String(); | 184 m_errorMessage = String(); |
185 } | 185 } |
186 | 186 |
187 } // WebCore | 187 } // WebCore |
OLD | NEW |