コード例 #1
0
ファイル: nsGeolocation.cpp プロジェクト: hibrium/Pale-Moon
void
nsGeolocationService::StopDevice()
{
    if(mDisconnectTimer) {
        mDisconnectTimer->Cancel();
        mDisconnectTimer = nullptr;
    }

    if (XRE_GetProcessType() == GoannaProcessType_Content) {
        ContentChild* cpc = ContentChild::GetSingleton();
        cpc->SendRemoveGeolocationListener();
        return; // bail early
    }

    nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
    if (!obs) {
        return;
    }

    if (!mProvider) {
        return;
    }

    mHigherAccuracy = false;

    mProvider->Shutdown();
    obs->NotifyObservers(mProvider,
                         "geolocation-device-events",
                         NS_LITERAL_STRING("shutdown").get());
}
コード例 #2
0
void
nsGeolocationService::StopDevice()
{
  if(mDisconnectTimer) {
    mDisconnectTimer->Cancel();
    mDisconnectTimer = nullptr;
  }

  if (XRE_GetProcessType() == GeckoProcessType_Content) {
    ContentChild* cpc = ContentChild::GetSingleton();
    cpc->SendRemoveGeolocationListener();
    return; // bail early
  }

  nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
  if (!obs) {
    return;
  }

  for (int32_t i = 0; i < mProviders.Count(); i++) {
    mProviders[i]->Shutdown();
    obs->NotifyObservers(mProviders[i],
                         "geolocation-device-events",
                         NS_LITERAL_STRING("shutdown").get());
  }
}