Commit 378f482c authored by Matt Reynolds's avatar Matt Reynolds Committed by Commit Bot

[geolocation] Clean up deprecated sources assignment filter

Remove deprecated_default_sources_assignment_filter and replace
it with explicit is_win, is_mac, etc. sections.

BUG=1018739

Change-Id: I1eb15302d1c881068f59edffe1f0c85c4a2c1349
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442199Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813928}
parent c3c2606d
...@@ -9,13 +9,6 @@ if (is_android) { ...@@ -9,13 +9,6 @@ if (is_android) {
import("//build/config/android/rules.gni") # For generate_jni(). import("//build/config/android/rules.gni") # For generate_jni().
} }
# This file depends on the legacy global sources assignment filter. It should
# be converted to check target platform before assigning source files to the
# sources variable. Remove this import and set_sources_assignment_filter call
# when the file has been converted. See https://crbug.com/1018739 for details.
import("//build/config/deprecated_default_sources_assignment_filter.gni")
set_sources_assignment_filter(deprecated_default_sources_assignment_filter)
source_set("geolocation") { source_set("geolocation") {
visibility = [ visibility = [
":*", ":*",
...@@ -23,8 +16,6 @@ source_set("geolocation") { ...@@ -23,8 +16,6 @@ source_set("geolocation") {
] ]
sources = [ sources = [
"empty_wifi_data_provider.cc",
"empty_wifi_data_provider.h",
"geolocation_config.cc", "geolocation_config.cc",
"geolocation_config.h", "geolocation_config.h",
"geolocation_context.cc", "geolocation_context.cc",
...@@ -34,14 +25,8 @@ source_set("geolocation") { ...@@ -34,14 +25,8 @@ source_set("geolocation") {
"geolocation_provider.h", "geolocation_provider.h",
"geolocation_provider_impl.cc", "geolocation_provider_impl.cc",
"geolocation_provider_impl.h", "geolocation_provider_impl.h",
"location_api_adapter_android.cc",
"location_api_adapter_android.h",
"location_arbitrator.cc", "location_arbitrator.cc",
"location_arbitrator.h", "location_arbitrator.h",
"location_provider_android.cc",
"location_provider_android.h",
"network_location_provider.cc",
"network_location_provider.h",
"network_location_request.cc", "network_location_request.cc",
"network_location_request.h", "network_location_request.h",
"position_cache.h", "position_cache.h",
...@@ -57,20 +42,8 @@ source_set("geolocation") { ...@@ -57,20 +42,8 @@ source_set("geolocation") {
"wifi_data.h", "wifi_data.h",
"wifi_data_provider.cc", "wifi_data_provider.cc",
"wifi_data_provider.h", "wifi_data_provider.h",
"wifi_data_provider_chromeos.cc",
"wifi_data_provider_chromeos.h",
"wifi_data_provider_common.cc",
"wifi_data_provider_common.h",
"wifi_data_provider_common_win.cc",
"wifi_data_provider_common_win.h",
"wifi_data_provider_linux.cc",
"wifi_data_provider_linux.h",
"wifi_data_provider_mac.h",
"wifi_data_provider_mac.mm",
"wifi_data_provider_manager.cc", "wifi_data_provider_manager.cc",
"wifi_data_provider_manager.h", "wifi_data_provider_manager.h",
"wifi_data_provider_win.cc",
"wifi_data_provider_win.h",
"wifi_polling_policy.cc", "wifi_polling_policy.cc",
"wifi_polling_policy.h", "wifi_polling_policy.h",
] ]
...@@ -87,52 +60,30 @@ source_set("geolocation") { ...@@ -87,52 +60,30 @@ source_set("geolocation") {
"//services/device/public/mojom", "//services/device/public/mojom",
"//services/network/public/cpp", "//services/network/public/cpp",
] ]
if (is_android) {
sources -= [
"network_location_provider.cc",
"network_location_provider.h",
]
deps += [ ":geolocation_jni_headers" ]
}
# TODO(mcasas): prefer adding files than removing them (see cookbook.md).
# Dealing with *wifi_data_provider_*.cc is also a bit complicated given
# android, chromeos, linux and use_dbus.
if (is_android) { if (is_android) {
sources -= [ "wifi_data_provider_common.cc" ] sources += [
} "location_api_adapter_android.cc",
if (is_chromeos || (is_linux && !use_dbus)) { "location_api_adapter_android.h",
sources -= [ "wifi_data_provider_linux.cc" ] "location_provider_android.cc",
} "location_provider_android.h",
if ((is_linux || is_chromeos) && use_dbus) {
sources -= [ "empty_wifi_data_provider.cc" ]
deps += [ "//dbus" ]
}
if (is_win || is_mac) {
sources -= [
"empty_wifi_data_provider.cc",
"empty_wifi_data_provider.h",
] ]
} deps += [ ":geolocation_jni_headers" ]
if (is_chromeos) { } else {
deps += [ sources += [
"//chromeos/dbus/shill", "network_location_provider.cc",
"//chromeos/network", "network_location_provider.h",
"wifi_data_provider_common.cc",
"wifi_data_provider_common.h",
] ]
} }
if (is_mac) { if (is_mac) {
frameworks = [ frameworks = [ "CoreLocation.framework" ]
"CoreWLAN.framework",
"Foundation.framework",
"CoreLocation.framework",
]
sources += [ sources += [
"core_location_provider.h", "core_location_provider.h",
"core_location_provider.mm", "core_location_provider.mm",
] ]
deps += [ "//services/device/public/cpp:device_features" ] deps += [ "//services/device/public/cpp:device_features" ]
} }
...@@ -141,9 +92,47 @@ source_set("geolocation") { ...@@ -141,9 +92,47 @@ source_set("geolocation") {
"win/location_provider_winrt.cc", "win/location_provider_winrt.cc",
"win/location_provider_winrt.h", "win/location_provider_winrt.h",
] ]
deps += [ "//services/device/public/cpp:device_features" ] deps += [ "//services/device/public/cpp:device_features" ]
} }
# Platform-specific WifiDataProvider implementations.
if (is_chromeos) {
sources += [
"wifi_data_provider_chromeos.cc",
"wifi_data_provider_chromeos.h",
]
deps += [ "//chromeos/network" ]
} else if (is_linux && use_dbus) {
sources += [
"wifi_data_provider_linux.cc",
"wifi_data_provider_linux.h",
]
deps += [ "//dbus" ]
} else if (is_mac) {
frameworks += [
"CoreWLAN.framework",
"Foundation.framework",
]
sources += [
"wifi_data_provider_mac.h",
"wifi_data_provider_mac.mm",
]
} else if (is_win) {
sources += [
"wifi_data_provider_common_win.cc",
"wifi_data_provider_common_win.h",
"wifi_data_provider_win.cc",
"wifi_data_provider_win.h",
]
} else {
# WifiDataProviderManager declares a static factory method that is defined
# by the platform implementation. Platforms with no Wi-Fi data provider must
# include EmptyWifiDataProvider to provide this definition.
sources += [
"empty_wifi_data_provider.cc",
"empty_wifi_data_provider.h",
]
}
} }
if (is_android) { if (is_android) {
...@@ -194,4 +183,8 @@ source_set("test_support") { ...@@ -194,4 +183,8 @@ source_set("test_support") {
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
] ]
if (is_chromeos) {
deps += [ "//chromeos/dbus/shill" ]
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment