Skip to content

Commit

Permalink
Rebase to v132 (#1724)
Browse files Browse the repository at this point in the history
Rebase to v132
  • Loading branch information
uazo authored Jan 9, 2025
2 parents 6398702 + fed3139 commit 8dc7a7f
Show file tree
Hide file tree
Showing 219 changed files with 3,041 additions and 2,662 deletions.
2 changes: 1 addition & 1 deletion build/RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
131.0.6778.205
132.0.6834.83
1 change: 0 additions & 1 deletion build/cromite_patches_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ Add-flag-to-disable-vibration.patch
mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
Client-hints-overrides.patch
Allow-building-without-enable_reporting.patch
Disable-lock-icon-in-address-bar-by-default.patch
Experimental-user-scripts-support.patch
Keep-empty-tabs-between-sessions.patch
Disable-third-party-origin-trials.patch
Expand Down
16 changes: 8 additions & 8 deletions build/patches/AImageReader-CFI-crash-mitigations.patch
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ diff --git a/base/android/android_image_reader_compat.h b/base/android/android_i
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -3408,6 +3408,10 @@
@@ -3290,6 +3290,10 @@
"name": "enable-identity-in-auth-error",
"owners": [ "[email protected]", "[email protected]" ],
"expiry_milestone": 135
Expand Down Expand Up @@ -145,7 +145,7 @@ diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_lis
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -53,6 +53,11 @@ BASE_FEATURE(kUseGles2ForOopR,
@@ -59,6 +59,11 @@ BASE_FEATURE(kAggressiveShaderCacheLimits,
base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_ANDROID)
Expand All @@ -160,9 +160,9 @@ diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
--- a/gpu/config/gpu_finch_features.h
+++ b/gpu/config/gpu_finch_features.h
@@ -24,6 +24,7 @@ GPU_EXPORT BASE_DECLARE_FEATURE(kUseGles2ForOopR);
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
@@ -26,6 +26,7 @@ GPU_EXPORT BASE_DECLARE_FEATURE(kUseGles2ForOopR);
GPU_EXPORT BASE_DECLARE_FEATURE(kAggressiveShaderCacheLimits);

#if BUILDFLAG(IS_ANDROID)
+GPU_EXPORT BASE_DECLARE_FEATURE(kAImageReaderMediaPlayer);
GPU_EXPORT BASE_DECLARE_FEATURE(kAndroidSurfaceControl);
Expand All @@ -171,7 +171,7 @@ diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -126,6 +126,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
@@ -125,6 +125,9 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
#if !BUILDFLAG(IS_ANDROID)
return kGpuFeatureStatusDisabled;
#else
Expand All @@ -181,7 +181,7 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;

@@ -379,6 +382,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info,
@@ -378,6 +381,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info,
kGpuFeatureStatusSoftware;
}
}
Expand Down Expand Up @@ -215,7 +215,7 @@ diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
#endif

#if BUILDFLAG(ENABLE_VULKAN)
@@ -702,6 +703,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
@@ -701,6 +702,13 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
}
#endif // BUILDFLAG(IS_WIN)

Expand Down
18 changes: 9 additions & 9 deletions build/patches/Add-AllowUserCertificates-flag.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -227,6 +227,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
@@ -223,6 +223,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
import org.chromium.content_public.browser.SelectionPopupController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.ContentSwitches;
+import org.chromium.net.X509Util;
import org.chromium.printing.PrintManagerDelegateImpl;
import org.chromium.printing.PrintingController;
import org.chromium.printing.PrintingControllerImpl;
@@ -1044,6 +1045,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
@@ -1056,6 +1057,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
super.onStartWithNative();

ChromeActivitySessionTracker.getInstance().onStartWithNative(getProfileProviderSupplier());
ChromeCachedFlags.getInstance().cacheNativeFlags();
+ X509Util.AllowUserCertificates = ChromeFeatureList.isEnabled(
+ ChromeFeatureList.ALLOW_USER_CERTIFICATES);

Expand All @@ -40,7 +40,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -161,6 +161,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
@@ -165,6 +165,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
&feed::kFeedPerformanceStudy,
&feed::kFeedShowSignInCommand,
&feed::kFeedSignedOutViewDemotion,
Expand All @@ -51,31 +51,31 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -161,6 +161,7 @@ public abstract class ChromeFeatureList {
@@ -155,6 +155,7 @@ public abstract class ChromeFeatureList {
/* Alphabetical: */
public static final String ACCOUNT_REAUTHENTICATION_RECENT_TIME_WINDOW =
"AccountReauthenticationRecentTimeWindow";
+ public static final String ALLOW_USER_CERTIFICATES = "AllowUserCertificates";
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_PAGE_SUMMARY =
"AdaptiveButtonInTopToolbarPageSummary";
public static final String ADAPTIVE_BUTTON_IN_TOP_TOOLBAR_CUSTOMIZATION_V2 =
@@ -609,6 +610,8 @@ public abstract class ChromeFeatureList {
@@ -586,6 +587,8 @@ public abstract class ChromeFeatureList {
public static final CachedFlag sAndroidTabDeclutterDedupeTabIdsKillSwitch =
newCachedFlag(ANDROID_TAB_DECLUTTER_DEDUPE_TAB_IDS_KILL_SWITCH, true);
public static final CachedFlag sAppSpecificHistory = newCachedFlag(APP_SPECIFIC_HISTORY, true);
+ public static final CachedFlag sAllowUserCertificates =
+ newCachedFlag(ALLOW_USER_CERTIFICATES, false);
public static final CachedFlag sAsyncNotificationManager =
newCachedFlag(ASYNC_NOTIFICATION_MANAGER, false);
public static final CachedFlag sBackGestureActivityTabProvider =
@@ -780,6 +783,7 @@ public abstract class ChromeFeatureList {
public static final CachedFlag sBlockIntentsWhileLocked =
@@ -744,6 +747,7 @@ public abstract class ChromeFeatureList {
public static final List<CachedFlag> sFlagsCachedFullBrowserChromium =
List.of(
sAccountReauthenticationRecentTimeWindow,
+ sAllowUserCertificates,
sAndroidAppIntegration,
sAndroidAppIntegrationV2,
sAndroidAppIntegrationWithFavicon,
sAndroidBottomToolbar,
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-AllowUserCertificates-flag.inc
new file mode 100644
--- /dev/null
Expand Down
2 changes: 1 addition & 1 deletion build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcuts.java
@@ -392,6 +392,8 @@ public class KeyboardShortcuts {
@@ -403,6 +403,8 @@ public class KeyboardShortcuts {
R.string.keyboard_shortcut_address_bar,
KeyEvent.KEYCODE_L,
KeyEvent.META_CTRL_ON);
Expand Down
2 changes: 1 addition & 1 deletion build/patches/Add-IsCleartextPermitted-flag.patch
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ new file mode 100644
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -383,6 +383,11 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
@@ -371,6 +371,11 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
diff --git a/base/features.cc b/base/features.cc
--- a/base/features.cc
+++ b/base/features.cc
@@ -121,6 +121,10 @@ BASE_FEATURE(kPostGetMyMemoryStateToBackground,
@@ -115,6 +115,10 @@ BASE_FEATURE(kPostGetMyMemoryStateToBackground,
FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_ANDROID)

Expand All @@ -29,7 +29,7 @@ diff --git a/base/features.cc b/base/features.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -21,6 +21,7 @@
@@ -22,6 +22,7 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/feature_list.h"
Expand Down
92 changes: 68 additions & 24 deletions build/patches/Add-a-flag-to-disable-GamePad-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ Subject: Add a flag to disable GamePad API
Adds restrict-gamepad-access flag (default active) to disable GamePad API.
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/browser/flag-metadata.json | 4 ++--
chrome/browser/flag_descriptions.cc | 2 +-
device/gamepad/public/cpp/gamepad_features.cc | 1 +
.../blink/renderer/modules/gamepad/navigator_gamepad.cc | 6 ++++++
4 files changed, 10 insertions(+), 3 deletions(-)
chrome/browser/flag-metadata.json | 4 ++--
content/child/runtime_features.cc | 2 ++
.../about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc | 7 +++++++
device/gamepad/public/cpp/gamepad_features.cc | 8 ++++++++
device/gamepad/public/cpp/gamepad_features.h | 2 ++
.../blink/renderer/modules/gamepad/navigator_gamepad.cc | 7 +++++++
6 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc

diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -7807,9 +7807,9 @@
@@ -7726,9 +7726,9 @@
"expiry_milestone" : 130
},
{
Expand All @@ -26,46 +29,87 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.js
},
{
"name": "retain-omnibox-on-focus",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3331,7 +3331,7 @@ const char kResetShortcutCustomizationsDescription[] =

const char kRestrictGamepadAccessName[] = "Restrict gamepad access";
const char kRestrictGamepadAccessDescription[] =
- "Enables Permissions Policy and Secure Context restrictions on the Gamepad "
+ "Disable the Gamepad "
"API";

#if BUILDFLAG(IS_ANDROID)
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -271,6 +271,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
raw_ref(features::kPeriodicBackgroundSync)},
{wf::EnablePushMessagingSubscriptionChange,
raw_ref(features::kPushSubscriptionChangeEvent)},
+ {wf::EnableRestrictGamepadAccess,
+ raw_ref(features::kRestrictGamepadAccess)},
{wf::EnableSecurePaymentConfirmation,
raw_ref(features::kSecurePaymentConfirmation)},
{wf::EnableSecurePaymentConfirmationDebug,
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-a-flag-to-disable-GamePad-API.inc
@@ -0,0 +1,7 @@
+#ifdef FLAG_SECTION
+
+ {"restrict-gamepad-access", "Restrict gamepad access",
+ "Disable the Gamepad API", kOsAll,
+ FEATURE_VALUE_TYPE(features::kRestrictGamepadAccess)},
+
+#endif
diff --git a/device/gamepad/public/cpp/gamepad_features.cc b/device/gamepad/public/cpp/gamepad_features.cc
--- a/device/gamepad/public/cpp/gamepad_features.cc
+++ b/device/gamepad/public/cpp/gamepad_features.cc
@@ -64,4 +64,5 @@ bool IsGamepadMultitouchEnabled() {
@@ -27,4 +27,12 @@ bool IsGamepadMultitouchEnabled() {
return false;
}

+SET_CROMITE_FEATURE_ENABLED(kRestrictGamepadAccess);
+CROMITE_FEATURE(kRestrictGamepadAccess,
+ "RestrictGamepadAccess",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+bool IsRestrictGamepadAccessEnabled() {
+ return base::FeatureList::IsEnabled(kRestrictGamepadAccess);
+}
+
} // namespace features
diff --git a/device/gamepad/public/cpp/gamepad_features.h b/device/gamepad/public/cpp/gamepad_features.h
--- a/device/gamepad/public/cpp/gamepad_features.h
+++ b/device/gamepad/public/cpp/gamepad_features.h
@@ -11,8 +11,10 @@
namespace features {

GAMEPAD_FEATURES_EXPORT BASE_DECLARE_FEATURE(kEnableGamepadMultitouch);
+GAMEPAD_FEATURES_EXPORT BASE_DECLARE_FEATURE(kRestrictGamepadAccess);

GAMEPAD_FEATURES_EXPORT bool IsGamepadMultitouchEnabled();
+GAMEPAD_FEATURES_EXPORT bool IsRestrictGamepadAccessEnabled();

} // namespace features

diff --git a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
--- a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
+++ b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
@@ -120,6 +120,10 @@ void RecordGamepadsForIdentifiabilityStudy(
@@ -27,6 +27,7 @@

#include "base/auto_reset.h"
#include "device/gamepad/public/cpp/gamepads.h"
+#include "device/gamepad/public/cpp/gamepad_features.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-blink.h"
@@ -112,6 +113,10 @@ void RecordGamepadsForIdentifiabilityStudy(
HeapVector<Member<Gamepad>> NavigatorGamepad::getGamepads(
Navigator& navigator,
ExceptionState& exception_state) {
+ if (base::FeatureList::IsEnabled(::features::kRestrictGamepadAccess)) {
+ if (::features::IsRestrictGamepadAccessEnabled()) {
+ exception_state.ThrowSecurityError("Access to the feature \"gamepad\" is denied");
+ return HeapVector<Member<Gamepad>>();
+ }
if (!navigator.DomWindow()) {
// Using an existing NavigatorGamepad if one exists, but don't create one
// for a detached window, as its subclasses depend on a non-null window.
@@ -442,6 +446,8 @@ void NavigatorGamepad::SampleAndCompareGamepadState() {
@@ -418,6 +423,8 @@ void NavigatorGamepad::SampleAndCompareGamepadState() {

void NavigatorGamepad::DispatchGamepadEvent(const AtomicString& event_name,
Gamepad* gamepad) {
+ if (base::FeatureList::IsEnabled(::features::kRestrictGamepadAccess))
+ if (::features::IsRestrictGamepadAccessEnabled())
+ return;
// Ensure that we're blocking re-entrancy.
DCHECK(processing_events_);
Expand Down
Loading

0 comments on commit 8dc7a7f

Please sign in to comment.