| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Called from Geolocation::disconnectFrame() in response to LocalFrame dest
ruction. | 97 // Called from Geolocation::disconnectFrame() in response to LocalFrame dest
ruction. |
| 98 m_pendingPermissions.remove(geolocation); | 98 m_pendingPermissions.remove(geolocation); |
| 99 if (m_pendingPermissions.isEmpty() && m_permissionTimer.isActive()) | 99 if (m_pendingPermissions.isEmpty() && m_permissionTimer.isActive()) |
| 100 m_permissionTimer.stop(); | 100 m_permissionTimer.stop(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void GeolocationClientMock::asyncUpdatePermission() | 103 void GeolocationClientMock::asyncUpdatePermission() |
| 104 { | 104 { |
| 105 ASSERT(m_permissionState != PermissionStateUnset); | 105 ASSERT(m_permissionState != PermissionStateUnset); |
| 106 if (!m_permissionTimer.isActive()) | 106 if (!m_permissionTimer.isActive()) |
| 107 m_permissionTimer.startOneShot(0); | 107 m_permissionTimer.startOneShot(0, FROM_HERE); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void GeolocationClientMock::permissionTimerFired(Timer<GeolocationClientMock>* t
imer) | 110 void GeolocationClientMock::permissionTimerFired(Timer<GeolocationClientMock>* t
imer) |
| 111 { | 111 { |
| 112 ASSERT_UNUSED(timer, timer == &m_permissionTimer); | 112 ASSERT_UNUSED(timer, timer == &m_permissionTimer); |
| 113 ASSERT(m_permissionState != PermissionStateUnset); | 113 ASSERT(m_permissionState != PermissionStateUnset); |
| 114 bool allowed = m_permissionState == PermissionStateAllowed; | 114 bool allowed = m_permissionState == PermissionStateAllowed; |
| 115 GeolocationSet::iterator end = m_pendingPermissions.end(); | 115 GeolocationSet::iterator end = m_pendingPermissions.end(); |
| 116 | 116 |
| 117 // Once permission has been set (or denied) on a Geolocation object, there c
an be | 117 // Once permission has been set (or denied) on a Geolocation object, there c
an be |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 GeolocationPosition* GeolocationClientMock::lastPosition() | 151 GeolocationPosition* GeolocationClientMock::lastPosition() |
| 152 { | 152 { |
| 153 return m_lastPosition.get(); | 153 return m_lastPosition.get(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void GeolocationClientMock::asyncUpdateController() | 156 void GeolocationClientMock::asyncUpdateController() |
| 157 { | 157 { |
| 158 ASSERT(m_controller); | 158 ASSERT(m_controller); |
| 159 if (m_isActive && !m_controllerTimer.isActive()) | 159 if (m_isActive && !m_controllerTimer.isActive()) |
| 160 m_controllerTimer.startOneShot(0); | 160 m_controllerTimer.startOneShot(0, FROM_HERE); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void GeolocationClientMock::controllerTimerFired(Timer<GeolocationClientMock>* t
imer) | 163 void GeolocationClientMock::controllerTimerFired(Timer<GeolocationClientMock>* t
imer) |
| 164 { | 164 { |
| 165 ASSERT_UNUSED(timer, timer == &m_controllerTimer); | 165 ASSERT_UNUSED(timer, timer == &m_controllerTimer); |
| 166 ASSERT(m_controller); | 166 ASSERT(m_controller); |
| 167 | 167 |
| 168 if (m_lastPosition.get()) { | 168 if (m_lastPosition.get()) { |
| 169 ASSERT(!m_hasError); | 169 ASSERT(!m_hasError); |
| 170 m_controller->positionChanged(m_lastPosition.get()); | 170 m_controller->positionChanged(m_lastPosition.get()); |
| 171 } else if (m_hasError) { | 171 } else if (m_hasError) { |
| 172 m_controller->errorOccurred(GeolocationError::create(GeolocationError::P
ositionUnavailable, m_errorMessage).get()); | 172 m_controller->errorOccurred(GeolocationError::create(GeolocationError::P
ositionUnavailable, m_errorMessage).get()); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void GeolocationClientMock::clearError() | 176 void GeolocationClientMock::clearError() |
| 177 { | 177 { |
| 178 m_hasError = false; | 178 m_hasError = false; |
| 179 m_errorMessage = String(); | 179 m_errorMessage = String(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // WebCore | 182 } // WebCore |
| OLD | NEW |