Skip to content

Commit

Permalink
Revert "Revert "Base cleanups" (youtube#3433)" (youtube#3435)
Browse files Browse the repository at this point in the history
This reverts commit 9bc5ee3.

b/334975532
  • Loading branch information
andrewsavage1 authored Jun 4, 2024
1 parent 4172b4d commit 104d3cf
Show file tree
Hide file tree
Showing 28 changed files with 45 additions and 94 deletions.
6 changes: 0 additions & 6 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2773,10 +2773,6 @@ component("i18n") {
"i18n/utf8_validator_tables.h",
]
defines = [ "BASE_I18N_IMPLEMENTATION" ]
defines += [
"U_COMMON_IMPLEMENTATION",
"UCONFIG_NO_CONVERSION=0",
]
configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [
"//third_party/ced",
Expand Down Expand Up @@ -3644,8 +3640,6 @@ test("base_unittests") {
"//third_party/modp_b64",
]

defines = [ "U_COMMON_IMPLEMENTATION" ]

data_deps = [
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ namespace partition_alloc::internal::base {
// (https://chromium-review.googlesource.com/c/chromium/src/+/1545096) and land
// it or some form of it.
void RandBytes(void* output, size_t output_length) {
// TODO(b/298237462): Clean this up for Cobalt or don't use PA.
#if 0
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
// We have to call `getrandom` via Linux Syscall Support, rather than through
// the libc wrapper, because we might not have an up-to-date libc (e.g. on
// some bots).
Expand Down
2 changes: 0 additions & 2 deletions base/check_is_test_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
#include "base/check_is_test.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "base/test/allow_check_is_test_for_testing.h"

// Note: `base::AllowCheckIsTestForTesting` is being called in
// `base/test/launcher/unit_test_launcher.cc` before this test is run.
//
// Thus, `CHECK_IS_TEST()` will succeed.
TEST(CheckIsTest, Usage) {
base::test::AllowCheckIsTestForTesting();
CHECK_IS_TEST();
}
7 changes: 4 additions & 3 deletions base/i18n/time_formatting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ std::u16string DateIntervalFormat(const Time& begin_time,
UErrorCode status = U_ZERO_ERROR;

std::unique_ptr<icu::DateIntervalFormat> formatter(
/* Cobalt
icu::DateIntervalFormat::createInstance(DateFormatToString(format),
Cobalt */
#if defined(USE_HACKY_COBALT_CHANGES)
icu::DateIntervalFormat::createInstance(icu::UnicodeString(DateFormatToString(format)),
#else
icu::DateIntervalFormat::createInstance(DateFormatToString(format),
#endif
status));

icu::FieldPosition pos = 0;
Expand Down
2 changes: 2 additions & 0 deletions base/test/run_all_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@


#if defined(STARBOARD)
#include "base/test/allow_check_is_test_for_testing.h"
#include "starboard/client_porting/wrap_main/wrap_main.h"


int TestSuiteRun(int argc, char** argv) {
base::AtExitManager exit_manager;
base::test::AllowCheckIsTestForTesting();
return base::TestSuite(argc, argv).Run();
}

Expand Down
14 changes: 0 additions & 14 deletions net/base/network_change_notifier_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,10 @@ class NetworkChangeNotifierLinux::BlockingThreadObjects {
// Plumbing for NetworkChangeNotifier::GetCurrentConnectionType.
// Safe to call from any thread.
NetworkChangeNotifier::ConnectionType GetCurrentConnectionType() {
/* Cobalt
return address_tracker_.GetCurrentConnectionType();
Cobalt */
return NetworkChangeNotifier::ConnectionType::CONNECTION_UNKNOWN;
}

/* Cobalt
internal::AddressTrackerLinux* address_tracker() { return &address_tracker_; }
Cobalt */
internal::AddressTrackerLinux* address_tracker() { return nullptr; }

// Begin watching for netlink changes.
void Init();
Expand All @@ -50,17 +44,14 @@ Cobalt */
void OnIPAddressChanged();
void OnLinkChanged();
// Used to detect online/offline state and IP address changes.
/* Cobalt
internal::AddressTrackerLinux address_tracker_;
Cobalt */
NetworkChangeNotifier::ConnectionType last_type_ =
NetworkChangeNotifier::CONNECTION_NONE;
};

NetworkChangeNotifierLinux::BlockingThreadObjects::BlockingThreadObjects(
const std::unordered_set<std::string>& ignored_interfaces,
scoped_refptr<base::SequencedTaskRunner> blocking_thread_runner)
/* Cobalt
: address_tracker_(
base::BindRepeating(&NetworkChangeNotifierLinux::
BlockingThreadObjects::OnIPAddressChanged,
Expand All @@ -71,20 +62,15 @@ NetworkChangeNotifierLinux::BlockingThreadObjects::BlockingThreadObjects(
base::DoNothing(),
ignored_interfaces,
std::move(blocking_thread_runner)) {}
Cobalt */ {}

void NetworkChangeNotifierLinux::BlockingThreadObjects::Init() {
/* Cobalt
address_tracker_.Init();
Cobalt */
last_type_ = GetCurrentConnectionType();
}

void NetworkChangeNotifierLinux::BlockingThreadObjects::InitForTesting(
base::ScopedFD netlink_fd) {
/* Cobalt
address_tracker_.InitWithFdForTesting(std::move(netlink_fd)); // IN-TEST
Cobalt */
last_type_ = GetCurrentConnectionType();
}

Expand Down
3 changes: 0 additions & 3 deletions starboard/build/install/install_target.gni
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ template("install_target") {
copy("copy_" + target_name) {
forward_variables_from(invoker, [ "testonly" ])

# deps = []
# not_needed(invoker, [ "deps" ])

deps = invoker.deps
deps += [ installable_target_dep ]
sources = [ "$root_out_dir/$source_name" ]
Expand Down
2 changes: 1 addition & 1 deletion starboard/client_porting/eztime/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target(gtest_target_type, "eztime_test") {
]

data_deps = [
# "//cobalt/network:copy_ssl_certificates",
"//cobalt/network:copy_ssl_certificates",
"//third_party/icu:icudata",
]
}
2 changes: 1 addition & 1 deletion starboard/elf_loader/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if (current_toolchain == starboard_toolchain && !is_host_win) {
deps += [ "//third_party/crashpad/crashpad/wrapper:wrapper_stub" ]
}
if (sb_is_evergreen_compatible && sb_evergreen_compatible_package) {
# deps += [ "//starboard/loader_app:copy_crashpad_handler_named_as_so" ]
deps += [ "//starboard/loader_app:copy_crashpad_handler_named_as_so" ]
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions starboard/extension/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

target(gtest_target_type, "extension_test") {
testonly = true

# has_pedantic_warnings = true
has_pedantic_warnings = true
sources = [
"enhanced_audio_test.cc",
"extension_test.cc",
Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static_library("starboard_platform_sources") {

if (current_toolchain == starboard_toolchain) {
target(starboard_level_gtest_target_type, "starboard_platform_tests") {
# build_loader = false
build_loader = false
testonly = true

sources = media_tests_sources + player_tests_sources + [
Expand Down
11 changes: 0 additions & 11 deletions starboard/linux/x64x11/platform_configuration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@
# limitations under the License.

config("platform_configuration") {
libs = [
"X11",
"Xcomposite",
"Xrender",
]
libs += [
"asound",
"dl",
"pthread",
"rt",
]
configs = [
"//starboard/build/config/sabi",
"//starboard/linux/x64x11/shared/platform_configuration",
Expand Down
2 changes: 1 addition & 1 deletion starboard/nplb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ target(gtest_target_type, "nplb") {
}

data_deps = [
# "//cobalt/network:copy_ssl_certificates",
"//cobalt/network:copy_ssl_certificates",
"//starboard/nplb/testdata/file_tests:nplb_file_tests_data",
"//starboard/shared/starboard/player:player_download_test_data",
"//third_party/icu:icudata",
Expand Down
2 changes: 1 addition & 1 deletion starboard/nplb/nplb_evergreen_compat_tests/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ target(gtest_target_type, "nplb_evergreen_compat_tests") {
]

data_deps = [
# "//cobalt/network:copy_ssl_certificates",
"//cobalt/network:copy_ssl_certificates",
"//third_party/icu:icudata",
]
}
2 changes: 1 addition & 1 deletion starboard/raspi/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ group("starboard_platform") {
static_library("starboard_platform_sources") {
check_includes = false

# has_pedantic_warnings = true
has_pedantic_warnings = true

sources = [
"//starboard/linux/shared/atomic_public.h",
Expand Down
4 changes: 2 additions & 2 deletions starboard/shared/starboard/player/filter/tools/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if (current_toolchain == starboard_toolchain) {
target(starboard_level_final_executable_type, "audio_dmp_player") {
# build_loader = false
build_loader = false
sources = [ "audio_dmp_player.cc" ]
configs += [ "//starboard/build/config:starboard_implementation" ]
public_deps = [
Expand All @@ -24,7 +24,7 @@ if (current_toolchain == starboard_toolchain) {
"//starboard/shared/starboard/player:video_dmp",
]
data_deps = [
# "//cobalt/network:copy_ssl_certificates",
"//cobalt/network:copy_ssl_certificates",
"//starboard/shared/starboard/player:player_download_test_data",
"//third_party/icu:icudata",
]
Expand Down
2 changes: 1 addition & 1 deletion starboard/win/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ config("starboard_platform_config") {
}

static_library("starboard_platform") {
# has_pedantic_warnings = true
has_pedantic_warnings = true

sources = [
"//starboard/common/thread.cc",
Expand Down
2 changes: 1 addition & 1 deletion testing/perf/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1 +1 @@
group("perf") {}
group("perf") {}
4 changes: 2 additions & 2 deletions third_party/angle/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ angle_static_library("preprocessor") {
sources = angle_preprocessor_sources

if (is_starboard) {
# suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ]
suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ]
}

public_deps = [
Expand Down Expand Up @@ -518,7 +518,7 @@ angle_static_library("translator") {
public_configs += [ ":external_config" ]

if (is_starboard) {
# suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ]
suppressed_configs += [ "//starboard/build/config:warnings_as_errors" ]
}

deps = [
Expand Down
8 changes: 0 additions & 8 deletions third_party/boringssl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ if (!use_cobalt_customizations) {
configs -= [ "//starboard/build/config:size" ]
configs += [ "//starboard/build/config:speed" ]

# sources += boringssl_linux_x86_64_files
if (sb_is_modular) {
calling_convention = sabi_variables.calling_convention
if ((calling_convention != "aarch64" && calling_convention != "eabi" &&
Expand Down Expand Up @@ -501,10 +500,3 @@ if (build_with_chromium) {
seed_corpus = "src/fuzz/server_corpus_no_fuzzer_mode"
}
}

# group("boringssl") {
# all_dependent_configs = [ ":external_config" ]
# public_deps = [
# ":crypto"
# ]
# }
2 changes: 1 addition & 1 deletion third_party/crashpad/crashpad/client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static_library("client") {
deps = []

if (crashpad_is_in_starboard) {
# public_deps += [ "//starboard/elf_loader:evergreen_info" ]
public_deps += [ "//starboard/elf_loader:evergreen_info" ]
}
if (crashpad_is_in_starboard || crashpad_is_in_native_target_build) {
deps += [ "../wrapper/proto:crashpad_annotations_proto" ]
Expand Down
1 change: 0 additions & 1 deletion third_party/icu/source/common/ubrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ ubrk_open(UBreakIteratorType type,
// Invokes the rule builder.
//
//------------------------------------------------------------------------------
// static_assert(sizeof(UChar) == 0, "The type T must be an integral type!");
U_CAPI UBreakIterator* U_EXPORT2
ubrk_openRules( const UChar *rules,
int32_t rulesLength,
Expand Down
2 changes: 1 addition & 1 deletion third_party/icu/source/common/unicode/unistr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3153,7 +3153,7 @@ class U_COMMON_API UnicodeString : public Replaceable
*/
inline UnicodeString(std::nullptr_t buffer, int32_t buffLength, int32_t buffCapacity);

#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION || 1
#if U_CHARSET_IS_UTF8 || !UCONFIG_NO_CONVERSION

/**
* char* constructor.
Expand Down
2 changes: 1 addition & 1 deletion third_party/libxml/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,4 @@ if (!use_cobalt_customizations) {
include_dirs = [ "$os_include" ]
}

group("xml_reader") {}
group("xml_reader") {}
2 changes: 1 addition & 1 deletion third_party/llvm-project/libunwind/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ static_library("unwind_starboard") {

public_deps = [
"//starboard/common",
# "//starboard/elf_loader:evergreen_info",
"//starboard/elf_loader:evergreen_info",
]
}
6 changes: 3 additions & 3 deletions third_party/zlib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ component("zlib_hidden") {
} else {
sources += [
"arm_stub.c",
# "inflate.c",
"inflate.c",
]
}

Expand Down Expand Up @@ -541,8 +541,8 @@ target(gtest_target_type, "zip_unittests") {
testonly = true

sources = [
# "google/compression_utils_unittest.cc",
# "google/zip_reader_unittest.cc",
"google/compression_utils_unittest.cc",
"google/zip_reader_unittest.cc",
"google/zip_unittest.cc",
"google/compression_utils.cc",
"google/compression_utils.h",
Expand Down
Loading

0 comments on commit 104d3cf

Please sign in to comment.