chromium/services/device/geolocation/network_location_provider.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/device/geolocation/network_location_provider.h"

#include <iterator>
#include <utility>

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/device_event_log/device_event_log.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/device/geolocation/position_cache.h"
#include "services/device/public/cpp/device_features.h"
#include "services/device/public/cpp/geolocation/geoposition.h"
#include "services/device/public/cpp/geolocation/network_location_request_source.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"

#if BUILDFLAG(IS_APPLE)
#include "services/device/public/cpp/device_features.h"
#endif

namespace device {
namespace {
// The maximum period of time we'll wait for a complete set of wifi data
// before sending the request.
const int kDataCompleteWaitSeconds =;

// The maximum age of a cached network location estimate before it can no longer
// be returned as a fresh estimate. This should be at least as long as the
// longest polling interval used by the WifiDataProvider.
const int kLastPositionMaxAgeSeconds =;  // 10 minutes

}  // namespace

// NetworkLocationProvider
NetworkLocationProvider::NetworkLocationProvider(
    scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
    const std::string& api_key,
    PositionCache* position_cache,
    base::RepeatingClosure internals_updated_closure,
    NetworkRequestCallback network_request_callback,
    NetworkResponseCallback network_response_callback)
    :{}

NetworkLocationProvider::~NetworkLocationProvider() {}

void NetworkLocationProvider::FillDiagnostics(
    mojom::GeolocationDiagnostics& diagnostics) {}

void NetworkLocationProvider::SetUpdateCallback(
    const LocationProvider::LocationProviderUpdateCallback& callback) {}

void NetworkLocationProvider::OnPermissionGranted() {}

void NetworkLocationProvider::OnWifiDataUpdate() {}

void NetworkLocationProvider::OnLocationResponse(
    mojom::GeopositionResultPtr result,
    bool server_error,
    const WifiData& wifi_data,
    mojom::NetworkLocationResponsePtr response_data) {}

void NetworkLocationProvider::StartProvider(bool high_accuracy) {}

void NetworkLocationProvider::StopProvider() {}

const mojom::GeopositionResult* NetworkLocationProvider::GetPosition() {}

void NetworkLocationProvider::RequestPosition() {}

}  // namespace device