12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- # NOTE: Modified to remove usage of compiler #if macros
- From: csagan5 <32685696+csagan5@users.noreply.github.com>
- Date: Sun, 8 Jul 2018 18:16:34 +0200
- Subject: Disable fetching of all field trials
- ---
- .../browser/flags/ChromeFeatureList.java | 19 ++++---------------
- .../variations/service/variations_service.cc | 12 +-----------
- 2 files changed, 5 insertions(+), 26 deletions(-)
- --- 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
- @@ -123,11 +123,7 @@ public abstract class ChromeFeatureList
- * the specified parameter does not exist.
- */
- public static String getFieldTrialParamByFeature(String featureName, String paramName) {
- - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName);
- - if (testValue != null) return testValue;
- - if (FeatureList.hasTestFeatures()) return "";
- - assert FeatureList.isInitialized();
- - return ChromeFeatureListJni.get().getFieldTrialParamByFeature(featureName, paramName);
- + return "";
- }
-
- /**
- @@ -144,12 +140,7 @@ public abstract class ChromeFeatureList
- */
- public static int getFieldTrialParamByFeatureAsInt(
- String featureName, String paramName, int defaultValue) {
- - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName);
- - if (testValue != null) return Integer.valueOf(testValue);
- - if (FeatureList.hasTestFeatures()) return defaultValue;
- - assert FeatureList.isInitialized();
- - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsInt(
- - featureName, paramName, defaultValue);
- + return defaultValue;
- }
-
- /**
- @@ -166,12 +157,7 @@ public abstract class ChromeFeatureList
- */
- public static double getFieldTrialParamByFeatureAsDouble(
- String featureName, String paramName, double defaultValue) {
- - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName);
- - if (testValue != null) return Double.valueOf(testValue);
- - if (FeatureList.hasTestFeatures()) return defaultValue;
- - assert FeatureList.isInitialized();
- - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsDouble(
- - featureName, paramName, defaultValue);
- + return defaultValue;
- }
-
- /**
- @@ -202,12 +188,7 @@ public abstract class ChromeFeatureList
- */
- public static boolean getFieldTrialParamByFeatureAsBoolean(
- String featureName, String paramName, boolean defaultValue) {
- - String testValue = FeatureList.getTestValueForFieldTrialParam(featureName, paramName);
- - if (testValue != null) return Boolean.valueOf(testValue);
- - if (FeatureList.hasTestFeatures()) return defaultValue;
- - assert FeatureList.isInitialized();
- - return ChromeFeatureListJni.get().getFieldTrialParamByFeatureAsBoolean(
- - featureName, paramName, defaultValue);
- + return defaultValue;
- }
-
- /* Alphabetical: */
- --- a/components/variations/service/variations_service.cc
- +++ b/components/variations/service/variations_service.cc
- @@ -240,17 +240,7 @@ bool GetInstanceManipulations(const net:
- // Variations seed fetching is only enabled in official Chrome builds, if a URL
- // is specified on the command line, and for testing.
- bool IsFetchingEnabled() {
- -#if !BUILDFLAG(GOOGLE_CHROME_BRANDING)
- - if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- - switches::kVariationsServerURL) &&
- - !g_should_fetch_for_testing) {
- - DVLOG(1)
- - << "Not performing repeated fetching in unofficial build without --"
- - << switches::kVariationsServerURL << " specified.";
- - return false;
- - }
- -#endif
- - return true;
- + return false;
- }
-
- std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(
|