Skip to content

Commit

Permalink
misc4: Use BUILDFLAG for OS checking
Browse files Browse the repository at this point in the history
Use // BUILDFLAG(IS_XXX) instead of // OS_XXX.

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983)
with modifications.

R=thakis@chromium.org

Bug: 1234043
Change-Id: Ibcf60c672ab3167ddad14656bff27378e67f3975
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3408124
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Reviewed-by: Will Harris <wfh@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962181}
  • Loading branch information
xhwang-chromium authored and Chromium LUCI CQ committed Jan 22, 2022
1 parent 933398e commit 64dc570
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_pixeltest_blending.cc
Original file line number Diff line number Diff line change
Expand Up @@ -465,4 +465,4 @@ TEST_P(LayerTreeHostBlendingPixelTest,
} // namespace
} // namespace cc

#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_pixeltest_filters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1256,4 +1256,4 @@ TEST_P(BackdropFilterInvertTest, HiDpi) {
} // namespace
} // namespace cc

#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_pixeltest_readback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -591,4 +591,4 @@ INSTANTIATE_TEST_SUITE_P(All,
} // namespace
} // namespace cc

#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_pixeltest_scrollbars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,4 @@ TEST_P(LayerTreeHostOverlayScrollbarsPixelTest, NinePatchScrollbarScaledDown) {
} // namespace
} // namespace cc

#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_host_pixeltest_synchronous.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ TEST_P(LayerTreeHostSynchronousPixelTest, OneContentLayerGpuRasterization) {
} // namespace
} // namespace cc

#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)
2 changes: 1 addition & 1 deletion courgette/memory_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ TempMapping* TempMapping::GetMappingFromPtr(void* mem) {

} // namespace courgette

#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)
4 changes: 2 additions & 2 deletions courgette/memory_allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class MemoryAllocator {
}
};

#else // OS_WIN
#else // BUILDFLAG(IS_WIN)

// On Mac, Linux, we use a bare bones implementation that only does
// heap allocations.
Expand Down Expand Up @@ -326,7 +326,7 @@ class MemoryAllocator {
}
};

#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)

// Manages a growable buffer. The buffer allocation is done by the
// MemoryAllocator class. This class will not throw exceptions so call sites
Expand Down
2 changes: 1 addition & 1 deletion extensions/browser/api/app_window/app_window_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ IN_PROC_BROWSER_TEST_F(AppWindowApiTest, MAYBE_AlphaEnabledHasPermissions) {
if (!ui::win::IsAeroGlassEnabled()) {
test_dir = kNoAlphaDir;
}
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)
#endif // USE_AURA && !(OS_LINUX || IS_CHROMEOS_LACROS)

EXPECT_TRUE(RunExtensionTest(test_dir, {.launch_as_platform_app = true}))
Expand Down
2 changes: 1 addition & 1 deletion extensions/shell/app/shell_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void ShellMainDelegate::ZygoteStarting(
nacl::AddNaClZygoteForkDelegates(delegates);
#endif // BUILDFLAG(ENABLE_NACL)
}
#endif // OS_POSIX && !OS_MAC && !OS_ANDROID
#endif // BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_ANDROID)

// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
Expand Down
2 changes: 1 addition & 1 deletion extensions/shell/test/shell_tests_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main(int argc, char** argv) {
// Load and pin user32.dll to avoid having to load it once tests start while
// on the main thread loop where blocking calls are disallowed.
base::win::PinUser32();
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)

extensions::AppShellTestLauncherDelegate launcher_delegate;
return content::LaunchTests(&launcher_delegate, parallel_jobs, argc, argv);
Expand Down
2 changes: 1 addition & 1 deletion headless/test/headless_test_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int main(int argc, char** argv) {
// Load and pin user32.dll to avoid having to load it once tests start while
// on the main thread loop where blocking calls are disallowed.
base::win::PinUser32();
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)

// Setup a working test environment for the network service in case it's used.
// Only create this object in the utility process, so that its members don't
Expand Down
2 changes: 1 addition & 1 deletion net/base/network_interfaces_getifaddrs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <net/if_media.h>
#include <netinet/in_var.h>
#include <sys/ioctl.h>
#endif // !BUILDFLAG(IS_IOS)
#endif

#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
Expand Down
4 changes: 2 additions & 2 deletions net/http/http_auth_handler_negotiate_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class HttpAuthHandlerNegotiateTest : public PlatformTest,
MockAuthLibrary::EnsureTestAccountExists();
#else
factory_->set_library(base::WrapUnique(auth_library_.get()));
#endif // !BUILDFLAG(IS_ANDROID)
#endif // BUILDFLAG(IS_ANDROID)
}

#if BUILDFLAG(IS_ANDROID)
Expand Down Expand Up @@ -187,7 +187,7 @@ class HttpAuthHandlerNegotiateTest : public PlatformTest,
queries[i].expected_input_token,
queries[i].output_token);
}
#endif // !BUILDFLAG(IS_WIN)
#endif // BUILDFLAG(IS_WIN)
}

#if BUILDFLAG(IS_POSIX)
Expand Down
2 changes: 1 addition & 1 deletion net/socket/socket_tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#endif // BUILDFLAG(IS_ANDROID)
#endif

namespace net {

Expand Down
2 changes: 1 addition & 1 deletion sandbox/linux/services/resource_limits_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace {
#define MAYBE_NoFork DISABLE_ON_ASAN(NoFork)
#else
#define MAYBE_NoFork DISABLED_NoFork
#endif // OS_ANDROID
#endif // BUILDFLAG(IS_ANDROID)

// Not being able to fork breaks LeakSanitizer, so disable on
// all ASAN builds.
Expand Down
4 changes: 2 additions & 2 deletions sandbox/policy/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const char kXrCompositingSandbox[] = "xr_compositing";
const char kIconReaderSandbox[] = "icon_reader";
const char kMediaFoundationCdmSandbox[] = "mf_cdm";
const char kWindowsSystemProxyResolverSandbox[] = "proxy_resolver_win";
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)

#if BUILDFLAG(IS_MAC)
const char kMirroringSandbox[] = "mirroring";
#endif // OS_MAC
#endif // BUILDFLAG(IS_MAC)

#if BUILDFLAG(IS_CHROMEOS_ASH)
const char kHardwareVideoDecodingSandbox[] = "hardware_video_decoding";
Expand Down
4 changes: 2 additions & 2 deletions sandbox/policy/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ SANDBOX_POLICY_EXPORT extern const char kXrCompositingSandbox[];
SANDBOX_POLICY_EXPORT extern const char kIconReaderSandbox[];
SANDBOX_POLICY_EXPORT extern const char kMediaFoundationCdmSandbox[];
SANDBOX_POLICY_EXPORT extern const char kWindowsSystemProxyResolverSandbox[];
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)

#if BUILDFLAG(IS_MAC)
SANDBOX_POLICY_EXPORT extern const char kMirroringSandbox[];
#endif // OS_MAC
#endif // BUILDFLAG(IS_MAC)

#if BUILDFLAG(IS_CHROMEOS_ASH)
SANDBOX_POLICY_EXPORT extern const char kHardwareVideoDecodingSandbox[];
Expand Down
2 changes: 1 addition & 1 deletion sql/sandboxed_vfs_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ int SandboxedVfsFile::DeviceCharacteristics() {
// NOTE: SQLite's unix VFS attempts to detect the underlying filesystem and
// sets some flags based on the result.
return 0;
#endif // OS_WIN
#endif // BUILDFLAG(IS_WIN)
}

int SandboxedVfsFile::ShmMap(int page_index,
Expand Down

0 comments on commit 64dc570

Please sign in to comment.