OLD | NEW |
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (m_hasClientForTest) | 89 if (m_hasClientForTest) |
90 m_client->controllerForTestRemoved(this); | 90 m_client->controllerForTestRemoved(this); |
91 } | 91 } |
92 | 92 |
93 void GeolocationController::willBeDestroyed() | 93 void GeolocationController::willBeDestroyed() |
94 { | 94 { |
95 if (m_client) | 95 if (m_client) |
96 m_client->geolocationDestroyed(); | 96 m_client->geolocationDestroyed(); |
97 } | 97 } |
98 | 98 |
99 PassOwnPtr<GeolocationController> GeolocationController::create(LocalFrame& fram
e, GeolocationClient* client) | 99 PassOwnPtrWillBeRawPtr<GeolocationController> GeolocationController::create(Loca
lFrame& frame, GeolocationClient* client) |
100 { | 100 { |
101 return adoptPtr(new GeolocationController(frame, client)); | 101 return adoptPtrWillBeNoop(new GeolocationController(frame, client)); |
102 } | 102 } |
103 | 103 |
104 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc
curacy) | 104 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc
curacy) |
105 { | 105 { |
106 // This may be called multiple times with the same observer, though removeOb
server() | 106 // This may be called multiple times with the same observer, though removeOb
server() |
107 // is called only once with each. | 107 // is called only once with each. |
108 bool wasEmpty = m_observers.isEmpty(); | 108 bool wasEmpty = m_observers.isEmpty(); |
109 m_observers.add(observer); | 109 m_observers.add(observer); |
110 if (enableHighAccuracy) | 110 if (enableHighAccuracy) |
111 m_highAccuracyObservers.add(observer); | 111 m_highAccuracyObservers.add(observer); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 startUpdatingIfNeeded(); | 198 startUpdatingIfNeeded(); |
199 else | 199 else |
200 stopUpdatingIfNeeded(); | 200 stopUpdatingIfNeeded(); |
201 } | 201 } |
202 | 202 |
203 const char* GeolocationController::supplementName() | 203 const char* GeolocationController::supplementName() |
204 { | 204 { |
205 return "GeolocationController"; | 205 return "GeolocationController"; |
206 } | 206 } |
207 | 207 |
| 208 void GeolocationController::trace(Visitor* visitor) |
| 209 { |
| 210 visitor->trace(m_lastPosition); |
| 211 visitor->trace(m_observers); |
| 212 visitor->trace(m_highAccuracyObservers); |
| 213 WillBeHeapSupplement<LocalFrame>::trace(visitor); |
| 214 } |
| 215 |
208 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) | 216 void provideGeolocationTo(LocalFrame& frame, GeolocationClient* client) |
209 { | 217 { |
210 Supplement<LocalFrame>::provideTo(frame, GeolocationController::supplementNa
me(), GeolocationController::create(frame, client)); | 218 WillBeHeapSupplement<LocalFrame>::provideTo(frame, GeolocationController::su
pplementName(), GeolocationController::create(frame, client)); |
211 } | 219 } |
212 | 220 |
213 } // namespace WebCore | 221 } // namespace WebCore |
OLD | NEW |