Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Unified Diff: third_party/WebKit/Source/modules/geolocation/GeolocationController.h

Issue 1367853002: Move GeolocationDispatcher into blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/geolocation/GeolocationController.h
diff --git a/third_party/WebKit/Source/modules/geolocation/GeolocationController.h b/third_party/WebKit/Source/modules/geolocation/GeolocationController.h
index 77365b3f81320101593978bdc788a0ab3fd135a5..c47cae86319cce27aced7ab020c24d4de54d5300 100644
--- a/third_party/WebKit/Source/modules/geolocation/GeolocationController.h
+++ b/third_party/WebKit/Source/modules/geolocation/GeolocationController.h
@@ -26,6 +26,8 @@
#ifndef GeolocationController_h
#define GeolocationController_h
+#include "components/geolocation/public/interfaces/geolocation.mojom.h"
+#include "components/permission/public/interfaces/permission.mojom.h"
#include "core/frame/LocalFrame.h"
#include "core/page/PageLifecycleObserver.h"
#include "modules/ModulesExport.h"
@@ -34,60 +36,59 @@
#include "wtf/HashSet.h"
#include "wtf/Noncopyable.h"
+namespace mojo {
+class ServiceProvider;
+}
+
namespace blink {
-class GeolocationClient;
class GeolocationError;
class GeolocationPosition;
-class MODULES_EXPORT GeolocationController final : public NoBaseWillBeGarbageCollectedFinalized<GeolocationController>, public WillBeHeapSupplement<LocalFrame>, public PageLifecycleObserver {
+class MODULES_EXPORT GeolocationController final : public GarbageCollectedFinalized<GeolocationController>, public PageLifecycleObserver {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(GeolocationController);
WTF_MAKE_NONCOPYABLE(GeolocationController);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(GeolocationController);
public:
+ GeolocationController(Geolocation*);
virtual ~GeolocationController();
- static PassOwnPtrWillBeRawPtr<GeolocationController> create(LocalFrame&, GeolocationClient*);
-
- void addObserver(Geolocation*, bool enableHighAccuracy);
- void removeObserver(Geolocation*);
+ void startUpdating(bool enableHighAccuracy);
+ void stopUpdating();
- void requestPermission(Geolocation*);
- void cancelPermissionRequest(Geolocation*);
+ void requestPermission();
+ void cancelPermissionRequest();
void positionChanged(GeolocationPosition*);
void errorOccurred(GeolocationError*);
GeolocationPosition* lastPosition();
- void setClientForTest(GeolocationClient*);
- bool hasClientForTest() { return m_hasClientForTest; }
- GeolocationClient* client() { return m_client; }
-
// Inherited from PageLifecycleObserver.
void pageVisibilityChanged() override;
- static const char* supplementName();
- static GeolocationController* from(LocalFrame* frame) { return static_cast<GeolocationController*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); }
-
- // Inherited from Supplement.
- DECLARE_VIRTUAL_TRACE();
+ DECLARE_TRACE();
private:
- GeolocationController(LocalFrame&, GeolocationClient*);
-
void startUpdatingIfNeeded();
void stopUpdatingIfNeeded();
+ void setEnableHighAccuracy(bool);
+ void QueryNextPosition();
+
+ void onRequestPermissionDone(permission::Status);
+ void onQueryNextPositionDone(geolocation::GeopositionPtr);
+
+ mojo::ServiceProvider* serviceProvider() const;
+
+ geolocation::GeolocationServicePtr m_geolocationService;
+ permission::PermissionServicePtr m_permissionService;
+ bool m_updating = false;
+ bool m_enableHighAccuracy = false;
- RawPtrWillBeMember<GeolocationClient> m_client;
- bool m_hasClientForTest;
+ Member<GeolocationPosition> m_lastPosition;
- 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;
+ // Owns this.
+ WeakMember<Geolocation> m_geolocation;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698