Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expressions 2 #526

Merged
merged 42 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
714e3f2
Squashed 'components/version_info/' content from commit 737f4cc3d914
briantting May 3, 2023
1e77571
Squashed 'extensions/buildflags/' content from commit 835b1103d31b
briantting May 3, 2023
761789b
Whitespace to trigger bots
Feb 11, 2020
0cfe2c0
Merge commit '714e3f205f60300799ecf24cad5ca6a53ab402b8' as 'component…
briantting May 3, 2023
8a492e7
Restore squash commit 714e3f20 (version_info)
dahlstrom-g Sep 22, 2023
3d20006
[XB1] Fix missing data for YouTubeTV (#1619)
TyHolc Sep 22, 2023
7390786
Remove debug info from non-production CI builds (#1621)
niranjanyardi Sep 22, 2023
6fcf7ab
Filter intermittent blackbox test cases (#1487)
maxz-lab Sep 22, 2023
0957f39
[media] Support string parameter in h5vcc::Settings (#1602)
borongc Sep 22, 2023
807f1d2
[XB1] Add backup version of win sdk (#1626)
TyHolc Sep 22, 2023
84a2eca
Add SetTimeZone API as a starboard extension (#1615)
sherryzy Sep 25, 2023
eb68451
[android] Add SB version guards (#1607)
jasonzhangxx Sep 25, 2023
2946b47
Create MUSL specific-rename of finalize and atexit (#1588)
arjungm Sep 25, 2023
8137d3f
[Watchdog] Increase max ping count and length. (#1613)
briantting Sep 25, 2023
41775d8
Publish DEPS for Chromium 48.0.2564.116
Feb 18, 2016
3c048ce
Increase the timeout for XB1 Net Args service (#1634)
arjungm Sep 25, 2023
f9c2e36
Merge commit '1e77571016b9c0ba065959f8fd0713a78f60dc2b' as 'extension…
briantting May 3, 2023
63ff6bf
Update third_party/devtools to 80.0.3987.162
dahlstrom-g Sep 21, 2023
350c8b1
Restore squash commit 1e775710 (buildflags)
dahlstrom-g Sep 26, 2023
af071fa
Update third_party/devtools to 80.0.3987.162
dahlstrom-g Sep 26, 2023
309521b
Publish DEPS for Chromium 54.0.2840.101
Nov 15, 2016
d9aa0ca
[XB1] Fix DX memory leak while suspend/resume (#1475)
victorpasoshnikov Sep 26, 2023
8fbc419
Add SetTimeZone API for Raspi (#1633)
sherryzy Sep 26, 2023
816489d
Add squash commit for third_party/harfbuzz-ng
dahlstrom-g Sep 25, 2023
2bc8721
Add squash commit for third_party/jinja2
dahlstrom-g Sep 26, 2023
3b0b683
Add squash commit for third_party/harfbuzz-ng
dahlstrom-g Sep 27, 2023
6994815
Add squash commit for third_party/jinja2
dahlstrom-g Sep 27, 2023
e5b95b8
[android] Avoid using uninitialized drm system (#1557)
jasonzhangxx Sep 27, 2023
0010204
Add missing cstdint includes (#1643)
andrewsavage1 Sep 27, 2023
03aa6b7
[XB1] Refactor test retry loop to rerun net_args (#1647)
TyHolc Sep 27, 2023
eb36d7c
Update games-activity to version 2.0.2. (#1614)
jellefoks Sep 27, 2023
477b864
Add platform RDK to launcher framework (#1547)
maxz-lab Sep 28, 2023
e78a6bc
Enable platform-specific sources to compile loader (#1652)
arjungm Sep 28, 2023
4c8a0fe
Cleanup video_stream_ & audio_stream_ after demuxer_ stops (#1651)
borongc Sep 28, 2023
1b6ada6
Comment on cherry pick PR on failure (#524)
oxve Sep 21, 2023
7819bed
Fix expressions
oxve Sep 22, 2023
912cbc2
Revert "Fix expressions"
oxve Sep 22, 2023
46a7cc1
Fix expressions 2
oxve Sep 22, 2023
95f2641
REMO
oxve Sep 22, 2023
41830d1
REMOVE_ME remove checks
oxve Sep 22, 2023
c5c6541
Fix cp command
oxve Sep 22, 2023
d3ae668
Merge branch 'main' into oxv/cp-change-2
oxve Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading