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

Side by Side Diff: third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp

Issue 1919153002: Tidy up WebGeolocationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: still support implicit conversion Created 4 years, 7 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
OLDNEW
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void GeolocationController::errorOccurred(GeolocationError* error) 133 void GeolocationController::errorOccurred(GeolocationError* error)
134 { 134 {
135 HeapVector<Member<Geolocation>> observersVector; 135 HeapVector<Member<Geolocation>> observersVector;
136 copyToVector(m_observers, observersVector); 136 copyToVector(m_observers, observersVector);
137 for (size_t i = 0; i < observersVector.size(); ++i) 137 for (size_t i = 0; i < observersVector.size(); ++i)
138 observersVector[i]->setError(error); 138 observersVector[i]->setError(error);
139 } 139 }
140 140
141 GeolocationPosition* GeolocationController::lastPosition() 141 GeolocationPosition* GeolocationController::lastPosition()
142 { 142 {
143 if (m_lastPosition.get()) 143 if (m_lastPosition)
144 return m_lastPosition.get(); 144 return m_lastPosition;
145 145
146 if (!m_client) 146 if (!m_client)
147 return 0; 147 return 0;
148 148
149 return m_client->lastPosition(); 149 return m_client->lastPosition();
150 } 150 }
151 151
152 void GeolocationController::setClientForTest(GeolocationClient* client) 152 void GeolocationController::setClientForTest(GeolocationClient* client)
153 { 153 {
154 if (m_hasClientForTest) 154 if (m_hasClientForTest)
(...skipping 29 matching lines...) Expand all
184 Supplement<LocalFrame>::trace(visitor); 184 Supplement<LocalFrame>::trace(visitor);
185 PageLifecycleObserver::trace(visitor); 185 PageLifecycleObserver::trace(visitor);
186 } 186 }
187 187
188 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) 188 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client)
189 { 189 {
190 Supplement<LocalFrame>::provideTo(frame, GeolocationController::supplementNa me(), GeolocationController::create(frame, client)); 190 Supplement<LocalFrame>::provideTo(frame, GeolocationController::supplementNa me(), GeolocationController::create(frame, client));
191 } 191 }
192 192
193 } // namespace blink 193 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698