Skip to content

Commit

Permalink
Lacros: Rename deprecated macro/gn names
Browse files Browse the repository at this point in the history
This is a mechanical change that renames deprecated macro replacing:

- BUILDFLAG(IS_{ASH,LACROS}) with BUILDFLAG(IS_CHROMEOS_{ASH,LACROS}),
- gn var is_{ash,lacros} with is_chromeos_{ash,lacros}.

There is a section about the renaming on http://go/lacros-macros.

Bug: 1052397
Change-Id: Iab924af8d28426a60a28d505aeae99ec43717b77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593853
Reviewed-by: Hidehiko Abe <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Commit-Queue: Yuta Hijikata <[email protected]>
Cr-Commit-Position: refs/heads/master@{#837833}
  • Loading branch information
Yuta Hijikata authored and Chromium LUCI CQ committed Dec 17, 2020
1 parent 87056c6 commit 39fff79
Show file tree
Hide file tree
Showing 84 changed files with 249 additions and 248 deletions.
2 changes: 1 addition & 1 deletion services/audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ source_set("tests") {
"//testing/gtest",
]

if (is_ash || is_chromecast) {
if (is_chromeos_ash || is_chromecast) {
sources += [
"public/cpp/sounds/audio_stream_handler_unittest.cc",
"public/cpp/sounds/sounds_manager_unittest.cc",
Expand Down
2 changes: 1 addition & 1 deletion services/audio/public/cpp/output_device_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ TEST_F(AudioServiceOutputDeviceTest, CreatePlayPause) {
}

// Flaky on Linux Chromium OS ASan LSan (https://crbug.com/889845)
#if BUILDFLAG(IS_ASH) && defined(ADDRESS_SANITIZER)
#if BUILDFLAG(IS_CHROMEOS_ASH) && defined(ADDRESS_SANITIZER)
#define MAYBE_VerifyDataFlow DISABLED_VerifyDataFlow
#else
#define MAYBE_VerifyDataFlow VerifyDataFlow
Expand Down
2 changes: 1 addition & 1 deletion services/audio/sync_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SyncReader::SyncReader(
renderer_callback_count_(0),
renderer_missed_callback_count_(0),
trailing_renderer_missed_callback_count_(0),
#if defined(OS_MAC) || BUILDFLAG(IS_ASH)
#if defined(OS_MAC) || BUILDFLAG(IS_CHROMEOS_ASH)
maximum_wait_time_(params.GetBufferDuration() / 2),
#else
// TODO(dalecurtis): Investigate if we can reduce this on all platforms.
Expand Down
6 changes: 3 additions & 3 deletions services/data_decoder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source_set("lib") {
"xml_parser.h",
]

if (is_ash) {
if (is_chromeos_ash) {
sources += [
"ble_scan_parser_impl.cc",
"ble_scan_parser_impl.h",
Expand Down Expand Up @@ -65,7 +65,7 @@ source_set("tests") {
"xml_parser_unittest.cc",
]

if (is_ash) {
if (is_chromeos_ash) {
sources += [ "ble_scan_parser_impl_unittest.cc" ]
}

Expand Down Expand Up @@ -109,7 +109,7 @@ fuzzer_test("xml_parser_fuzzer") {
seed_corpus = "//third_party/libxml/fuzz/seed_corpus"
}

if (is_ash) {
if (is_chromeos_ash) {
fuzzer_test("ble_scan_parser_fuzzer") {
sources = [ "ble_scan_parser_impl_fuzzer.cc" ]
deps = [ ":lib" ]
Expand Down
4 changes: 2 additions & 2 deletions services/data_decoder/data_decoder_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "services/data_decoder/web_bundler.h"
#include "services/data_decoder/xml_parser.h"

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "services/data_decoder/ble_scan_parser_impl.h"
#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

#if !defined(OS_IOS)
#include "services/data_decoder/image_decoder_impl.h"
Expand Down
6 changes: 3 additions & 3 deletions services/data_decoder/image_decoder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "third_party/blink/public/web/web_image.h"
#include "third_party/skia/include/core/SkBitmap.h"

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/gfx/codec/png_codec.h"
#endif

Expand Down Expand Up @@ -73,7 +73,7 @@ void ImageDecoderImpl::DecodeImage(mojo_base::BigBuffer encoded_data,
}

SkBitmap decoded_image;
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (codec == mojom::ImageCodec::ROBUST_PNG) {
// Our robust PNG decoding is using libpng.
if (encoded_data.size()) {
Expand All @@ -84,7 +84,7 @@ void ImageDecoderImpl::DecodeImage(mojo_base::BigBuffer encoded_data,
}
}
}
#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
if (codec == mojom::ImageCodec::DEFAULT) {
decoded_image = blink::WebImage::FromData(
blink::WebData(reinterpret_cast<const char*>(encoded_data.data()),
Expand Down
2 changes: 1 addition & 1 deletion services/data_decoder/public/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ mojom("mojom") {
"//url/mojom:url_mojom_gurl",
]

if (is_ash) {
if (is_chromeos_ash) {
sources += [ "ble_scan_parser.mojom" ]
public_deps += [ "//device/bluetooth/public/mojom" ]
}
Expand Down
10 changes: 5 additions & 5 deletions services/device/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ source_set("lib") {
]
}

if (is_ash && use_dbus) {
if (is_chromeos_ash && use_dbus) {
deps += [
"//services/device/bluetooth:bluetooth_system",
"//services/device/media_transfer_protocol",
Expand All @@ -75,7 +75,7 @@ source_set("lib") {
deps += [ "//services/device/serial" ]
}

if (is_lacros) {
if (is_chromeos_lacros) {
deps += [
"//chromeos/crosapi/mojom",
"//chromeos/lacros",
Expand Down Expand Up @@ -183,7 +183,7 @@ source_set("tests") {
sources += [ "generic_sensor/platform_sensor_provider_unittest_android.cc" ]
}

if (is_ash) {
if (is_chromeos_ash) {
sources += [ "geolocation/wifi_data_provider_chromeos_unittest.cc" ]
}

Expand All @@ -200,15 +200,15 @@ source_set("tests") {
[ "generic_sensor/platform_sensor_and_provider_unittest_linux.cc" ]
}

if ((is_linux || is_lacros) && use_dbus) {
if ((is_linux || is_chromeos_lacros) && use_dbus) {
sources += [
"battery/battery_status_manager_linux_unittest.cc",
"geolocation/wifi_data_provider_linux_unittest.cc",
]
deps += [ "//dbus:test_support" ]
}

if (is_ash) {
if (is_chromeos_ash) {
sources += [
"fingerprint/fingerprint_chromeos_unittest.cc",
"generic_sensor/platform_sensor_chromeos_unittest.cc",
Expand Down
2 changes: 1 addition & 1 deletion services/device/battery/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (!is_android) {
"//mojo/public/cpp/bindings",
]

if (is_ash) {
if (is_chromeos_ash) {
configs += [ "//build/config/linux/dbus" ]
deps += [
"//chromeos/dbus/power",
Expand Down
10 changes: 5 additions & 5 deletions services/device/device_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@
#include "services/device/hid/input_service_linux.h"
#endif

#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chromeos/lacros/lacros_chrome_service_impl.h"
#endif

namespace {

#if !defined(OS_ANDROID)
constexpr bool IsLaCrOS() {
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
return true;
#else
return false;
Expand All @@ -67,7 +67,7 @@ constexpr bool IsLaCrOS() {
#if !defined(OS_ANDROID)
void BindLaCrOSHidManager(
mojo::PendingReceiver<device::mojom::HidManager> receiver) {
#if BUILDFLAG(IS_LACROS)
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// LaCrOS does not have direct access to the permission_broker service over
// D-Bus. Use the HidManager interface from ash-chrome instead.
auto* lacros_chrome_service = chromeos::LacrosChromeServiceImpl::Get();
Expand Down Expand Up @@ -183,7 +183,7 @@ DeviceService::DeviceService(
#endif

DeviceService::~DeviceService() {
#if !defined(OS_ANDROID) && !BUILDFLAG(IS_ASH)
#if !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
// NOTE: We don't call this on Chrome OS due to https://crbug.com/856771, as
// Shutdown() implicitly depends on DBusThreadManager, which may already be
// destroyed by the time DeviceService is destroyed. Fortunately on Chrome OS
Expand Down Expand Up @@ -255,7 +255,7 @@ void DeviceService::BindHidManager(
}
#endif

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void DeviceService::BindBluetoothSystemFactory(
mojo::PendingReceiver<mojom::BluetoothSystemFactory> receiver) {
BluetoothSystemFactory::CreateFactory(std::move(receiver));
Expand Down
6 changes: 3 additions & 3 deletions services/device/device_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "services/device/public/mojom/hid.mojom.h"
#endif

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "services/device/media_transfer_protocol/mtp_device_manager.h"
#include "services/device/public/mojom/bluetooth_system.mojom.h"
#endif
Expand Down Expand Up @@ -166,7 +166,7 @@ class DeviceService : public mojom::DeviceService {
mojo::PendingReceiver<mojom::HidManager> receiver) override;
#endif

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
void BindBluetoothSystemFactory(
mojo::PendingReceiver<mojom::BluetoothSystemFactory> receiver) override;
void BindMtpManager(
Expand Down Expand Up @@ -245,7 +245,7 @@ class DeviceService : public mojom::DeviceService {
scoped_refptr<base::SequencedTaskRunner> serial_port_manager_task_runner_;
#endif

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
std::unique_ptr<MtpDeviceManager> mtp_device_manager_;
#endif

Expand Down
2 changes: 1 addition & 1 deletion services/device/fingerprint/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ component("fingerprint") {
"//mojo/public/cpp/bindings",
]

if (is_ash) {
if (is_chromeos_ash) {
sources += [
"fingerprint_chromeos.cc",
"fingerprint_chromeos.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ TEST_F(PlatformSensorAndProviderLinuxTest,

SensorReadingSharedBuffer* buffer =
static_cast<SensorReadingSharedBuffer*>(mapping.get());
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
double scaling = base::kMeanGravityDouble / kAccelerometerScalingValue;
EXPECT_THAT(buffer->reading.accel.x,
RoundAccelerometerValue(scaling * sensor_values[0]));
Expand Down Expand Up @@ -620,7 +620,7 @@ TEST_F(PlatformSensorAndProviderLinuxTest, CheckLinearAcceleration) {
mojo::ScopedSharedBufferMapping mapping = handle->MapAtOffset(
sizeof(SensorReadingSharedBuffer),
SensorReadingSharedBuffer::GetOffset(SensorType::LINEAR_ACCELERATION));
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// CrOS has a different axes plane and scale, see crbug.com/501184.
double sensor_values[3] = {0, 0, 1};
#else
Expand Down Expand Up @@ -690,7 +690,7 @@ TEST_F(PlatformSensorAndProviderLinuxTest, CheckGyroscopeReadingConversion) {

SensorReadingSharedBuffer* buffer =
static_cast<SensorReadingSharedBuffer*>(mapping.get());
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
double scaling =
gfx::DegToRad(base::kMeanGravityDouble) / kGyroscopeScalingValue;
EXPECT_THAT(buffer->reading.gyro.x,
Expand Down
4 changes: 2 additions & 2 deletions services/device/geolocation/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ source_set("geolocation") {
}

# Platform-specific WifiDataProvider implementations.
if (is_ash) {
if (is_chromeos_ash) {
sources += [
"wifi_data_provider_chromeos.cc",
"wifi_data_provider_chromeos.h",
Expand Down Expand Up @@ -188,7 +188,7 @@ source_set("test_support") {
"//testing/gtest",
]

if (is_ash) {
if (is_chromeos_ash) {
deps += [ "//chromeos/dbus/shill" ]
}
}
8 changes: 4 additions & 4 deletions services/device/geolocation/geolocation_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/dbus/shill/shill_clients.h"
#include "chromeos/network/geolocation_handler.h"
#endif
Expand Down Expand Up @@ -41,7 +41,7 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {

protected:
void SetUp() override {
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::shill_clients::InitializeFakes();
chromeos::NetworkHandler::Initialize();
#endif
Expand All @@ -63,7 +63,7 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {
void TearDown() override {
DeviceServiceTestBase::TearDown();

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
chromeos::NetworkHandler::Shutdown();
chromeos::shill_clients::Shutdown();
#endif
Expand Down Expand Up @@ -91,7 +91,7 @@ class GeolocationServiceUnitTest : public DeviceServiceTestBase {
DISALLOW_COPY_AND_ASSIGN(GeolocationServiceUnitTest);
};

#if BUILDFLAG(IS_ASH) || defined(OS_ANDROID)
#if BUILDFLAG(IS_CHROMEOS_ASH) || defined(OS_ANDROID)
// ChromeOS fails to perform network geolocation when zero wifi networks are
// detected in a scan: https://crbug.com/767300.
#else
Expand Down
2 changes: 1 addition & 1 deletion services/device/hid/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ source_set("hid") {
deps += [ "//device/udev_linux" ]
}

if (is_ash) {
if (is_chromeos_ash) {
deps += [ "//chromeos/dbus/permission_broker" ]
}

Expand Down
12 changes: 6 additions & 6 deletions services/device/hid/hid_service_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#include "device/udev_linux/udev_watcher.h"
#include "services/device/hid/hid_connection_linux.h"

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/system/sys_info.h"
#include "chromeos/dbus/permission_broker/permission_broker_client.h"
#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

namespace device {

Expand Down Expand Up @@ -355,7 +355,7 @@ void HidServiceLinux::Connect(const std::string& device_guid,
}
scoped_refptr<HidDeviceInfo> device_info = map_entry->second;

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Adapt |callback| to a repeating callback because the implementation below
// requires separate callbacks for success and error. Only one will be called.
auto copyable_callback = base::AdaptCallbackForRepeating(std::move(callback));
Expand All @@ -374,10 +374,10 @@ void HidServiceLinux::Connect(const std::string& device_guid,
blocking_task_runner->PostTask(
FROM_HERE, base::BindOnce(&HidServiceLinux::OpenOnBlockingThread,
std::move(params)));
#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}

#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)

// static
void HidServiceLinux::OnPathOpenComplete(std::unique_ptr<ConnectParams> params,
Expand Down Expand Up @@ -434,7 +434,7 @@ void HidServiceLinux::OpenOnBlockingThread(
std::move(params)));
}

#endif // BUILDFLAG(IS_ASH)
#endif // BUILDFLAG(IS_CHROMEOS_ASH)

// static
void HidServiceLinux::FinishOpen(std::unique_ptr<ConnectParams> params) {
Expand Down
2 changes: 1 addition & 1 deletion services/device/hid/hid_service_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HidServiceLinux : public HidService {
// opening a device. Because this operation crosses multiple threads these
// functions are static and the necessary parameters are passed as a single
// struct.
#if BUILDFLAG(IS_ASH)
#if BUILDFLAG(IS_CHROMEOS_ASH)
static void OnPathOpenComplete(std::unique_ptr<ConnectParams> params,
base::ScopedFD fd);
static void OnPathOpenError(const std::string& device_path,
Expand Down
2 changes: 1 addition & 1 deletion services/device/media_transfer_protocol/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//third_party/protobuf/proto_library.gni")

assert(is_ash)
assert(is_chromeos_ash)
assert(use_dbus)

proto_library("mtp_file_entry_proto") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "services/device/public/mojom/mtp_file_entry.mojom.h"
#include "services/device/public/mojom/mtp_storage_info.mojom.h"

#if !BUILDFLAG(IS_ASH)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
#error "Only used on ChromeOS"
#endif

Expand Down
Loading

0 comments on commit 39fff79

Please sign in to comment.