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 26 matching lines...) Expand all Loading... | |
37 #include "platform/Timer.h" | 37 #include "platform/Timer.h" |
38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 class Document; | 42 class Document; |
43 class LocalFrame; | 43 class LocalFrame; |
44 class GeolocationController; | 44 class GeolocationController; |
45 class GeolocationError; | 45 class GeolocationError; |
46 class GeolocationPosition; | 46 class GeolocationPosition; |
47 class Page; | 47 class Page; |
Michael van Ouwerkerk
2014/04/29 15:06:19
Please delete this.
jam
2014/04/29 15:46:01
Done.
| |
48 class ExecutionContext; | 48 class ExecutionContext; |
49 | 49 |
50 class Geolocation FINAL : public RefCountedWillBeGarbageCollectedFinalized<Geolo cation>, public ScriptWrappable, public ActiveDOMObject | 50 class Geolocation FINAL : public RefCountedWillBeGarbageCollectedFinalized<Geolo cation>, public ScriptWrappable, public ActiveDOMObject |
51 { | 51 { |
52 public: | 52 public: |
53 static PassRefPtrWillBeRawPtr<Geolocation> create(ExecutionContext*); | 53 static PassRefPtrWillBeRawPtr<Geolocation> create(ExecutionContext*); |
54 virtual ~Geolocation(); | 54 virtual ~Geolocation(); |
55 void trace(Visitor*); | 55 void trace(Visitor*); |
56 | 56 |
57 virtual void stop() OVERRIDE; | 57 virtual void stop() OVERRIDE; |
(...skipping 23 matching lines...) Expand all Loading... | |
81 void setError(GeolocationError*); | 81 void setError(GeolocationError*); |
82 | 82 |
83 private: | 83 private: |
84 // Returns the last known position, if any. May return null. | 84 // Returns the last known position, if any. May return null. |
85 Geoposition* lastPosition(); | 85 Geoposition* lastPosition(); |
86 | 86 |
87 bool isDenied() const { return m_allowGeolocation == No; } | 87 bool isDenied() const { return m_allowGeolocation == No; } |
88 | 88 |
89 explicit Geolocation(ExecutionContext*); | 89 explicit Geolocation(ExecutionContext*); |
90 | 90 |
91 Page* page() const; | |
92 | |
93 // Holds the success and error callbacks and the options that were provided | 91 // Holds the success and error callbacks and the options that were provided |
94 // when a oneshot or watcher were created. Also, if specified in the | 92 // when a oneshot or watcher were created. Also, if specified in the |
95 // options, manages a timer to limit the time to wait for the system to | 93 // options, manages a timer to limit the time to wait for the system to |
96 // obtain a position. | 94 // obtain a position. |
97 class GeoNotifier : public RefCountedWillBeGarbageCollectedFinalized<GeoNoti fier> { | 95 class GeoNotifier : public RefCountedWillBeGarbageCollectedFinalized<GeoNoti fier> { |
98 public: | 96 public: |
99 static PassRefPtrWillBeRawPtr<GeoNotifier> create(Geolocation* geolocati on, PassOwnPtr<PositionCallback> positionCallback, PassOwnPtr<PositionErrorCallb ack> positionErrorCallback, PassRefPtrWillBeRawPtr<PositionOptions> options) | 97 static PassRefPtrWillBeRawPtr<GeoNotifier> create(Geolocation* geolocati on, PassOwnPtr<PositionCallback> positionCallback, PassOwnPtr<PositionErrorCallb ack> positionErrorCallback, PassRefPtrWillBeRawPtr<PositionOptions> options) |
100 { | 98 { |
101 return adoptRefWillBeNoop(new GeoNotifier(geolocation, positionCallb ack, positionErrorCallback, options)); | 99 return adoptRefWillBeNoop(new GeoNotifier(geolocation, positionCallb ack, positionErrorCallback, options)); |
102 } | 100 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 Yes, | 239 Yes, |
242 No | 240 No |
243 } m_allowGeolocation; | 241 } m_allowGeolocation; |
244 | 242 |
245 GeoNotifierSet m_requestsAwaitingCachedPosition; | 243 GeoNotifierSet m_requestsAwaitingCachedPosition; |
246 }; | 244 }; |
247 | 245 |
248 } // namespace WebCore | 246 } // namespace WebCore |
249 | 247 |
250 #endif // Geolocation_h | 248 #endif // Geolocation_h |
OLD | NEW |