diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index a0d973abaa0c..b2de06b0372c 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -1216,65 +1216,22 @@ void Geolocation::NotifyAllowedRequest(nsGeolocationRequest* aRequest) { } } -bool Geolocation::RegisterRequestWithPromptImpl( - nsGeolocationRequest* aRequest) { +bool Geolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request) { nsIEventTarget* target = MainThreadTarget(this); - ContentPermissionRequestBase::PromptResult pr = aRequest->CheckPromptPrefs(); + ContentPermissionRequestBase::PromptResult pr = request->CheckPromptPrefs(); if (pr == ContentPermissionRequestBase::PromptResult::Granted) { - aRequest->RequestDelayedTask(target, - nsGeolocationRequest::DelayedTaskType::Allow); + request->RequestDelayedTask(target, + nsGeolocationRequest::DelayedTaskType::Allow); return true; } if (pr == ContentPermissionRequestBase::PromptResult::Denied) { - aRequest->RequestDelayedTask(target, - nsGeolocationRequest::DelayedTaskType::Deny); + request->RequestDelayedTask(target, + nsGeolocationRequest::DelayedTaskType::Deny); return true; } - aRequest->RequestDelayedTask(target, - nsGeolocationRequest::DelayedTaskType::Request); - return true; -} - -bool Geolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request) { - bool isCoreLocationProvider = -#ifdef MOZ_WIDGET_COCOA - !Preferences::GetBool("geo.provider.use_mls", false) && - !Preferences::GetBool("geo.provider.testing", false); -#else - false; -#endif - - if (!isCoreLocationProvider) { - return RegisterRequestWithPromptImpl(request); - } - - if (XRE_IsParentProcess()) { // non e10s mode - if (!isMacGeoSystemPermissionEnabled()) { - return false; - } - return RegisterRequestWithPromptImpl(request); - } - - nsCOMPtr serialTarget = - SystemGroup::EventTargetFor(TaskCategory::Other); - ContentChild* cpc = ContentChild::GetSingleton(); - cpc->SendGetGeoSysPermission()->Then( - serialTarget, __func__, - [request, this](bool aSysPermIsGranted) { - if (!aSysPermIsGranted) { - nsIEventTarget* target = MainThreadTarget(this); - request->RequestDelayedTask( - target, nsGeolocationRequest::DelayedTaskType::Deny); - } else { - RegisterRequestWithPromptImpl(request); - } - }, - [request, this](mozilla::ipc::ResponseRejectReason aReason) { - nsIEventTarget* target = MainThreadTarget(this); - request->RequestDelayedTask( - target, nsGeolocationRequest::DelayedTaskType::Deny); - }); + request->RequestDelayedTask(target, + nsGeolocationRequest::DelayedTaskType::Request); return true; } diff --git a/dom/geolocation/nsGeolocation.h b/dom/geolocation/nsGeolocation.h index 43f2a35340e8..5c991368a8a7 100644 --- a/dom/geolocation/nsGeolocation.h +++ b/dom/geolocation/nsGeolocation.h @@ -197,8 +197,6 @@ class Geolocation final : public nsIGeolocationUpdate, public nsWrapperCache { bool RegisterRequestWithPrompt(nsGeolocationRequest* request); - bool RegisterRequestWithPromptImpl(nsGeolocationRequest* aRequest); - // Check if clearWatch is already called bool IsAlreadyCleared(nsGeolocationRequest* aRequest); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index b1b95ff0e28f..26990152af7d 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -236,7 +236,6 @@ #if defined(XP_MACOSX) # include "nsMacUtilsImpl.h" -# include "CoreLocationLocationProvider.h" #endif #if defined(ANDROID) || defined(LINUX) @@ -4065,15 +4064,6 @@ mozilla::ipc::IPCResult ContentParent::RecvAddGeolocationListener( return IPC_OK(); } -mozilla::ipc::IPCResult ContentParent::RecvGetGeoSysPermission( - std::function&& aCallback) { -#ifdef MOZ_WIDGET_COCOA - // This is only called when using the CoreLocation location provider. - aCallback(isMacGeoSystemPermissionEnabled()); -#endif - return IPC_OK(); -} - mozilla::ipc::IPCResult ContentParent::RecvRemoveGeolocationListener() { if (mGeolocationWatchID != -1) { RefPtr geo = Geolocation::NonWindowSingleton(); diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 5d3b9bcebd14..92f3a461ac6c 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -1000,9 +1000,6 @@ class ContentParent final : public PContentParent, const IPC::Principal& aPrincipal, const bool& aHighAccuracy); mozilla::ipc::IPCResult RecvRemoveGeolocationListener(); - mozilla::ipc::IPCResult RecvGetGeoSysPermission( - std::function&& aCallback); - // MOZ_CAN_RUN_SCRIPT_BOUNDARY because we don't have MOZ_CAN_RUN_SCRIPT bits // in IPC code yet. MOZ_CAN_RUN_SCRIPT_BOUNDARY diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index ef6d82dc1377..b826d714ffb8 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -959,8 +959,6 @@ parent: async RemoveGeolocationListener(); async SetGeolocationHigherAccuracy(bool enable); - async GetGeoSysPermission() returns (bool isok); - async ConsoleMessage(nsString message); async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine, uint32_t lineNumber, uint32_t colNumber, uint32_t flags, diff --git a/dom/system/mac/CoreLocationLocationProvider.h b/dom/system/mac/CoreLocationLocationProvider.h index 1e9137d9e252..6f13c3cab92c 100644 --- a/dom/system/mac/CoreLocationLocationProvider.h +++ b/dom/system/mac/CoreLocationLocationProvider.h @@ -25,8 +25,6 @@ class CoreLocationObjects; class MLSFallback; -bool isMacGeoSystemPermissionEnabled(); - class CoreLocationLocationProvider : public nsIGeolocationProvider { public: NS_DECL_ISUPPORTS diff --git a/dom/system/mac/CoreLocationLocationProvider.mm b/dom/system/mac/CoreLocationLocationProvider.mm index d65b2054ddef..5d56780682ad 100644 --- a/dom/system/mac/CoreLocationLocationProvider.mm +++ b/dom/system/mac/CoreLocationLocationProvider.mm @@ -32,8 +32,6 @@ using namespace mozilla; static const CLLocationAccuracy kHIGH_ACCURACY = kCLLocationAccuracyBest; static const CLLocationAccuracy kDEFAULT_ACCURACY = kCLLocationAccuracyNearestTenMeters; -bool isMacGeoSystemPermissionEnabled() { return [CLLocationManager locationServicesEnabled]; } - @interface LocationDelegate : NSObject { CoreLocationLocationProvider* mProvider; } diff --git a/dom/system/mac/moz.build b/dom/system/mac/moz.build index a9596053821d..8fb85bbe309e 100644 --- a/dom/system/mac/moz.build +++ b/dom/system/mac/moz.build @@ -10,7 +10,6 @@ SOURCES += [ ] EXPORTS += [ - 'CoreLocationLocationProvider.h', 'nsOSPermissionRequest.h', ]