Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: Source/modules/geolocation/testing/GeolocationClientMock.cpp

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | Source/modules/mediastream/MediaStream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/modules/geolocation/Geolocation.cpp ('k') | Source/modules/mediastream/MediaStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698