From 6e8b5267ac22172b533753a47dfeb405a2dceea3 Mon Sep 17 00:00:00 2001 From: Garo Bournoutian Date: Mon, 20 May 2024 12:36:22 -0700 Subject: [PATCH 1/3] Remove compile-time config for extended IFA (#3301) b/334143349 (cherry picked from commit 0d8868819df97c3bec151c03e86ddb3a17e7ca95) --- cobalt/h5vcc/BUILD.gn | 3 +++ cobalt/h5vcc/h5vcc_system.cc | 15 ++++----------- cobalt/h5vcc/h5vcc_system.h | 4 ---- cobalt/h5vcc/h5vcc_system.idl | 4 ++-- .../docs/reference/starboard/gn-configuration.md | 3 +++ starboard/build/config/base_configuration.gni | 3 --- starboard/extension/ifa.h | 1 + 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/cobalt/h5vcc/BUILD.gn b/cobalt/h5vcc/BUILD.gn index 0c93294564e0..7fa912a0f39e 100644 --- a/cobalt/h5vcc/BUILD.gn +++ b/cobalt/h5vcc/BUILD.gn @@ -19,12 +19,15 @@ config("h5vcc_internal_config") { config("h5vcc_external_config") { defines = [] +<<<<<<< HEAD if (enable_account_manager) { defines += [ "COBALT_ENABLE_ACCOUNT_MANAGER" ] } if (enable_extended_ifa_in_h5vcc) { defines += [ "COBALT_ENABLE_EXTENDED_IFA" ] } +======= +>>>>>>> 0d8868819df (Remove compile-time config for extended IFA (#3301)) } static_library("h5vcc") { diff --git a/cobalt/h5vcc/h5vcc_system.cc b/cobalt/h5vcc/h5vcc_system.cc index a2644f11fcec..23baa7084653 100644 --- a/cobalt/h5vcc/h5vcc_system.cc +++ b/cobalt/h5vcc/h5vcc_system.cc @@ -42,7 +42,6 @@ H5vccSystem::H5vccSystem( task_runner_(base::ThreadTaskRunnerHandle::Get()), ifa_extension_(static_cast( SbSystemGetExtension(kStarboardExtensionIfaName))) { -#if defined(COBALT_ENABLE_EXTENDED_IFA) if (ifa_extension_ && ifa_extension_->version >= 2) { ifa_extension_->RegisterTrackingAuthorizationCallback( this, [](void* context) { @@ -53,15 +52,12 @@ H5vccSystem::H5vccSystem( } }); } -#endif // defined(COBALT_ENABLE_EXTENDED_IFA) } H5vccSystem::~H5vccSystem() { -#if defined(COBALT_ENABLE_EXTENDED_IFA) if (ifa_extension_ && ifa_extension_->version >= 2) { ifa_extension_->UnregisterTrackingAuthorizationCallback(); } -#endif // defined(COBALT_ENABLE_EXTENDED_IFA) } bool H5vccSystem::are_keys_reversed() const { @@ -132,12 +128,10 @@ bool H5vccSystem::limit_ad_tracking() const { return result; } -#if defined(COBALT_ENABLE_EXTENDED_IFA) - std::string H5vccSystem::tracking_authorization_status() const { - std::string result = "UNKNOWN"; - char property[kSystemPropertyMaxLength] = {0}; if (ifa_extension_ && ifa_extension_->version >= 2) { + std::string result = "UNKNOWN"; + char property[kSystemPropertyMaxLength] = {0}; if (!ifa_extension_->GetTrackingAuthorizationStatus( property, SB_ARRAY_SIZE_INT(property))) { DLOG(FATAL) @@ -145,8 +139,9 @@ std::string H5vccSystem::tracking_authorization_status() const { } else { result = property; } + return result; } - return result; + return "NOT_SUPPORTED"; } void H5vccSystem::ReceiveTrackingAuthorizationComplete() { @@ -194,8 +189,6 @@ script::HandlePromiseVoid H5vccSystem::RequestTrackingAuthorization( return promise; } -#endif // defined(COBALT_ENABLE_EXTENDED_IFA) - std::string H5vccSystem::region() const { // No region information. return ""; diff --git a/cobalt/h5vcc/h5vcc_system.h b/cobalt/h5vcc/h5vcc_system.h index d27699512a65..63a97cac4ee8 100644 --- a/cobalt/h5vcc/h5vcc_system.h +++ b/cobalt/h5vcc/h5vcc_system.h @@ -49,11 +49,9 @@ class H5vccSystem : public script::Wrappable { std::string version() const; std::string advertising_id() const; bool limit_ad_tracking() const; -#if defined(COBALT_ENABLE_EXTENDED_IFA) std::string tracking_authorization_status() const; script::HandlePromiseVoid RequestTrackingAuthorization( script::EnvironmentSettings* environment_settings); -#endif // defined(COBALT_ENABLE_EXTENDED_IFA) bool TriggerHelp() const; @@ -73,11 +71,9 @@ class H5vccSystem : public script::Wrappable { #endif scoped_refptr const task_runner_; const StarboardExtensionIfaApi* ifa_extension_; -#if defined(COBALT_ENABLE_EXTENDED_IFA) void ReceiveTrackingAuthorizationComplete(); std::vector> request_tracking_authorization_promises_; -#endif // defined(COBALT_ENABLE_EXTENDED_IFA) DISALLOW_COPY_AND_ASSIGN(H5vccSystem); }; diff --git a/cobalt/h5vcc/h5vcc_system.idl b/cobalt/h5vcc/h5vcc_system.idl index 62d120632c52..5630ea95be39 100644 --- a/cobalt/h5vcc/h5vcc_system.idl +++ b/cobalt/h5vcc/h5vcc_system.idl @@ -20,8 +20,8 @@ interface H5vccSystem { readonly attribute DOMString version; readonly attribute DOMString advertisingId; readonly attribute boolean limitAdTracking; - [Conditional=COBALT_ENABLE_EXTENDED_IFA] readonly attribute DOMString trackingAuthorizationStatus; - [Conditional=COBALT_ENABLE_EXTENDED_IFA, CallWith=EnvironmentSettings, NewObject] Promise requestTrackingAuthorization(); + readonly attribute DOMString trackingAuthorizationStatus; + [CallWith=EnvironmentSettings, NewObject] Promise requestTrackingAuthorization(); boolean triggerHelp(); // enum UserOnExitStrategy diff --git a/cobalt/site/docs/reference/starboard/gn-configuration.md b/cobalt/site/docs/reference/starboard/gn-configuration.md index e4e2b3df6e2a..a6c9cfda70a6 100644 --- a/cobalt/site/docs/reference/starboard/gn-configuration.md +++ b/cobalt/site/docs/reference/starboard/gn-configuration.md @@ -11,8 +11,11 @@ Book: /youtube/cobalt/_book.yaml | **`cobalt_platform_dependencies`**

List of platform-specific targets that get compiled into cobalt.

The default value is `[]`. | | **`cobalt_v8_emit_builtins_as_inline_asm`**

Some compiler can not compile with raw assembly(.S files) and v8 converts asm to inline assembly for these platforms.

The default value is `false`. | | **`default_renderer_options_dependency`**

Override this value to adjust the default rasterizer setting for your platform.

The default value is `"//cobalt/renderer:default_options"`. | +<<<<<<< HEAD | **`enable_account_manager`**

Set to true to enable H5vccAccountManager.

The default value is `false`. | | **`enable_extended_ifa_in_h5vcc`**

Set to true to enable extended IFA functionality in H5vccSystem.

The default value is `false`. | +======= +>>>>>>> 0d8868819df (Remove compile-time config for extended IFA (#3301)) | **`enable_in_app_dial`**

Enables or disables the DIAL server that runs inside Cobalt. Note: Only enable if there's no system-wide DIAL support.

The default value is `false`. | | **`executable_configs`**

Target-specific configurations for executable targets.

The default value is `[]`. | | **`final_executable_type`**

The target type for executable targets. Allows changing the target type on platforms where the native code may require an additional packaging step (ex. Android).

The default value is `"executable"`. | diff --git a/starboard/build/config/base_configuration.gni b/starboard/build/config/base_configuration.gni index 737aed570f54..9284dc5a8c89 100644 --- a/starboard/build/config/base_configuration.gni +++ b/starboard/build/config/base_configuration.gni @@ -175,9 +175,6 @@ declare_args() { # all unused symbols and nplb fails to link. # TODO: b/297808555 Remove this flag after nplb is fixed sb_has_unused_symbol_issue = false - - # Set to true to enable extended IFA functionality in H5vccSystem. - enable_extended_ifa_in_h5vcc = false } if (current_toolchain == starboard_toolchain && diff --git a/starboard/extension/ifa.h b/starboard/extension/ifa.h index 091fee9e5ca9..2ea427aff3e7 100644 --- a/starboard/extension/ifa.h +++ b/starboard/extension/ifa.h @@ -54,6 +54,7 @@ typedef struct StarboardExtensionIfaApi { // Returns the the user's authorization status for using IFA in this app. // Valid strings that can be returned are: + // * NOT_SUPPORTED - if this platform doesn't support this extension // * UNKNOWN - if the system isn't able to determine a status // * NOT_DETERMINED - the user hasn't made a decision yet // * RESTRICTED - the system doesn't allow the user a choice From 0b5c40bb984918d7615c74e5a15be8438ad2485c Mon Sep 17 00:00:00 2001 From: Garo Bournoutian Date: Mon, 20 May 2024 12:45:15 -0700 Subject: [PATCH 2/3] Update BUILD.gn --- cobalt/h5vcc/BUILD.gn | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cobalt/h5vcc/BUILD.gn b/cobalt/h5vcc/BUILD.gn index 7fa912a0f39e..cd17423dd93b 100644 --- a/cobalt/h5vcc/BUILD.gn +++ b/cobalt/h5vcc/BUILD.gn @@ -19,15 +19,9 @@ config("h5vcc_internal_config") { config("h5vcc_external_config") { defines = [] -<<<<<<< HEAD if (enable_account_manager) { defines += [ "COBALT_ENABLE_ACCOUNT_MANAGER" ] } - if (enable_extended_ifa_in_h5vcc) { - defines += [ "COBALT_ENABLE_EXTENDED_IFA" ] - } -======= ->>>>>>> 0d8868819df (Remove compile-time config for extended IFA (#3301)) } static_library("h5vcc") { From 2c3c994362f24e7005e21fa41419c62673b29555 Mon Sep 17 00:00:00 2001 From: Garo Bournoutian Date: Mon, 20 May 2024 12:46:04 -0700 Subject: [PATCH 3/3] Update gn-configuration.md --- cobalt/site/docs/reference/starboard/gn-configuration.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cobalt/site/docs/reference/starboard/gn-configuration.md b/cobalt/site/docs/reference/starboard/gn-configuration.md index a6c9cfda70a6..7675560a5b7b 100644 --- a/cobalt/site/docs/reference/starboard/gn-configuration.md +++ b/cobalt/site/docs/reference/starboard/gn-configuration.md @@ -11,11 +11,7 @@ Book: /youtube/cobalt/_book.yaml | **`cobalt_platform_dependencies`**

List of platform-specific targets that get compiled into cobalt.

The default value is `[]`. | | **`cobalt_v8_emit_builtins_as_inline_asm`**

Some compiler can not compile with raw assembly(.S files) and v8 converts asm to inline assembly for these platforms.

The default value is `false`. | | **`default_renderer_options_dependency`**

Override this value to adjust the default rasterizer setting for your platform.

The default value is `"//cobalt/renderer:default_options"`. | -<<<<<<< HEAD | **`enable_account_manager`**

Set to true to enable H5vccAccountManager.

The default value is `false`. | -| **`enable_extended_ifa_in_h5vcc`**

Set to true to enable extended IFA functionality in H5vccSystem.

The default value is `false`. | -======= ->>>>>>> 0d8868819df (Remove compile-time config for extended IFA (#3301)) | **`enable_in_app_dial`**

Enables or disables the DIAL server that runs inside Cobalt. Note: Only enable if there's no system-wide DIAL support.

The default value is `false`. | | **`executable_configs`**

Target-specific configurations for executable targets.

The default value is `[]`. | | **`final_executable_type`**

The target type for executable targets. Allows changing the target type on platforms where the native code may require an additional packaging step (ex. Android).

The default value is `"executable"`. |