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

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

Issue 332153002: Oilpan: have GeolocationInspectorAgent persistently track its controllers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make hash sets over controllers will-be-persistents Created 6 years, 6 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
« no previous file with comments | « Source/modules/geolocation/testing/GeolocationClientMock.h ('k') | no next file » | 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/modules/geolocation/testing/GeolocationClientMock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698