alloy: Fix crash when requesting periodic-background-sync permission (fixes issue #3393)

This commit is contained in:
Marshall Greenblatt 2022-09-09 11:58:22 -04:00
parent 7e3b084819
commit 0089378a0a
1 changed files with 23 additions and 0 deletions

View File

@ -20,6 +20,29 @@ index 85b7da7f35c84..311211abf1b82 100644
DownloadRequestLimiter* limiter =
g_browser_process->download_request_limiter();
DCHECK(limiter);
diff --git chrome/browser/background_sync/periodic_background_sync_permission_context.cc chrome/browser/background_sync/periodic_background_sync_permission_context.cc
index 4741cec1f8a38..e657e26ea1544 100644
--- chrome/browser/background_sync/periodic_background_sync_permission_context.cc
+++ chrome/browser/background_sync/periodic_background_sync_permission_context.cc
@@ -6,6 +6,7 @@
#include "base/feature_list.h"
#include "build/build_config.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/installable/installable_utils.h"
#include "chrome/browser/profiles/profile.h"
@@ -94,6 +95,10 @@ PeriodicBackgroundSyncPermissionContext::GetPermissionStatusInternal(
return CONTENT_SETTING_ALLOW;
#endif
+ if (cef::IsAlloyRuntimeEnabled()) {
+ return CONTENT_SETTING_BLOCK;
+ }
+
bool can_bypass_install_requirement =
base::FeatureList::IsEnabled(
features::kPeriodicSyncPermissionForDefaultSearchEngine) &&
diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc
index 994b78d94de26..e51f6f6162f02 100644
--- chrome/browser/permissions/chrome_permissions_client.cc