disable-fetching-field-trials.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # NOTE: Modified to remove usage of compiler #if macros
  2. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  3. Date: Sun, 8 Jul 2018 18:16:34 +0200
  4. Subject: Disable fetching of all field trials
  5. ---
  6. .../browser/flags/ChromeFeatureList.java | 19 ++++---------------
  7. .../variations/service/variations_service.cc | 12 +-----------
  8. 2 files changed, 5 insertions(+), 26 deletions(-)
  9. --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
  10. +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
  11. @@ -56,7 +56,7 @@ public abstract class ChromeFeatureList
  12. * |kFeaturesExposedToJava| in chrome/browser/flags/android/chrome_feature_list.cc
  13. */
  14. public static String getFieldTrialParamByFeature(String featureName, String paramName) {
  15. - return ChromeFeatureMap.getInstance().getFieldTrialParamByFeature(featureName, paramName);
  16. + return "";
  17. }
  18. /**
  19. @@ -68,8 +68,7 @@ public abstract class ChromeFeatureList
  20. */
  21. public static boolean getFieldTrialParamByFeatureAsBoolean(
  22. String featureName, String paramName, boolean defaultValue) {
  23. - return ChromeFeatureMap.getInstance()
  24. - .getFieldTrialParamByFeatureAsBoolean(featureName, paramName, defaultValue);
  25. + return defaultValue;
  26. }
  27. /**
  28. @@ -81,8 +80,7 @@ public abstract class ChromeFeatureList
  29. */
  30. public static int getFieldTrialParamByFeatureAsInt(
  31. String featureName, String paramName, int defaultValue) {
  32. - return ChromeFeatureMap.getInstance()
  33. - .getFieldTrialParamByFeatureAsInt(featureName, paramName, defaultValue);
  34. + return defaultValue;
  35. }
  36. /**
  37. @@ -94,8 +92,7 @@ public abstract class ChromeFeatureList
  38. */
  39. public static double getFieldTrialParamByFeatureAsDouble(
  40. String featureName, String paramName, double defaultValue) {
  41. - return ChromeFeatureMap.getInstance()
  42. - .getFieldTrialParamByFeatureAsDouble(featureName, paramName, defaultValue);
  43. + return defaultValue;
  44. }
  45. /**
  46. --- a/components/variations/service/variations_service.cc
  47. +++ b/components/variations/service/variations_service.cc
  48. @@ -227,17 +227,7 @@ bool GetInstanceManipulations(const net:
  49. // Variations seed fetching is only enabled in official Chrome builds, if a URL
  50. // is specified on the command line, and for testing.
  51. bool IsFetchingEnabled() {
  52. -#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
  53. - if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
  54. - switches::kVariationsServerURL) &&
  55. - !g_should_fetch_for_testing) {
  56. - DVLOG(1)
  57. - << "Not performing repeated fetching in unofficial build without --"
  58. - << switches::kVariationsServerURL << " specified.";
  59. - return false;
  60. - }
  61. -#endif
  62. - return true;
  63. + return false;
  64. }
  65. // Returns the already downloaded first run seed, and clear the seed from the