Skip to content

Commit

Permalink
Fix expressions 2 (#526)
Browse files Browse the repository at this point in the history
* Squashed 'components/version_info/' content from commit 737f4cc3d914

git-subtree-dir: components/version_info
git-subtree-split: 737f4cc3d91409d092991dc6834788b9e4c5613a

* Squashed 'extensions/buildflags/' content from commit 835b1103d31b

git-subtree-dir: extensions/buildflags
git-subtree-split: 835b1103d31bdb8a2df943e3c837099a79e930ad

* Whitespace to trigger bots

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ib15dd68154821b937d2b28f62411ba09b88e0b39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2050235
Reviewed-by: Liviu Rau <[email protected]>
git-subtree-dir: third_party/devtools
git-subtree-split: 0d4095e47ca0e972e04efecf7772a8d12b60c665

* [XB1] Fix missing data for YouTubeTV (#1619)

b/299524777

Change-Id: Iec9da5b0417b15385ec338943826dce05045bbad

* Remove debug info from non-production CI builds (#1621)

b/301163476

Remove "-g" for devel, debug CI builds - this helps reduce binary sizes
on CI while not affecting debug info locally.

Add "-gline-tables-only" for older windows platforms to get debuggable
info locally and in production.

* Filter intermittent blackbox test cases (#1487)

b/291648592

* [media] Support string parameter in h5vcc::Settings (#1602)

1. Allow string input in H5vccSettings::Set.
2. Rename DisableMediaCodec to MediaCodecBlockList.
3. Block only the codecs in the list based on string matching.
4. MediaCodecBlockList blocks only string input separated by semicolon.
If it is empty string, it allows all codecs. Examples are:
    // "av01": block only av1 codec
    // "avc1;avc3": block only h264 codec
    // "vp09;vp9": block only vp9 codec
    // "": allow all codecs

b/300950119

* [XB1] Add backup version of win sdk (#1626)

Adds check to see if the newer version of the win sdk is available
before attempting to run makeappx and signtool, then falls back to
10.0.22000.0 if 10.0.22621.0 isn't found.

b/299672207

Change-Id: I2e9ed373a940c30367aa095ff2a254ec5232dd83

* Add SetTimeZone API as a starboard extension (#1615)

In order to test SbTimeZoneGetCurrent(), we need to set a time zone
first. Here we add a new time zone API as a starboard extension to set
time zone. We start with Linux implementation. Will have follow up PR to
add implementations for all first party platforms. This will help catch
the issue if a platform forget to implement SbTimeZoneGetCurrent() which
always return 0.

b/300108997

* [android] Add SB version guards (#1607)

b/284140486

* Create MUSL specific-rename of finalize and atexit (#1588)

These functions are given alternative signatures to avoid symbol
collision during linking of modular-toolchain versions of the NX
platform. During build, we will pass these defines via the toolchain
definition to switch the names over as desired.

b/246855300

* [Watchdog] Increase max ping count and length. (#1613)

Increase max ping count from 20 to 60 and max ping length from 128 to
1024.

b/301313509

* Publish DEPS for Chromium 48.0.2564.116

git-subtree-dir: third_party/harfbuzz-ng
git-subtree-split: ba6eb95383b3c41f6b91ce448bdc2bd3e39e1b8b

* Increase the timeout for XB1 Net Args service (#1634)

b/299672207

* Publish DEPS for Chromium 54.0.2840.101

git-subtree-dir: third_party/jinja2
git-subtree-split: 80c41737f982b17b0c5e7c9cb05dfbfde366be15

* [XB1] Fix DX memory leak while suspend/resume (#1475)

b/298967828

Change-Id: Ibbf739aac23401622b2751a0f0f3af3f169457db

* Add SetTimeZone API for Raspi (#1633)

b/300108997

* [android] Avoid using uninitialized drm system (#1557)

b/299150189

* Add missing cstdint includes (#1643)

* [XB1] Refactor test retry loop to rerun net_args (#1647)

b/299672207

Change-Id: Ic90a8805fa9bc6ec7a99ffe55c318f44b82f85cb

* Update games-activity to version 2.0.2. (#1614)

This updates games-activity from version 1.2.2. to version 2.0.2.

b/302378452

* Add platform RDK to launcher framework (#1547)

Added launcher infrastructure for AH212 RDK (v5) as independent RDK
platform.

b/293172465

* Enable platform-specific sources to compile loader (#1652)

The loader app (for modular toolchain builds) currently only relies on
starboard_loader.cc as the source. For NX, we require additional
sources, and those can be provided by setting the value of the newly
added variable extra_platform_loader_sources in the configuration.gni
file for that platform.

b/246855300

* Cleanup video_stream_ & audio_stream_ after demuxer_ stops (#1651)

Native crash due to fault address of video_stream_, cleanup
video_stream_ & audio_stream_ after demuxer_ stops.

b/301284907

* Comment on cherry pick PR on failure (#524)

b/301453749

* Fix expressions

* Revert "Fix expressions"

This reverts commit 4d01e44.

* Fix expressions 2

* REMO

* REMOVE_ME remove checks

* Fix cp command

---------

Co-authored-by: Brian Ting <[email protected]>
Co-authored-by: Liviu Rau <[email protected]>
Co-authored-by: Dana Dahlstrom <[email protected]>
Co-authored-by: Tyler Holcombe <[email protected]>
Co-authored-by: Niranjan Yardi <[email protected]>
Co-authored-by: Max Zhang <[email protected]>
Co-authored-by: Bo-Rong Chen <[email protected]>
Co-authored-by: Sherry Zhou <[email protected]>
Co-authored-by: Jason <[email protected]>
Co-authored-by: Arjun Menon <[email protected]>
Co-authored-by: chrome-tpm <[email protected]>
Co-authored-by: chrome-cron <[email protected]>
Co-authored-by: victorpasoshnikov <[email protected]>
Co-authored-by: Andrew Savage <[email protected]>
Co-authored-by: Jelle Foks <[email protected]>
  • Loading branch information
16 people authored Sep 29, 2023
1 parent 0f16a89 commit 8de5c93
Show file tree
Hide file tree
Showing 515 changed files with 30,995 additions and 19,204 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/label-cherry-pick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ jobs:
set -e
git fetch origin ${{ matrix.target_branch }}
git cherry-pick -x $MERGE_COMMIT_SHA
git add .
git cherry-pick --continue
RES=$?
set -e
if [ $RES -ne 0 ]; then
git add .
git cherry-pick --continue
fi
exit $RES
- name: Create Pull Request
id: create-pr
Expand Down
48 changes: 20 additions & 28 deletions cobalt/h5vcc/h5vcc_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@
namespace cobalt {
namespace h5vcc {

namespace {
// Only including needed video combinations for the moment.
// option 0 disables all video codecs except h264
// option 1 disables all video codecs except av1
// option 2 disables all video codecs except vp9
constexpr std::array<const char*, 3> kDisableCodecCombinations{
{"av01;hev1;hvc1;vp09;vp8.vp9", "avc1;avc3;hev1;hvc1;vp09;vp8;vp9",
"av01;avc1;avc3;hev1;hvc1;vp8"}};
}; // namespace

H5vccSettings::H5vccSettings(
const SetSettingFunc& set_web_setting_func,
cobalt::media::MediaModule* media_module,
Expand All @@ -56,9 +46,9 @@ H5vccSettings::H5vccSettings(
persistent_settings_(persistent_settings) {
}

bool H5vccSettings::Set(const std::string& name, int32 value) const {
bool H5vccSettings::Set(const std::string& name, SetValueType value) const {
const char kMediaPrefix[] = "Media.";
const char kDisableMediaCodec[] = "DisableMediaCodec";
const char kMediaCodecBlockList[] = "MediaCodecBlockList";
const char kNavigatorUAData[] = "NavigatorUAData";
const char kClientHintHeaders[] = "ClientHintHeaders";
const char kQUIC[] = "QUIC";
Expand All @@ -67,35 +57,37 @@ bool H5vccSettings::Set(const std::string& name, int32 value) const {
const char kUpdaterMinFreeSpaceBytes[] = "Updater.MinFreeSpaceBytes";
#endif

if (name == kDisableMediaCodec &&
value < static_cast<int32>(kDisableCodecCombinations.size())) {
can_play_type_handler_->SetDisabledMediaCodecs(
kDisableCodecCombinations[value]);
if (name == kMediaCodecBlockList && value.IsType<std::string>() &&
value.AsType<std::string>().size() < 256) {
can_play_type_handler_->SetDisabledMediaCodecs(value.AsType<std::string>());
return true;
}

if (set_web_setting_func_ && set_web_setting_func_.Run(name, value)) {
if (set_web_setting_func_ && value.IsType<int32>() &&
set_web_setting_func_.Run(name, value.AsType<int32>())) {
return true;
}

if (name.rfind(kMediaPrefix, 0) == 0) {
return media_module_ ? media_module_->SetConfiguration(
name.substr(strlen(kMediaPrefix)), value)
: false;
if (name.rfind(kMediaPrefix, 0) == 0 && value.IsType<int32>()) {
return media_module_
? media_module_->SetConfiguration(
name.substr(strlen(kMediaPrefix)), value.AsType<int32>())
: false;
}

if (name.compare(kNavigatorUAData) == 0 && value == 1) {
if (name.compare(kNavigatorUAData) == 0 && value.IsType<int32>() &&
value.AsType<int32>() == 1) {
global_environment_->BindTo("userAgentData", user_agent_data_, "navigator");
return true;
}

if (name.compare(kClientHintHeaders) == 0) {
if (name.compare(kClientHintHeaders) == 0 && value.IsType<int32>()) {
if (!persistent_settings_) {
return false;
} else {
persistent_settings_->SetPersistentSetting(
network::kClientHintHeadersEnabledPersistentSettingsKey,
std::make_unique<base::Value>(value));
std::make_unique<base::Value>(value.AsType<int32>()));
// Tell NetworkModule (if exists) to re-query persistent settings.
if (network_module_) {
network_module_
Expand All @@ -105,13 +97,13 @@ bool H5vccSettings::Set(const std::string& name, int32 value) const {
}
}

if (name.compare(kQUIC) == 0) {
if (name.compare(kQUIC) == 0 && value.IsType<int32>()) {
if (!persistent_settings_) {
return false;
} else {
persistent_settings_->SetPersistentSetting(
network::kQuicEnabledPersistentSettingsKey,
std::make_unique<base::Value>(value != 0));
std::make_unique<base::Value>(value.AsType<int32>() != 0));
// Tell NetworkModule (if exists) to re-query persistent settings.
if (network_module_) {
network_module_->SetEnableQuicFromPersistentSettings();
Expand All @@ -121,8 +113,8 @@ bool H5vccSettings::Set(const std::string& name, int32 value) const {
}

#if SB_IS(EVERGREEN)
if (name.compare(kUpdaterMinFreeSpaceBytes) == 0) {
updater_module_->SetMinFreeSpaceBytes(value);
if (name.compare(kUpdaterMinFreeSpaceBytes) == 0 && value.IsType<int32>()) {
updater_module_->SetMinFreeSpaceBytes(value.AsType<int32>());
return true;
}
#endif
Expand Down
5 changes: 4 additions & 1 deletion cobalt/h5vcc/h5vcc_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "cobalt/network/network_module.h"
#include "cobalt/persistent_storage/persistent_settings.h"
#include "cobalt/script/global_environment.h"
#include "cobalt/script/union_type.h"
#include "cobalt/script/wrappable.h"
#include "cobalt/web/navigator_ua_data.h"

Expand All @@ -39,6 +40,8 @@ class H5vccSettings : public script::Wrappable {
typedef base::Callback<bool(const std::string& name, int value)>
SetSettingFunc;

typedef script::UnionType2<int32, std::string> SetValueType;

H5vccSettings(const SetSettingFunc& set_web_setting_func,
cobalt::media::MediaModule* media_module,
cobalt::media::CanPlayTypeHandler* can_play_type_handler,
Expand All @@ -53,7 +56,7 @@ class H5vccSettings : public script::Wrappable {
// Returns true when the setting is set successfully or if the setting has
// already been set to the expected value. Returns false when the setting is
// invalid or not set to the expected value.
bool Set(const std::string& name, int32 value) const;
bool Set(const std::string& name, SetValueType value) const;

DEFINE_WRAPPABLE_TYPE(H5vccSettings);

Expand Down
2 changes: 1 addition & 1 deletion cobalt/h5vcc/h5vcc_settings.idl
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
// limitations under the License.

interface H5vccSettings {
boolean set(DOMString name, long value);
boolean set(DOMString name, (long or DOMString) value);
};
4 changes: 4 additions & 0 deletions cobalt/media/base/sbplayer_pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ void SbPlayerPipeline::Stop(const base::Closure& stop_cb) {
if (demuxer_) {
stop_cb_ = stop_cb;
demuxer_->Stop();
video_stream_ = nullptr;
audio_stream_ = nullptr;
OnDemuxerStopped();
} else {
stop_cb.Run();
Expand Down Expand Up @@ -1371,6 +1373,8 @@ void SbPlayerPipeline::ResumeTask(PipelineWindow window,

std::string SbPlayerPipeline::AppendStatisticsString(
const std::string& message) const {
DCHECK(task_runner_->BelongsToCurrentThread());

if (nullptr == video_stream_) {
return message + ", playback statistics: n/a.";
} else {
Expand Down
4 changes: 2 additions & 2 deletions cobalt/watchdog/watchdog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const int kWatchdogMaxViolations = 200;
// The minimum number of microseconds between writes.
const int64_t kWatchdogWriteWaitTime = 300000000;
// The maximum number of most recent ping infos.
const int kWatchdogMaxPingInfos = 20;
const int kWatchdogMaxPingInfos = 60;
// The maximum length of each ping info.
const int kWatchdogMaxPingInfoLength = 128;
const int kWatchdogMaxPingInfoLength = 1024;
// The maximum number of milliseconds old of an unfetched Watchdog violation.
const int64_t kWatchdogMaxViolationsAge = 86400000;

Expand Down
16 changes: 4 additions & 12 deletions cobalt/watchdog/watchdog_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ TEST_F(WatchdogTest, PingOnlyAcceptsValidParameters) {
base::kApplicationStateStarted,
kWatchdogMonitorFrequency));
ASSERT_TRUE(watchdog_->Ping("test-name", "42"));
ASSERT_FALSE(
watchdog_->Ping("test-name",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxx"));
ASSERT_FALSE(watchdog_->Ping("test-name", std::string(1025, 'x')));
ASSERT_TRUE(watchdog_->Unregister("test-name"));
}

Expand All @@ -213,11 +209,7 @@ TEST_F(WatchdogTest, PingByClientOnlyAcceptsValidParameters) {
kWatchdogMonitorFrequency);
ASSERT_NE(client, nullptr);
ASSERT_TRUE(watchdog_->PingByClient(client, "42"));
ASSERT_FALSE(watchdog_->PingByClient(
client,
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"xxxxxxxxxxxxxxxxxxxxxxxxxxx"));
ASSERT_FALSE(watchdog_->PingByClient(client, std::string(1025, 'x')));
ASSERT_TRUE(watchdog_->UnregisterByClient(client));
}

Expand Down Expand Up @@ -358,7 +350,7 @@ TEST_F(WatchdogTest, PingInfosAreEvictedAfterMax) {
ASSERT_TRUE(watchdog_->Register("test-name", "test_desc",
base::kApplicationStateStarted,
kWatchdogMonitorFrequency));
for (int i = 0; i < 21; i++) {
for (int i = 0; i < 61; i++) {
ASSERT_TRUE(watchdog_->Ping("test-name", std::to_string(i)));
}
SbThreadSleep(kWatchdogSleepDuration);
Expand All @@ -369,7 +361,7 @@ TEST_F(WatchdogTest, PingInfosAreEvictedAfterMax) {
base::Value* violation_dict = violations_map->FindKey("test-name");
base::Value* violations = violation_dict->FindKey("violations");
base::Value* pingInfos = violations->GetList()[0].FindKey("pingInfos");
ASSERT_EQ(pingInfos->GetList().size(), 20);
ASSERT_EQ(pingInfos->GetList().size(), 60);
ASSERT_EQ(pingInfos->GetList()[0].FindKey("info")->GetString(), "1");
ASSERT_TRUE(watchdog_->Unregister("test-name"));
}
Expand Down
50 changes: 24 additions & 26 deletions components/version_info/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import("//build/config/chrome_build.gni")
import("//build/util/lastchange.gni")
import("//build/util/process_version.gni")
if (!use_cobalt_customizations) {
import("//chrome/process_version_rc_template.gni") # For branding_file_path.
import("//chrome/process_version_rc_template.gni") # For branding_file_path.
}

declare_args() {
Expand All @@ -24,13 +24,11 @@ static_library("version_info") {
"//base",
]


public_deps = [
":generate_version_info",
":channel",
]


if (is_starboard) {
sources += [
"starboard_version_info_values.h"
Expand All @@ -49,24 +47,24 @@ static_library("version_info") {
}

if (!use_cobalt_customizations) {
# Isolate the //ui/base dependency in this target.
static_library("version_string") {
sources = [
"version_string.cc",
"version_string.h",
]
# Isolate the //ui/base dependency in this target.
static_library("version_string") {
sources = [
"version_string.cc",
"version_string.h",
]

deps = [
":version_info",
"//components/strings",
]
deps = [
":version_info",
"//components/strings",
]

if (use_unofficial_version_number) {
defines = [ "USE_UNOFFICIAL_VERSION_NUMBER" ]
deps += [ "//ui/base" ]
}
if (use_unofficial_version_number) {
defines = [ "USE_UNOFFICIAL_VERSION_NUMBER" ]
deps += [ "//ui/base" ]
}
}
}

source_set("channel") {
sources = [
Expand All @@ -75,13 +73,13 @@ source_set("channel") {
}

if (!use_cobalt_customizations) {
process_version("generate_version_info") {
template_file = "version_info_values.h.version"
sources = [
"//chrome/VERSION",
branding_file_path,
lastchange_file,
]
output = "$target_gen_dir/version_info_values.h"
}
process_version("generate_version_info") {
template_file = "version_info_values.h.version"
sources = [
"//chrome/VERSION",
branding_file_path,
lastchange_file,
]
output = "$target_gen_dir/version_info_values.h"
}
}
5 changes: 2 additions & 3 deletions components/version_info/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ third_party {
}
url {
type: GIT
value: "https://github.com/chromium/chromium"
value: "https://chromium.googlesource.com/chromium/src"
}
# Closest commit hash to m70.
version: "737f4cc3d91409d092991dc6834788b9e4c5613a"
version: "71.0.3578.127"
last_upgrade_date {
year: 2018
month: 08
Expand Down
5 changes: 2 additions & 3 deletions extensions/buildflags/METADATA
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ third_party {
}
url {
type: GIT
value: "https://github.com/chromium/chromium"
value: "https://chromium.googlesource.com/chromium/src"
}
# Closest commit hash to m70.
version: "835b1103d31bdb8a2df943e3c837099a79e930ad"
version: "80.0.3987.162"
last_upgrade_date {
year: 2018
month: 03
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions starboard/android/arm/cobalt/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
'service_worker_persist_test',
'deep_links',
'web_platform_tests',
'persistent_cookie',
],
}

Expand Down
5 changes: 4 additions & 1 deletion starboard/android/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ import("//starboard/shared/starboard/player/player_tests.gni")
# Configuration to extract GameActivity native files.
##########################################################

game_activity_aar_file = "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-1.2.2.aar"
game_activity_aar_file = "//starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-2.0.2.aar"

game_activity_source_files = [
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-activity/GameActivity.cpp",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-activity/GameActivity.h",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-activity/GameActivityEvents.cpp",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-activity/GameActivityEvents.h",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-activity/GameActivityLog.h",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-text-input/gamecommon.h",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-text-input/gametextinput.cpp",
"$target_gen_dir/game_activity/prefab/modules/game-activity/include/game-text-input/gametextinput.h",
Expand Down
6 changes: 6 additions & 0 deletions starboard/android/shared/media_capabilities_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ constexpr int TYPE_USB_HEADSET = 22;
constexpr int TYPE_WIRED_HEADPHONES = 4;
constexpr int TYPE_WIRED_HEADSET = 3;

#if SB_API_VERSION >= 15
SbMediaAudioConnector GetConnectorFromAndroidOutputType(
int android_output_device_type) {
switch (android_output_device_type) {
Expand Down Expand Up @@ -145,6 +146,7 @@ SbMediaAudioConnector GetConnectorFromAndroidOutputType(
<< android_output_device_type;
return kSbMediaAudioConnectorUnknown;
}
#endif // SB_API_VERSION >= 15

bool EndsWith(const std::string& str, const std::string& suffix) {
if (str.size() < suffix.size()) {
Expand Down Expand Up @@ -267,8 +269,12 @@ bool GetAudioConfiguration(int index,
return env->CallIntMethodOrAbort(j_output_device_info.Get(), name, "()I");
};

#if SB_API_VERSION >= 15
configuration->connector =
GetConnectorFromAndroidOutputType(call_int_method("getType"));
#else // SB_API_VERSION >= 15
configuration->connector = kSbMediaAudioConnectorHdmi;
#endif // SB_API_VERSION >= 15
configuration->latency = 0;
configuration->coding_type = kSbMediaAudioCodingTypePcm;
configuration->number_of_channels = call_int_method("getChannels");
Expand Down
Loading

0 comments on commit 8de5c93

Please sign in to comment.