csagan5 преди 6 години
родител
ревизия
e7e7afdc2d

+ 7 - 0
CHANGELOG.md

@@ -1,3 +1,10 @@
+# 73.0.3683.82
+* remove force home page button flag
+* enable site per process isolation for devices with memory > 1GB
+* use 64-bit processes for SystemWebView
+* disable local field trials seed (redundant)
+* fix patch for classic new tab page (redundant)
+
 # 73.0.3683.79
 * add missing Qwant engine from default engines list (fixes https://github.com/bromite/bromite/issues/262)
 * DoH: include upstream patch for DNS secure mode

Файловите разлики са ограничени, защото са твърде много
+ 101 - 26
build/filters/adblock_entries.h


+ 1 - 1
build/patches/Add-a-flag-for-DNS-over-HTTPS.patch

@@ -40,7 +40,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  #endif  // OS_ANDROID
  
  const FeatureEntry::Choice kMHTMLGeneratorOptionChoices[] = {
-@@ -3436,6 +3444,12 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -3433,6 +3441,12 @@ const FeatureEntry kFeatureEntries[] = {
       FEATURE_VALUE_TYPE(features::kAsyncDns)},
  #endif  // defined(OS_ANDROID)
  

+ 1 - 1
build/patches/Add-flag-to-configure-maximum-connections-per-host.patch

@@ -30,7 +30,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  // Ensure that all effective connection types returned by Network Quality
  // Estimator (NQE) are also exposed via flags.
  static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
-@@ -2360,6 +2365,9 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2357,6 +2362,9 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kMaterialDesignIncognitoNTPName,
       flag_descriptions::kMaterialDesignIncognitoNTPDescription, kOsAndroid,
       FEATURE_VALUE_TYPE(features::kMaterialDesignIncognitoNTP)},

+ 1 - 1
build/patches/Add-flag-to-control-video-playback-resume-feature.patch

@@ -13,7 +13,7 @@ Disable it by default on Android as it is everywhere else
 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
-@@ -3950,6 +3950,11 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -3947,6 +3947,11 @@ const FeatureEntry kFeatureEntries[] = {
       FEATURE_VALUE_TYPE(features::kSiteCharacteristicsDatabase)},
  #endif
  

+ 1 - 1
build/patches/Add-flag-to-disable-IPv6-probes.patch

@@ -14,7 +14,7 @@ Subject: Add flag to disable IPv6 probes
 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
-@@ -3272,6 +3272,11 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -3269,6 +3269,11 @@ const FeatureEntry kFeatureEntries[] = {
       FEATURE_VALUE_TYPE(features::kHandwritingGesture)},
  #endif  // OS_CHROMEOS
  

+ 2 - 2
build/patches/Add-flags-to-disable-device-motion-and-orientation-APIs.patch

@@ -20,7 +20,7 @@ legacy acceleration events.
 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
-@@ -2773,6 +2773,12 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2770,6 +2770,12 @@ const FeatureEntry kFeatureEntries[] = {
      {"enable-generic-sensor", flag_descriptions::kEnableGenericSensorName,
       flag_descriptions::kEnableGenericSensorDescription, kOsAll,
       FEATURE_VALUE_TYPE(features::kGenericSensor)},
@@ -83,7 +83,7 @@ diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.
 diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
 --- a/content/public/common/content_features.cc
 +++ b/content/public/common/content_features.cc
-@@ -600,6 +600,16 @@ const base::Feature kWebRtcHideLocalIpsWithMdns{
+@@ -596,6 +596,16 @@ const base::Feature kWebRtcHideLocalIpsWithMdns{
  // https://wicg.github.io/webusb
  const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
  

+ 236 - 0
build/patches/Always-show-home-page-settings.patch

@@ -0,0 +1,236 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sun, 17 Mar 2019 20:51:11 +0100
+Subject: Always show home page settings
+
+Remove the "Force Enable Home Page Button" flag, which was bugged, and always
+display home page settings.
+This allows removing the home page button and restoring it from settings.
+---
+ .../browser/init/ProcessInitializationHandler.java | 12 --------
+ .../partnercustomizations/HomepageManager.java     | 17 ++--------
+ .../preferences/ChromePreferenceManager.java       |  7 -----
+ .../browser/preferences/MainPreferences.java       | 12 +++-----
+ .../chrome/browser/util/FeatureUtilities.java      | 36 ----------------------
+ chrome/browser/about_flags.cc                      |  3 --
+ chrome/browser/android/chrome_feature_list.cc      |  4 ---
+ chrome/browser/android/chrome_feature_list.h       |  1 -
+ 8 files changed, 7 insertions(+), 85 deletions(-)
+
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
+@@ -328,18 +328,6 @@ public class ProcessInitializationHandler {
+         deferredStartupHandler.addDeferredTask(new Runnable() {
+             @Override
+             public void run() {
+-                if (HomepageManager.shouldShowHomepageSetting()) {
+-                    RecordHistogram.recordBooleanHistogram("Settings.ShowHomeButtonPreferenceState",
+-                            HomepageManager.isHomepageEnabled());
+-                    RecordHistogram.recordBooleanHistogram("Settings.HomePageIsCustomized",
+-                            !HomepageManager.getInstance().getPrefHomepageUseDefaultUri());
+-                }
+-            }
+-        });
+-
+-        deferredStartupHandler.addDeferredTask(new Runnable() {
+-            @Override
+-            public void run() {
+                 // Starts syncing with GSA.
+                 AppHooks.get().createGsaHelper().startSync();
+             }
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
+@@ -83,10 +83,7 @@ public class HomepageManager {
+      * @return Whether or not homepage is enabled.
+      */
+     public static boolean isHomepageEnabled() {
+-        if (FeatureUtilities.isHomePageButtonForceEnabled()) {
+-            return getInstance().getPrefHomepageEnabled();
+-        }
+-        return false;
++        return getInstance().getPrefHomepageEnabled();
+     }
+ 
+     /**
+@@ -98,13 +95,6 @@ public class HomepageManager {
+     }
+ 
+     /**
+-     * @return Whether or not homepage setting should be shown.
+-     */
+-    public static boolean shouldShowHomepageSetting() {
+-        return FeatureUtilities.isHomePageButtonForceEnabled();
+-    }
+-
+-    /**
+      * @return Homepage URI string, if it's enabled. Null otherwise or uninitialized.
+      */
+     public static String getHomepageUri() {
+@@ -118,8 +108,7 @@ public class HomepageManager {
+     }
+ 
+     /**
+-     * @return The default homepage URI if the homepage is partner provided or the new tab page
+-     *         if the homepage button is force enabled via flag.
++     * @return The default homepage URI.
+      */
+     public static String getDefaultHomepageUri() {
+         return UrlConstants.NTP_NON_NATIVE_URL;
+@@ -132,7 +121,7 @@ public class HomepageManager {
+      * @see #isHomepageEnabled
+      */
+     public boolean getPrefHomepageEnabled() {
+-        return mSharedPreferences.getBoolean(PREF_HOMEPAGE_ENABLED, true);
++        return mSharedPreferences.getBoolean(PREF_HOMEPAGE_ENABLED, false);
+     }
+ 
+     /**
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceManager.java
+@@ -144,13 +144,6 @@ public class ChromePreferenceManager {
+     private static final String CHROME_MODERN_DESIGN_ENABLED_KEY = "chrome_modern_design_enabled";
+ 
+     /**
+-     * Whether or not the home page button is force enabled.
+-     * Default value is false.
+-     */
+-    public static final String HOME_PAGE_BUTTON_FORCE_ENABLED_KEY =
+-            "home_page_button_force_enabled";
+-
+-    /**
+      * Whether or not the homepage tile will be shown.
+      * Default value is false.
+      */
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
+@@ -195,15 +195,11 @@ public class MainPreferences extends PreferenceFragment
+ 
+         updateSearchEnginePreference();
+ 
+-        if (HomepageManager.shouldShowHomepageSetting()) {
+-            Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
+-            if (FeatureUtilities.isNewTabPageButtonEnabled()) {
+-                homepagePref.setTitle(R.string.options_startup_page_title);
+-            }
+-            setOnOffSummary(homepagePref, HomepageManager.getInstance().getPrefHomepageEnabled());
+-        } else {
+-            removePreferenceIfPresent(PREF_HOMEPAGE);
++        Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
++        if (FeatureUtilities.isNewTabPageButtonEnabled()) {
++            homepagePref.setTitle(R.string.options_startup_page_title);
+         }
++        setOnOffSummary(homepagePref, HomepageManager.getInstance().getPrefHomepageEnabled());
+ 
+         if (!ChromeFeatureList.isEnabled(ChromeFeatureList.UNIFIED_CONSENT)
+                 && FeatureUtilities.areContextualSuggestionsEnabled(getActivity())
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
+@@ -71,7 +71,6 @@ public class FeatureUtilities {
+     private static Boolean sHasRecognitionIntentHandler;
+ 
+     private static Boolean sIsSoleEnabled;
+-    private static Boolean sIsHomePageButtonForceEnabled;
+     private static Boolean sIsHomepageTileEnabled;
+     private static Boolean sIsNewTabPageButtonEnabled;
+     private static Boolean sIsBottomToolbarEnabled;
+@@ -186,7 +185,6 @@ public class FeatureUtilities {
+         cacheSoleEnabled();
+         cacheCommandLineOnNonRootedEnabled();
+         FirstRunUtils.cacheFirstRunPrefs();
+-        cacheHomePageButtonForceEnabled();
+         cacheHomepageTileEnabled();
+         cacheNewTabPageButtonEnabled();
+         cacheBottomToolbarEnabled();
+@@ -212,40 +210,6 @@ public class FeatureUtilities {
+     }
+ 
+     /**
+-     * Cache whether or not the home page button is force enabled so on next startup, the value can
+-     * be made available immediately.
+-     */
+-    public static void cacheHomePageButtonForceEnabled() {
+-        if (PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()) return;
+-        ChromePreferenceManager.getInstance().writeBoolean(
+-                ChromePreferenceManager.HOME_PAGE_BUTTON_FORCE_ENABLED_KEY,
+-                ChromeFeatureList.isEnabled(ChromeFeatureList.HOME_PAGE_BUTTON_FORCE_ENABLED));
+-    }
+-
+-    /**
+-     * @return Whether or not the home page button is force enabled.
+-     */
+-    public static boolean isHomePageButtonForceEnabled() {
+-        if (sIsHomePageButtonForceEnabled == null) {
+-            ChromePreferenceManager prefManager = ChromePreferenceManager.getInstance();
+-
+-            try (StrictModeContext unused = StrictModeContext.allowDiskReads()) {
+-                sIsHomePageButtonForceEnabled = prefManager.readBoolean(
+-                        ChromePreferenceManager.HOME_PAGE_BUTTON_FORCE_ENABLED_KEY, false);
+-            }
+-        }
+-        return sIsHomePageButtonForceEnabled;
+-    }
+-
+-    /**
+-     * Resets whether the home page button is enabled for tests. After this is called, the next
+-     * call to #isHomePageButtonForceEnabled() will retrieve the value from shared preferences.
+-     */
+-    public static void resetHomePageButtonForceEnabledForTests() {
+-        sIsHomePageButtonForceEnabled = null;
+-    }
+-
+-    /**
+      * Cache whether or not the toolbar should be inflated on a background thread so on next
+      * startup, the value can be made available immediately.
+      */
+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
+@@ -1891,9 +1891,6 @@ const FeatureEntry kFeatureEntries[] = {
+     {"enable-chrome-duet", flag_descriptions::kChromeDuetName,
+      flag_descriptions::kChromeDuetDescription, kOsAndroid,
+      FEATURE_VALUE_TYPE(chrome::android::kChromeDuetFeature)},
+-    {"force-enable-home-page-button", flag_descriptions::kHomePageButtonName,
+-     flag_descriptions::kHomePageButtonDescription, kOsAndroid,
+-     FEATURE_VALUE_TYPE(chrome::android::kHomePageButtonForceEnabled)},
+     {"enable-ntp-button", flag_descriptions::kNtpButtonName,
+      flag_descriptions::kNtpButtonDescription, kOsAndroid,
+      FEATURE_VALUE_TYPE(chrome::android::kNTPButton)},
+diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
+--- a/chrome/browser/android/chrome_feature_list.cc
++++ b/chrome/browser/android/chrome_feature_list.cc
+@@ -124,7 +124,6 @@ const base::Feature* kFeaturesExposedToJava[] = {
+     &kGestureNavigation,
+     &kHandleMediaIntents,
+     &kHideUserDataFromIncognitoNotifications,
+-    &kHomePageButtonForceEnabled,
+     &kHomepageTile,
+     &kHorizontalTabSwitcherAndroid,
+     &kImprovedA2HS,
+@@ -337,9 +336,6 @@ const base::Feature kHandleMediaIntents{"HandleMediaIntents",
+ const base::Feature kHideUserDataFromIncognitoNotifications{
+     "HideUserDataFromIncognitoNotifications", base::FEATURE_ENABLED_BY_DEFAULT};
+ 
+-const base::Feature kHomePageButtonForceEnabled{
+-    "HomePageButtonForceEnabled", base::FEATURE_DISABLED_BY_DEFAULT};
+-
+ const base::Feature kHomepageTile{"HomepageTile",
+                                   base::FEATURE_ENABLED_BY_DEFAULT};
+ 
+diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h
+--- a/chrome/browser/android/chrome_feature_list.h
++++ b/chrome/browser/android/chrome_feature_list.h
+@@ -56,7 +56,6 @@ extern const base::Feature kForegroundNotificationManager;
+ extern const base::Feature kGestureNavigation;
+ extern const base::Feature kHandleMediaIntents;
+ extern const base::Feature kHideUserDataFromIncognitoNotifications;
+-extern const base::Feature kHomePageButtonForceEnabled;
+ extern const base::Feature kHomepageTile;
+ extern const base::Feature kHorizontalTabSwitcherAndroid;
+ extern const base::Feature kImprovedA2HS;
+-- 
+2.11.0
+

+ 16 - 6
build/patches/Change-default-homepage-to-new-tab-page.patch → build/patches/Always-use-new-tab-page-for-default-home-page.patch

@@ -1,16 +1,26 @@
 From: csagan5 <32685696+csagan5@users.noreply.github.com>
 Date: Wed, 27 Jun 2018 11:02:38 +0200
-Subject: Change default homepage to new tab page
+Subject: Always use new tab page for default home page
 
-Disable any partner-provided home page.
+Ignore any partner-provided home page.
 ---
- .../chrome/browser/partnercustomizations/HomepageManager.java      | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
+ .../chrome/browser/partnercustomizations/HomepageManager.java  | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
 
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/HomepageManager.java
-@@ -102,8 +102,7 @@ public class HomepageManager {
+@@ -83,8 +83,7 @@ public class HomepageManager {
+      * @return Whether or not homepage is enabled.
+      */
+     public static boolean isHomepageEnabled() {
+-        if (PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()
+-                || FeatureUtilities.isHomePageButtonForceEnabled()) {
++        if (FeatureUtilities.isHomePageButtonForceEnabled()) {
+             return getInstance().getPrefHomepageEnabled();
+         }
+         return false;
+@@ -102,8 +101,7 @@ public class HomepageManager {
       * @return Whether or not homepage setting should be shown.
       */
      public static boolean shouldShowHomepageSetting() {
@@ -20,7 +30,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomiz
      }
  
      /**
-@@ -124,9 +123,7 @@ public class HomepageManager {
+@@ -124,9 +122,7 @@ public class HomepageManager {
       *         if the homepage button is force enabled via flag.
       */
      public static String getDefaultHomepageUri() {

+ 1 - 1
build/patches/Disable-Omaha-update-checks.patch

@@ -36,7 +36,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNu
 diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc
 --- a/chrome/browser/android/chrome_feature_list.cc
 +++ b/chrome/browser/android/chrome_feature_list.cc
-@@ -361,7 +361,7 @@ const base::Feature kIntentBlockExternalFormRedirectsNoGesture{
+@@ -357,7 +357,7 @@ const base::Feature kIntentBlockExternalFormRedirectsNoGesture{
      base::FEATURE_DISABLED_BY_DEFAULT};
  
  const base::Feature kJellyBeanSupported{"JellyBeanSupported",

+ 25 - 0
build/patches/Disable-seed-based-field-trials.patch

@@ -0,0 +1,25 @@
+From: Daniel Micay <danielmicay@gmail.com>
+Date: Tue, 25 Dec 2018 16:19:51 -0500
+Subject: Disable seed-based field trials
+
+---
+ components/variations/service/variations_field_trial_creator.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
+--- a/components/variations/service/variations_field_trial_creator.cc
++++ b/components/variations/service/variations_field_trial_creator.cc
+@@ -513,8 +513,10 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
+ #endif  // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
+   bool used_seed = false;
+   if (!used_testing_config) {
++#if defined(FIELDTRIAL_SEED_ENABLED)
+     used_seed = CreateTrialsFromSeed(std::move(low_entropy_provider),
+                                      feature_list.get(), safe_seed_manager);
++#endif
+   }
+ 
+   platform_field_trials->SetupFeatureControllingFieldTrials(used_seed,
+-- 
+2.11.0
+

+ 5 - 5
build/patches/Disable-signin-and-data-saver-preferences.patch

@@ -181,8 +181,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/Mai
 -
          updateSearchEnginePreference();
  
-         if (HomepageManager.shouldShowHomepageSetting()) {
-@@ -220,10 +208,6 @@ public class MainPreferences extends PreferenceFragment
+         Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
+@@ -216,10 +204,6 @@ public class MainPreferences extends PreferenceFragment
          } else {
              removePreferenceIfPresent(PREF_DEVELOPER);
          }
@@ -193,7 +193,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/Mai
      }
  
      private Preference addPreferenceIfAbsent(String key) {
-@@ -283,11 +267,11 @@ public class MainPreferences extends PreferenceFragment
+@@ -279,11 +263,11 @@ public class MainPreferences extends PreferenceFragment
  
      private void onSignInPreferenceStateChanged() {
          // Remove "Account" section header if the personalized sign-in promo is shown.
@@ -208,7 +208,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/Mai
      }
  
      // TemplateUrlService.LoadListener implementation.
-@@ -306,9 +290,6 @@ public class MainPreferences extends PreferenceFragment
+@@ -302,9 +286,6 @@ public class MainPreferences extends PreferenceFragment
          return new ManagedPreferenceDelegate() {
              @Override
              public boolean isPreferenceControlledByPolicy(Preference preference) {
@@ -218,7 +218,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/Mai
                  if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
                      return TemplateUrlService.getInstance().isDefaultSearchManaged();
                  }
-@@ -317,11 +298,6 @@ public class MainPreferences extends PreferenceFragment
+@@ -313,11 +294,6 @@ public class MainPreferences extends PreferenceFragment
  
              @Override
              public boolean isPreferenceClickDisabledByPolicy(Preference preference) {

+ 33 - 0
build/patches/Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch

@@ -2,6 +2,39 @@ From: Daniel Micay <danielmicay@gmail.com>
 Date: Thu, 22 Dec 2016 07:15:34 -0500
 Subject: Enable -fwrapv in Clang for non-UBSan builds
 
+Using -fwrapv (notably only when not using signed integer overflow checking -
+since it will override it and result in not performing checks) is just common
+sense since it eliminates the chance of security vulnerabilities being
+introduced by optimizations based on signed overflow being undefined.
+That has happened before, and those optimizations don't even add up to a 0.1%
+performance increase for this kind of software. It's not worth having.
+The Linux kernel passes -fwrapv and also -fno-strict-aliasing to disable those
+dangerous optimizations (since there is so much incorrect code they can break).
+In fact, it is easy to point to dozens of known examples of invalid code that
+could potentially be broken by those optimizations.
+
+It is not acceptable for projects to be using optimizations that are known to
+be broken with a bunch of code in their tree.
+They put barely any effort into even fixing the known cases.
+Chromium has blacklists for UBSan for 'false positives' (none of which are
+actually false positives, but rather "undefined, but not a bug beyond
+potentially being broken by optimizations or even code generation without
+them") and also for components too full of these bugs for them to currently
+want to bother with it. That includes a bunch of signed overflow issues
+(there is sadly no detection for aliasing violations, which are fairly common,
+but not that common).
+
+Ideally, -fwrapv could be always passed, but unfortunately the way it is
+implemented has silly interactions with other switches.
+The reason it would still make sense to pass it is because due to their UBSan
+blacklists, they get far from full coverage with it, so -fwrapv would still
+be better than nothing where it's not being used.
+
+Since -fwrapv makes signed integer overflow well-defined, Clang will disable
+the UBSan checks for signed integer overflow, including in the
+production-oriented trapping mode used for hardening.
+
+Excerpt from https://github.com/bromite/bromite/issues/226
 ---
  build/config/compiler/BUILD.gn | 4 ++++
  1 file changed, 4 insertions(+)

+ 35 - 0
build/patches/Enable-site-per-process-isolation-for-devices-with-enough-memory.patch

@@ -0,0 +1,35 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sun, 17 Mar 2019 19:09:00 +0100
+Subject: Enable site per process isolation for devices with enough memory
+
+---
+ chrome/common/chrome_features.cc | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
+--- a/chrome/common/chrome_features.cc
++++ b/chrome/common/chrome_features.cc
+@@ -518,11 +518,7 @@ const base::Feature kShowTrustedPublisherURL{"ShowTrustedPublisherURL",
+ // (e.g. this approach lets ChromeCast avoid site-per-process mode).
+ const base::Feature kSitePerProcess {
+   "site-per-process",
+-#if defined(OS_ANDROID)
+-      base::FEATURE_DISABLED_BY_DEFAULT
+-#else
+       base::FEATURE_ENABLED_BY_DEFAULT
+-#endif
+ };
+ 
+ // kSitePerProcessOnlyForHighMemoryClients is checked before kSitePerProcess,
+@@ -535,7 +531,7 @@ const base::Feature kSitePerProcess {
+ // base::SysInfo::AmountOfPhysicalMemoryMB().
+ const base::Feature kSitePerProcessOnlyForHighMemoryClients{
+     "site-per-process-only-for-high-memory-clients",
+-    base::FEATURE_DISABLED_BY_DEFAULT};
++    base::FEATURE_ENABLED_BY_DEFAULT};
+ const char kSitePerProcessOnlyForHighMemoryClientsParamName[] =
+     "site-per-process-low-memory-cutoff-mb";
+ 
+-- 
+2.11.0
+

+ 24 - 9
build/patches/Restore-classic-new-tab-page.patch

@@ -3,24 +3,39 @@ Date: Sun, 26 Nov 2017 11:40:05 +0100
 Subject: Restore classic new tab page
 
 ---
- chrome/browser/search/search.cc | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
+ chrome/browser/search/search.cc | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
 
 diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc
 --- a/chrome/browser/search/search.cc
 +++ b/chrome/browser/search/search.cc
-@@ -156,10 +156,7 @@ bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
+@@ -154,16 +154,6 @@ bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
+   return true;
+ }
  
- bool ShouldShowLocalNewTab(Profile* profile) {
- #if !defined(OS_ANDROID)
+-bool ShouldShowLocalNewTab(Profile* profile) {
+-#if !defined(OS_ANDROID)
 -  base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
 -  return command_line->HasSwitch(switches::kForceLocalNtp) ||
 -         (base::FeatureList::IsEnabled(features::kUseGoogleLocalNtp) &&
 -          profile && DefaultSearchProviderIsGoogle(profile));
-+  return true;
- #endif
-   return false;
- }
+-#endif
+-  return false;
+-}
+-
+ bool ShouldDelayRemoteNTP(const GURL& search_provider_url, Profile* profile) {
+ #if defined(OS_CHROMEOS)
+   // On Chrome OS, if the session hasn't merged yet, we need to avoid loading
+@@ -190,8 +180,7 @@ struct NewTabURLDetails {
+ 
+     const GURL local_url(chrome::kChromeSearchLocalNtpUrl);
+ 
+-    if (ShouldShowLocalNewTab(profile))
+-      return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
++    return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
+ 
+     const TemplateURL* template_url =
+         GetDefaultSearchProviderTemplateURL(profile);
 -- 
 2.11.0
 

+ 7 - 0
build/patches/Switch-to-fstack-protector-strong.patch

@@ -2,6 +2,13 @@ From: Daniel Micay <danielmicay@gmail.com>
 Date: Wed, 26 Dec 2018 10:20:24 -0500
 Subject: Switch to -fstack-protector-strong
 
+This compiler option is already used for ChromeOS, but not yet on other
+platforms because there is push back against enabling an option resulting in
+~1-2% lower performance and ~2-3% larger binaries.
+
+The size increase on Android is something they care a lot about since some
+devices have very little storage space. That also means ever so slightly
+higher memory/cache usage but not by the full 2-3%.
 ---
  build/config/compiler/BUILD.gn | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

+ 38 - 0
build/patches/Use-64-bit-WebView-processes.patch

@@ -0,0 +1,38 @@
+From: Daniel Micay <danielmicay@gmail.com>
+Date: Thu, 26 Jan 2017 01:30:12 -0500
+Subject: Use 64-bit WebView processes
+
+64-bit processes introduce 10% or so higher memory consumption.
+The reason for preferring 64-bit processes is providing substantially better
+exploit mitigations at the expense of slightly more memory usage.
+
+In addition to the standard mitigations, it also enables usage of
+https://github.com/AndroidHardening/hardened_malloc (where available).
+
+It will provide high entropy ASLR (24-bit to 32-bit depending on whether the
+kernel uses 3 or 4 level page tables rather than 16-bit for 32-bit processes),
+high entropy stack canaries (56/64-bit instead of 24/32-bit depending on
+whether a zero byte is used) and also features like pointer authentication and
+memory tagging when those are made available in the future.
+
+The reason why upstream started preferring 32-bit processes is to save memory,
+particularly since saving memory makes it feasible to use finer-grained
+sandboxing.
+---
+ android_webview/apk/java/AndroidManifest.xml | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/android_webview/apk/java/AndroidManifest.xml b/android_webview/apk/java/AndroidManifest.xml
+--- a/android_webview/apk/java/AndroidManifest.xml
++++ b/android_webview/apk/java/AndroidManifest.xml
+@@ -25,7 +25,6 @@
+                  android:icon="@{{manifest_package|default('com.android.webview')}}:drawable/icon_webview"
+                  android:name="{{ application_name|default('com.android.webview.chromium.WebViewApplication') }}"
+                  android:multiArch="true"
+-                 android:use32bitAbi="true"
+                  android:extractNativeLibs="{{ trichrome_library is not defined }}">
+         {# This part is shared between stand-alone WebView and Monochrome #}
+         {% macro common(manifest_package, webview_lib) %}
+-- 
+2.11.0
+

+ 6 - 2
build/patches_list.txt

@@ -1,5 +1,8 @@
 Disable-third-party-cookies-by-default.patch
 Restore-classic-new-tab-page.patch
+Always-use-new-tab-page-for-default-home-page.patch
+Always-allow-partner-customisation.patch
+Always-show-home-page-settings.patch
 battery_status_service-disable-more-privacy-nightmares.patch
 Battery-API-return-nothing.patch
 google-cloud-messaging-disable-experiment-status-check.patch
@@ -74,13 +77,12 @@ Always-respect-async-dns-flag-regardless-of-SDK-version.patch
 Add-flag-to-configure-maximum-connections-per-host.patch
 Add-custom-tab-intents-privacy-option.patch
 Add-site-settings-option-for-session-only-cookies.patch
-Always-allow-partner-customisation.patch
-Change-default-homepage-to-new-tab-page.patch
 Add-bookmark-import-export-actions.patch
 Disable-promos-displayed-in-bookmarks-manager.patch
 Add-option-to-not-persist-tabs-across-sessions.patch
 Add-an-always-incognito-mode.patch
 Disable-fetching-of-all-field-trials.patch
+Disable-seed-based-field-trials.patch
 Disable-smooth-scrolling-on-Linux.patch
 Disable-plugins-enumeration.patch
 Remove-request-for-account-access-permission-on-reboot.patch
@@ -110,3 +112,5 @@ Rollback-android-minSdkVersion-from-19-KitKat-to-16-JellyBean.patch
 Add-flag-to-show-hide-NTP-tiles.patch
 Use-4-tile-rows-never-show-logo.patch
 Disable-metrics-collection-for-NTP-tiles.patch
+Enable-site-per-process-isolation-for-devices-with-enough-memory.patch
+Use-64-bit-WebView-processes.patch

Някои файлове не бяха показани, защото твърде много файлове са промени