OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. |
3 * Copyright 2010, The Android Open Source Project | 3 * Copyright 2010, The Android Open Source Project |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void requestTimedOut(GeoNotifier*); | 95 void requestTimedOut(GeoNotifier*); |
96 | 96 |
97 private: | 97 private: |
98 // Returns the last known position, if any. May return null. | 98 // Returns the last known position, if any. May return null. |
99 Geoposition* lastPosition(); | 99 Geoposition* lastPosition(); |
100 | 100 |
101 bool isDenied() const { return m_geolocationPermission == PermissionDenied;
} | 101 bool isDenied() const { return m_geolocationPermission == PermissionDenied;
} |
102 | 102 |
103 explicit Geolocation(ExecutionContext*); | 103 explicit Geolocation(ExecutionContext*); |
104 | 104 |
105 typedef HeapVector<Member<GeoNotifier> > GeoNotifierVector; | 105 typedef HeapVector<Member<GeoNotifier>> GeoNotifierVector; |
106 typedef HeapHashSet<Member<GeoNotifier> > GeoNotifierSet; | 106 typedef HeapHashSet<Member<GeoNotifier>> GeoNotifierSet; |
107 | 107 |
108 bool hasListeners() const { return !m_oneShots.isEmpty() || !m_watchers.isEm
pty(); } | 108 bool hasListeners() const { return !m_oneShots.isEmpty() || !m_watchers.isEm
pty(); } |
109 | 109 |
110 void sendError(GeoNotifierVector&, PositionError*); | 110 void sendError(GeoNotifierVector&, PositionError*); |
111 void sendPosition(GeoNotifierVector&, Geoposition*); | 111 void sendPosition(GeoNotifierVector&, Geoposition*); |
112 | 112 |
113 // Removes notifiers that use a cached position from |notifiers| and | 113 // Removes notifiers that use a cached position from |notifiers| and |
114 // if |cached| is not null they are added to it. | 114 // if |cached| is not null they are added to it. |
115 static void extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers,
GeoNotifierVector* cached); | 115 static void extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers,
GeoNotifierVector* cached); |
116 | 116 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 }; | 183 }; |
184 | 184 |
185 Permission m_geolocationPermission; | 185 Permission m_geolocationPermission; |
186 | 186 |
187 GeoNotifierSet m_requestsAwaitingCachedPosition; | 187 GeoNotifierSet m_requestsAwaitingCachedPosition; |
188 }; | 188 }; |
189 | 189 |
190 } // namespace blink | 190 } // namespace blink |
191 | 191 |
192 #endif // Geolocation_h | 192 #endif // Geolocation_h |
OLD | NEW |