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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 67 { |
68 ASSERT(m_observers.isEmpty()); | 68 ASSERT(m_observers.isEmpty()); |
69 } | 69 } |
70 | 70 |
71 void GeolocationController::willBeDestroyed() | 71 void GeolocationController::willBeDestroyed() |
72 { | 72 { |
73 if (m_client) | 73 if (m_client) |
74 m_client->geolocationDestroyed(); | 74 m_client->geolocationDestroyed(); |
75 } | 75 } |
76 | 76 |
77 PassOwnPtr<GeolocationController> GeolocationController::create(Page& page, Geol
ocationClient* client) | 77 PassOwnPtrWillBeRawPtr<GeolocationController> GeolocationController::create(Page
& page, GeolocationClient* client) |
78 { | 78 { |
79 return adoptPtr(new GeolocationController(page, client)); | 79 return adoptPtrWillBeNoop(new GeolocationController(page, client)); |
80 } | 80 } |
81 | 81 |
82 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc
curacy) | 82 void GeolocationController::addObserver(Geolocation* observer, bool enableHighAc
curacy) |
83 { | 83 { |
84 // This may be called multiple times with the same observer, though removeOb
server() | 84 // This may be called multiple times with the same observer, though removeOb
server() |
85 // is called only once with each. | 85 // is called only once with each. |
86 bool wasEmpty = m_observers.isEmpty(); | 86 bool wasEmpty = m_observers.isEmpty(); |
87 m_observers.add(observer); | 87 m_observers.add(observer); |
88 if (enableHighAccuracy) | 88 if (enableHighAccuracy) |
89 m_highAccuracyObservers.add(observer); | 89 m_highAccuracyObservers.add(observer); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 startUpdatingIfNeeded(); | 172 startUpdatingIfNeeded(); |
173 else | 173 else |
174 stopUpdatingIfNeeded(); | 174 stopUpdatingIfNeeded(); |
175 } | 175 } |
176 | 176 |
177 const char* GeolocationController::supplementName() | 177 const char* GeolocationController::supplementName() |
178 { | 178 { |
179 return "GeolocationController"; | 179 return "GeolocationController"; |
180 } | 180 } |
181 | 181 |
| 182 void GeolocationController::trace(Visitor* visitor) |
| 183 { |
| 184 visitor->trace(m_lastPosition); |
| 185 visitor->trace(m_observers); |
| 186 visitor->trace(m_highAccuracyObservers); |
| 187 } |
| 188 |
182 void provideGeolocationTo(Page& page, GeolocationClient* client) | 189 void provideGeolocationTo(Page& page, GeolocationClient* client) |
183 { | 190 { |
184 Supplement<Page>::provideTo(page, GeolocationController::supplementName(), G
eolocationController::create(page, client)); | 191 WillBeHeapSupplement<Page>::provideTo(page, GeolocationController::supplemen
tName(), GeolocationController::create(page, client)); |
185 } | 192 } |
186 | 193 |
187 } // namespace WebCore | 194 } // namespace WebCore |
OLD | NEW |