Skip to content

Commit

Permalink
Cherry pick PR #3339: Add back --disable_updater_module flag for SB<16 (
Browse files Browse the repository at this point in the history
#3349)

Refer to the original PR: #3339

b/341095156

Change-Id: I6293c8effabd72e41b39839ba802adcba25f8a73

Co-authored-by: yuying-y <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and yuying-y authored May 24, 2024
1 parent 275126b commit 533a741
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cobalt/browser/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,12 @@ Application::Application(const base::Closure& quit_closure, bool should_preload,
AddCrashHandlerAnnotations(platform_info);

#if SB_IS(EVERGREEN)
#if SB_API_VERSION < 16
if (SbSystemGetExtension(kCobaltExtensionInstallationManagerName) &&
!command_line->HasSwitch(switches::kDisableUpdaterModule)) {
#else
if (SbSystemGetExtension(kCobaltExtensionInstallationManagerName)) {
#endif
uint64_t update_check_delay_sec =
cobalt::updater::kDefaultUpdateCheckDelaySeconds;
if (command_line->HasSwitch(browser::switches::kUpdateCheckDelaySeconds)) {
Expand Down
11 changes: 11 additions & 0 deletions cobalt/browser/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ const char kDisableTimerResolutionLimitHelp[] =
"removed and the resolution will be 1us (or larger depending on the "
"platform.";

#if SB_API_VERSION < 16
const char kDisableUpdaterModule[] = "disable_updater_module";
const char kDisableUpdaterModuleHelp[] =
"Disables the Cobalt Evergreen UpdaterModule which is responsible for "
"downloading and installing new Cobalt updates. Passing the flag is "
"equivalent to opting out from further updates.";
#endif

const char kEncodedImageCacheSizeInBytes[] =
"encoded_image_cache_size_in_bytes";
const char kEncodedImageCacheSizeInBytesHelp[] =
Expand Down Expand Up @@ -473,6 +481,9 @@ std::string HelpMessage() {
{kDisableJavaScriptJit, kDisableJavaScriptJitHelp},
{kDisableMapToMesh, kDisableMapToMeshHelp},
{kDisableTimerResolutionLimit, kDisableTimerResolutionLimitHelp},
#if SB_API_VERSION < 16
{kDisableUpdaterModule, kDisableUpdaterModuleHelp},
#endif
{kEncodedImageCacheSizeInBytes, kEncodedImageCacheSizeInBytesHelp},
{kForceMigrationForStoragePartitioning,
kForceMigrationForStoragePartitioningHelp},
Expand Down
4 changes: 4 additions & 0 deletions cobalt/browser/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ extern const char kDisableMapToMesh[];
extern const char kDisableMapToMeshHelp[];
extern const char kDisableTimerResolutionLimit[];
extern const char kDisableTimerResolutionLimitHelp[];
#if SB_API_VERSION < 16
extern const char kDisableUpdaterModule[];
extern const char kDisableUpdaterModuleHelp[];
#endif
extern const char kEncodedImageCacheSizeInBytes[];
extern const char kEncodedImageCacheSizeInBytesHelp[];
extern const char kForceMigrationForStoragePartitioning[];
Expand Down

0 comments on commit 533a741

Please sign in to comment.