Commit 7bcf9dd0 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Extract chromeos/dbus/shill/BUILD.gn

This replaces the //chromeos/dbus dependency with just
//chromeos/dbus/shill in //chromeos/network and a few other BUILD.gn
files.

For mechanical changes to services/device/geolocation:
TBR=mcasas@chromium.org

Bug: 948390
Change-Id: I07ba8c79dfa603fb6018e2b2166ca8813240c4b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553679
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648692}
parent a3c69dac
......@@ -13,6 +13,7 @@ component("dbus") {
public_deps = [
":common",
"//chromeos/dbus/constants",
"//chromeos/dbus/shill",
"//dbus",
]
deps = [
......@@ -134,48 +135,6 @@ component("dbus") {
"runtime_probe_client.h",
"seneschal_client.cc",
"seneschal_client.h",
"shill/fake_gsm_sms_client.cc",
"shill/fake_gsm_sms_client.h",
"shill/fake_modem_messaging_client.cc",
"shill/fake_modem_messaging_client.h",
"shill/fake_shill_device_client.cc",
"shill/fake_shill_device_client.h",
"shill/fake_shill_ipconfig_client.cc",
"shill/fake_shill_ipconfig_client.h",
"shill/fake_shill_manager_client.cc",
"shill/fake_shill_manager_client.h",
"shill/fake_shill_profile_client.cc",
"shill/fake_shill_profile_client.h",
"shill/fake_shill_service_client.cc",
"shill/fake_shill_service_client.h",
"shill/fake_shill_third_party_vpn_driver_client.cc",
"shill/fake_shill_third_party_vpn_driver_client.h",
"shill/fake_sms_client.cc",
"shill/fake_sms_client.h",
"shill/gsm_sms_client.cc",
"shill/gsm_sms_client.h",
"shill/modem_messaging_client.cc",
"shill/modem_messaging_client.h",
"shill/shill_client_helper.cc",
"shill/shill_client_helper.h",
"shill/shill_clients.cc",
"shill/shill_clients.h",
"shill/shill_device_client.cc",
"shill/shill_device_client.h",
"shill/shill_ipconfig_client.cc",
"shill/shill_ipconfig_client.h",
"shill/shill_manager_client.cc",
"shill/shill_manager_client.h",
"shill/shill_profile_client.cc",
"shill/shill_profile_client.h",
"shill/shill_property_changed_observer.h",
"shill/shill_service_client.cc",
"shill/shill_service_client.h",
"shill/shill_third_party_vpn_driver_client.cc",
"shill/shill_third_party_vpn_driver_client.h",
"shill/shill_third_party_vpn_observer.h",
"shill/sms_client.cc",
"shill/sms_client.h",
"smb_provider_client.cc",
"smb_provider_client.h",
"update_engine_client.cc",
......@@ -244,6 +203,7 @@ source_set("unit_tests") {
"//chromeos/dbus/cryptohome",
"//chromeos/dbus/cryptohome:attestation_proto",
"//chromeos/dbus/session_manager",
"//chromeos/dbus/shill:test_support",
"//components/account_id",
"//dbus",
"//dbus:test_support",
......@@ -268,16 +228,6 @@ source_set("unit_tests") {
"power/fake_power_manager_client_unittest.cc",
"power/power_manager_client_unittest.cc",
"power/power_policy_controller_unittest.cc",
"shill/gsm_sms_client_unittest.cc",
"shill/modem_messaging_client_unittest.cc",
"shill/shill_client_unittest_base.cc",
"shill/shill_client_unittest_base.h",
"shill/shill_device_client_unittest.cc",
"shill/shill_ipconfig_client_unittest.cc",
"shill/shill_manager_client_unittest.cc",
"shill/shill_profile_client_unittest.cc",
"shill/shill_service_client_unittest.cc",
"shill/shill_third_party_vpn_driver_client_unittest.cc",
"update_engine_client_unittest.cc",
"util/version_loader_unittest.cc",
]
......
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos")
component("shill") {
defines = [ "IS_SHILL_CLIENT_IMPL" ]
deps = [
"//base",
"//chromeos/dbus:common",
"//chromeos/dbus/constants",
"//components/device_event_log",
"//dbus",
"//net",
]
sources = [
"fake_gsm_sms_client.cc",
"fake_gsm_sms_client.h",
"fake_modem_messaging_client.cc",
"fake_modem_messaging_client.h",
"fake_shill_device_client.cc",
"fake_shill_device_client.h",
"fake_shill_ipconfig_client.cc",
"fake_shill_ipconfig_client.h",
"fake_shill_manager_client.cc",
"fake_shill_manager_client.h",
"fake_shill_profile_client.cc",
"fake_shill_profile_client.h",
"fake_shill_service_client.cc",
"fake_shill_service_client.h",
"fake_shill_third_party_vpn_driver_client.cc",
"fake_shill_third_party_vpn_driver_client.h",
"fake_sms_client.cc",
"fake_sms_client.h",
"gsm_sms_client.cc",
"gsm_sms_client.h",
"modem_messaging_client.cc",
"modem_messaging_client.h",
"shill_client_helper.cc",
"shill_client_helper.h",
"shill_clients.cc",
"shill_clients.h",
"shill_device_client.cc",
"shill_device_client.h",
"shill_ipconfig_client.cc",
"shill_ipconfig_client.h",
"shill_manager_client.cc",
"shill_manager_client.h",
"shill_profile_client.cc",
"shill_profile_client.h",
"shill_property_changed_observer.h",
"shill_service_client.cc",
"shill_service_client.h",
"shill_third_party_vpn_driver_client.cc",
"shill_third_party_vpn_driver_client.h",
"shill_third_party_vpn_observer.h",
"sms_client.cc",
"sms_client.h",
]
}
source_set("test_support") {
testonly = true
public_deps = [
":shill",
]
deps = [
"//base",
"//base/test:test_support",
"//chromeos/dbus:common",
"//dbus:test_support",
"//testing/gmock",
"//testing/gtest",
]
sources = [
"gsm_sms_client_unittest.cc",
"modem_messaging_client_unittest.cc",
"shill_client_unittest_base.cc",
"shill_client_unittest_base.h",
"shill_device_client_unittest.cc",
"shill_ipconfig_client_unittest.cc",
"shill_manager_client_unittest.cc",
"shill_profile_client_unittest.cc",
"shill_service_client_unittest.cc",
"shill_third_party_vpn_driver_client_unittest.cc",
]
}
......@@ -19,7 +19,7 @@
namespace chromeos {
// A fake implementation of GsmSMSClient used for tests.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeGsmSMSClient : public GsmSMSClient {
class COMPONENT_EXPORT(SHILL_CLIENT) FakeGsmSMSClient : public GsmSMSClient {
public:
FakeGsmSMSClient();
~FakeGsmSMSClient() override;
......
......@@ -15,7 +15,7 @@
namespace chromeos {
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeModemMessagingClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeModemMessagingClient
: public ModemMessagingClient {
public:
FakeModemMessagingClient();
......
......@@ -19,7 +19,7 @@ namespace chromeos {
// A fake implementation of ShillDeviceClient.
// Implemented: Stub cellular device for SMS testing.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillDeviceClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillDeviceClient
: public ShillDeviceClient,
public ShillDeviceClient::TestInterface {
public:
......
......@@ -14,7 +14,7 @@
namespace chromeos {
// A fake implementation of ShillIPConfigClient.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillIPConfigClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillIPConfigClient
: public ShillIPConfigClient,
public ShillIPConfigClient::TestInterface {
public:
......
......@@ -20,7 +20,7 @@ namespace chromeos {
// A fake implementation of ShillManagerClient. This works in close coordination
// with FakeShillServiceClient. FakeShillDeviceClient, and
// FakeShillProfileClient, and is not intended to be used independently.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillManagerClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillManagerClient
: public ShillManagerClient,
public ShillManagerClient::TestInterface {
public:
......
......@@ -17,7 +17,7 @@
namespace chromeos {
// A stub implementation of ShillProfileClient.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillProfileClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillProfileClient
: public ShillProfileClient,
public ShillProfileClient::TestInterface {
public:
......
......@@ -16,7 +16,6 @@
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill/shill_device_client.h"
#include "chromeos/dbus/shill/shill_manager_client.h"
#include "chromeos/dbus/shill/shill_profile_client.h"
......
......@@ -20,7 +20,7 @@ namespace chromeos {
// A fake implementation of ShillServiceClient. This works in close coordination
// with FakeShillManagerClient and is not intended to be used independently.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillServiceClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillServiceClient
: public ShillServiceClient,
public ShillServiceClient::TestInterface {
public:
......
......@@ -21,7 +21,7 @@ namespace chromeos {
// The client can generate fake DBus signals when
// ShillThirdPartyVpnDriverClient::TestInterface methods are called. The
// DBus methods are nops that only acknowledge the caller.
class COMPONENT_EXPORT(CHROMEOS_DBUS) FakeShillThirdPartyVpnDriverClient
class COMPONENT_EXPORT(SHILL_CLIENT) FakeShillThirdPartyVpnDriverClient
: public ShillThirdPartyVpnDriverClient,
public ShillThirdPartyVpnDriverClient::TestInterface {
public:
......
......@@ -30,7 +30,7 @@ namespace chromeos {
// org.freedesktop.ModemManager.Modem.Gsm.SMS service.
// All methods should be called from the origin thread (UI thread) which
// initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) GsmSMSClient {
class COMPONENT_EXPORT(SHILL_CLIENT) GsmSMSClient {
public:
typedef base::Callback<void(uint32_t index, bool complete)>
SmsReceivedHandler;
......
......@@ -11,7 +11,6 @@
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/dbus/dbus_client.h"
#include "chromeos/dbus/dbus_method_call_status.h"
namespace dbus {
......@@ -25,7 +24,7 @@ namespace chromeos {
// org.freedesktop.ModemManager1.Modem.Messaging service. All methods
// should be called from the origin thread (UI thread) which
// initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ModemMessagingClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ModemMessagingClient {
public:
typedef base::Callback<void(const dbus::ObjectPath& message_path,
bool complete)>
......
......@@ -15,13 +15,13 @@ namespace chromeos {
namespace shill_clients {
// Initialize Shill and modemmanager related dbus clients.
COMPONENT_EXPORT(CHROMEOS_DBUS) void Initialize(dbus::Bus* system_bus);
COMPONENT_EXPORT(SHILL_CLIENT) void Initialize(dbus::Bus* system_bus);
// Initialize fake Shill and modemmanager related dbus clients.
COMPONENT_EXPORT(CHROMEOS_DBUS) void InitializeFakes();
COMPONENT_EXPORT(SHILL_CLIENT) void InitializeFakes();
// Shut down Shill and modemmanager related dbus clients.
COMPONENT_EXPORT(CHROMEOS_DBUS) void Shutdown();
COMPONENT_EXPORT(SHILL_CLIENT) void Shutdown();
} // namespace shill_clients
} // namespace chromeos
......
......@@ -33,7 +33,7 @@ class ShillPropertyChangedObserver;
// ShillDeviceClient is used to communicate with the Shill Device service.
// All methods should be called from the origin thread which initializes the
// DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillDeviceClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillDeviceClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
......
......@@ -29,7 +29,7 @@ class ShillPropertyChangedObserver;
// ShillIPConfigClient is used to communicate with the Shill IPConfig
// service. All methods should be called from the origin thread which
// initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillIPConfigClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillIPConfigClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
......
......@@ -24,7 +24,7 @@ class ShillPropertyChangedObserver;
// ShillManagerClient is used to communicate with the Shill Manager
// service. All methods should be called from the origin thread which
// initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillManagerClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillManagerClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
......
......@@ -11,7 +11,6 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/values.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill/fake_shill_profile_client.h"
#include "chromeos/dbus/shill/shill_property_changed_observer.h"
#include "dbus/bus.h"
......
......@@ -29,7 +29,7 @@ class ShillPropertyChangedObserver;
// ShillProfileClient is used to communicate with the Shill Profile
// service. All methods should be called from the origin thread which
// initializes the DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillProfileClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillProfileClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallbackWithoutStatus
......
......@@ -29,7 +29,7 @@ namespace chromeos {
// service.
// All methods should be called from the origin thread which initializes the
// DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillServiceClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillServiceClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
......
......@@ -30,7 +30,7 @@ class ShillThirdPartyVpnObserver;
// ThirdPartyVpnDriver service.
// All methods should be called from the origin thread which initializes the
// DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) ShillThirdPartyVpnDriverClient {
class COMPONENT_EXPORT(SHILL_CLIENT) ShillThirdPartyVpnDriverClient {
public:
class TestInterface {
public:
......
......@@ -10,7 +10,6 @@
#include "base/callback.h"
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/dbus/dbus_client.h"
namespace base {
class Bus;
......@@ -18,6 +17,7 @@ class DictionaryValue;
} // namespace base
namespace dbus {
class Bus;
class ObjectPath;
}
......@@ -27,7 +27,7 @@ namespace chromeos {
// org.freedesktop.ModemManager1.SMS service. All methods should be
// called from the origin thread (UI thread) which initializes the
// DBusThreadManager instance.
class COMPONENT_EXPORT(CHROMEOS_DBUS) SMSClient {
class COMPONENT_EXPORT(SHILL_CLIENT) SMSClient {
public:
using GetAllCallback =
base::OnceCallback<void(const base::DictionaryValue& sms)>;
......
......@@ -32,7 +32,7 @@ source_set("unit_tests") {
deps = [
":geolocation",
"//base",
"//chromeos/dbus",
"//chromeos/dbus/shill",
"//chromeos/network:test_support",
"//net",
"//services/network:test_support",
......
......@@ -14,8 +14,9 @@ component("network") {
"//base",
"//base:i18n",
"//chromeos/constants",
"//chromeos/dbus",
"//chromeos/dbus:common",
"//chromeos/dbus/permission_broker",
"//chromeos/dbus/shill",
"//chromeos/login/login_state",
"//components/account_id",
"//components/certificate_matching",
......
......@@ -110,7 +110,7 @@ source_set("geolocation") {
}
if (is_chromeos) {
deps += [
"//chromeos/dbus",
"//chromeos/dbus/shill",
"//chromeos/network",
]
}
......
......@@ -7,7 +7,7 @@
#include "base/test/bind_test_util.h"
#include "build/build_config.h"
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill/shill_clients.h"
#include "chromeos/network/geolocation_handler.h"
#endif
#include "mojo/public/cpp/bindings/interface_ptr.h"
......@@ -40,7 +40,7 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {
protected:
void SetUp() override {
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Initialize();
chromeos::shill_clients::InitializeFakes();
chromeos::NetworkHandler::Initialize();
#endif
network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock());
......@@ -60,7 +60,7 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {
#if defined(OS_CHROMEOS)
chromeos::NetworkHandler::Shutdown();
chromeos::DBusThreadManager::Shutdown();
chromeos::shill_clients::Shutdown();
#endif
// Let the GeolocationImpl destruct earlier than GeolocationProviderImpl to
......
......@@ -8,7 +8,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill/shill_clients.h"
#include "chromeos/dbus/shill/shill_manager_client.h"
#include "chromeos/network/geolocation_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -23,10 +23,9 @@ class GeolocationChromeOsWifiDataProviderTest : public testing::Test {
base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
void SetUp() override {
chromeos::DBusThreadManager::Initialize();
chromeos::shill_clients::InitializeFakes();
chromeos::NetworkHandler::Initialize();
manager_client_ =
chromeos::DBusThreadManager::Get()->GetShillManagerClient();
manager_client_ = chromeos::ShillManagerClient::Get();
manager_test_ = manager_client_->GetTestInterface();
provider_ = new WifiDataProviderChromeOs();
base::RunLoop().RunUntilIdle();
......@@ -35,7 +34,7 @@ class GeolocationChromeOsWifiDataProviderTest : public testing::Test {
void TearDown() override {
provider_ = NULL;
chromeos::NetworkHandler::Shutdown();
chromeos::DBusThreadManager::Shutdown();
chromeos::shill_clients::Shutdown();
}
bool GetAccessPointData() { return provider_->GetAccessPointData(&ap_data_); }
......
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