Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / geolocation / GeolocationController.h
index c868ba1..b5b13c4 100644 (file)
 #ifndef GeolocationController_h
 #define GeolocationController_h
 
-#include "core/page/Page.h"
+#include "core/frame/LocalFrame.h"
 #include "core/page/PageLifecycleObserver.h"
 #include "modules/geolocation/Geolocation.h"
 #include "platform/heap/Handle.h"
 #include "wtf/HashSet.h"
 #include "wtf/Noncopyable.h"
-#include "wtf/RefPtr.h"
 
-namespace WebCore {
+namespace blink {
 
 class GeolocationInspectorAgent;
 class GeolocationClient;
 class GeolocationError;
 class GeolocationPosition;
-class Page;
 
-class GeolocationController FINAL : public NoBaseWillBeGarbageCollectedFinalized<GeolocationController>, public WillBeHeapSupplement<Page>, public PageLifecycleObserver {
+class GeolocationController FINAL : public NoBaseWillBeGarbageCollectedFinalized<GeolocationController>, public WillBeHeapSupplement<LocalFrame>, public PageLifecycleObserver {
     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GeolocationController);
     WTF_MAKE_NONCOPYABLE(GeolocationController);
 public:
     virtual ~GeolocationController();
 
-    static PassOwnPtrWillBeRawPtr<GeolocationController> create(Page&, GeolocationClient*);
+    static PassOwnPtrWillBeRawPtr<GeolocationController> create(LocalFrame&, GeolocationClient*);
 
     void addObserver(Geolocation*, bool enableHighAccuracy);
     void removeObserver(Geolocation*);
@@ -69,30 +67,29 @@ public:
     virtual void pageVisibilityChanged() OVERRIDE;
 
     static const char* supplementName();
-    static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(WillBeHeapSupplement<Page>::from(page, supplementName())); }
+    static GeolocationController* from(LocalFrame* frame) { return static_cast<GeolocationController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); }
 
+    // Inherited from Supplement.
     virtual void trace(Visitor*) OVERRIDE;
 
-    virtual void willBeDestroyed() OVERRIDE;
-
 private:
-    GeolocationController(Page&, GeolocationClient*);
+    GeolocationController(LocalFrame&, GeolocationClient*);
 
     void startUpdatingIfNeeded();
     void stopUpdatingIfNeeded();
 
-    GeolocationClient* m_client;
+    RawPtrWillBeMember<GeolocationClient> m_client;
     bool m_hasClientForTest;
 
-    RefPtrWillBeMember<GeolocationPosition> m_lastPosition;
-    typedef WillBeHeapHashSet<RefPtrWillBeMember<Geolocation> > ObserversSet;
+    PersistentWillBeMember<GeolocationPosition> m_lastPosition;
+    typedef PersistentHeapHashSetWillBeHeapHashSet<Member<Geolocation> > ObserversSet;
     // All observers; both those requesting high accuracy and those not.
     ObserversSet m_observers;
     ObserversSet m_highAccuracyObservers;
     bool m_isClientUpdating;
-    GeolocationInspectorAgent* m_inspectorAgent;
+    RawPtrWillBeMember<GeolocationInspectorAgent> m_inspectorAgent;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // GeolocationController_h