author | Cosmin Sabou <csabou@mozilla.com> |
Tue, 09 Apr 2019 19:57:58 +0300 | |
changeset 468598 | 9bc397e8199db4df590f7307b8ba6afb32c9ce96 |
parent 468597 | 9c62f06c8c6a719bf0cb82c6a49ac5e2a1029904 |
child 468599 | 83e7324dc00b7cfcf4e3f05ebe9523bbbac6d6eb |
push id | 35843 |
push user | nbeleuzu@mozilla.com |
push date | Tue, 09 Apr 2019 22:08:13 +0000 |
treeherder | mozilla-central@a31032a16330 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1533385 |
milestone | 68.0a1 |
backs out | 47d793fbd8ccea31dad61e1e5b3df4b7656a7d4b |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/mobile/android/geckoview/api.txt +++ b/mobile/android/geckoview/api.txt @@ -206,17 +206,16 @@ package org.mozilla.geckoview { public static interface GeckoRuntime.Delegate { method @android.support.annotation.UiThread public void onShutdown(); } @android.support.annotation.AnyThread public final class GeckoRuntimeSettings extends org.mozilla.geckoview.RuntimeSettings { method @android.support.annotation.NonNull public java.lang.String[] getArguments(); method public boolean getAutomaticFontSizeAdjustment(); method public int getAutoplayDefault(); - method @android.support.annotation.Nullable public java.lang.String getConfigFilePath(); method public boolean getConsoleOutputEnabled(); method @android.support.annotation.NonNull public org.mozilla.geckoview.ContentBlocking.Settings getContentBlocking(); method @android.support.annotation.Nullable public java.lang.Class<?> getCrashHandler(); method @android.support.annotation.Nullable public java.lang.Float getDisplayDensityOverride(); method @android.support.annotation.Nullable public java.lang.Integer getDisplayDpiOverride(); method @android.support.annotation.NonNull public android.os.Bundle getExtras(); method public boolean getFontInflationEnabled(); method public float getFontSizeFactor(); @@ -248,17 +247,16 @@ package org.mozilla.geckoview { field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoRuntimeSettings> CREATOR; } @android.support.annotation.AnyThread public static final class GeckoRuntimeSettings.Builder extends org.mozilla.geckoview.RuntimeSettings.Builder<Settings extends org.mozilla.geckoview.RuntimeSettings> { ctor public Builder(); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder arguments(@android.support.annotation.NonNull java.lang.String[]); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder automaticFontSizeAdjustment(boolean); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder autoplayDefault(int); - method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder configFilePath(@android.support.annotation.Nullable java.lang.String); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder consoleOutput(boolean); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder contentBlocking(@android.support.annotation.NonNull org.mozilla.geckoview.ContentBlocking.Settings); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder crashHandler(java.lang.Class<?>); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDensityOverride(float); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDpiOverride(int); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder extras(@android.support.annotation.NonNull android.os.Bundle); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder fontInflation(boolean); method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder fontSizeFactor(float);
--- a/mobile/android/geckoview/build.gradle +++ b/mobile/android/geckoview/build.gradle @@ -211,17 +211,16 @@ tasks.withType(Javadoc) { throw new GradleException("Treating $warnings javadoc warning(s) as error(s)") } } } dependencies { implementation "com.android.support:support-v4:$support_library_version" implementation "com.android.support:palette-v7:$support_library_version" - implementation "org.yaml:snakeyaml:1.24:android" testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testImplementation 'junit:junit:4.12' testImplementation 'org.robolectric:robolectric:3.8' testImplementation 'org.mockito:mockito-core:1.10.19' androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" androidTestImplementation 'com.android.support.test:runner:1.0.2'
--- a/mobile/android/geckoview/proguard-rules.txt +++ b/mobile/android/geckoview/proguard-rules.txt @@ -164,16 +164,8 @@ *; } -keepclasseswithmembers class * { @org.mozilla.gecko.annotation.ReflectionTarget <methods>; } -keepclasseswithmembers class * { @org.mozilla.gecko.annotation.ReflectionTarget <fields>; } - -# Avoid "Warning: org.yaml.snakeyaml.scanner.ScannerImpl: can't find -# referenced method 'java.nio.ByteBuffer flip()' in library class -# java.nio.ByteBuffer". -# Between Java 1.8 and 1.9, the signature of `flip()` changed, which -# trips up proguard. - --dontwarn org.yaml.snakeyaml.scanner.ScannerImpl
deleted file mode 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/DebugConfig.java +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -package org.mozilla.gecko.util; - -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.util.Log; - -import org.mozilla.gecko.GeckoThread; -import org.yaml.snakeyaml.TypeDescription; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.constructor.Constructor; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DebugConfig { - private static final String LOGTAG = "GeckoDebugConfig"; - - protected Map<String, Object> prefs; - protected Map<String, String> env; - protected List<String> args; - - public static @NonNull DebugConfig fromFile(final @NonNull File configFile) throws FileNotFoundException { - final Constructor constructor = new Constructor(DebugConfig.class); - final TypeDescription description = new TypeDescription(DebugConfig.class); - description.putMapPropertyType("prefs", String.class, Object.class); - description.putMapPropertyType("env", String.class, String.class); - description.putListPropertyType("args", String.class); - - final Yaml yaml = new Yaml(constructor); - yaml.addTypeDescription(description); - - final FileInputStream fileInputStream = new FileInputStream(configFile); - try { - return yaml.load(fileInputStream); - } finally { - IOUtils.safeStreamClose(fileInputStream); - } - } - - public void mergeIntoInitInfo(final @NonNull GeckoThread.InitInfo info) { - if (env != null) { - Log.d(LOGTAG, "Adding environment variables from debug config: " + env); - - if (info.extras == null) { - info.extras = new Bundle(); - } - - int c = 0; - while (info.extras.getString("env" + c) != null) { - c += 1; - } - - for (final Map.Entry<String, String> entry : env.entrySet()) { - info.extras.putString("env" + c, entry.getKey() + "=" + entry.getValue()); - c += 1; - } - } - - if (args != null) { - Log.d(LOGTAG, "Adding arguments from debug config: " + args); - - final ArrayList<String> combinedArgs = new ArrayList<>(); - combinedArgs.addAll(Arrays.asList(info.args)); - combinedArgs.addAll(args); - - info.args = combinedArgs.toArray(new String[combinedArgs.size()]); - } - - if (prefs != null) { - Log.d(LOGTAG, "Adding prefs from debug config: " + prefs); - - final Map<String, Object> combinedPrefs = new HashMap<>(); - combinedPrefs.putAll(info.prefs); - combinedPrefs.putAll(prefs); - info.prefs = Collections.unmodifiableMap(prefs); - } - } -}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java @@ -3,54 +3,48 @@ * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.geckoview; import android.app.ActivityManager; import android.content.ComponentName; -import android.content.Context; import android.content.Intent; -import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; import android.content.res.Configuration; import android.os.Build; import android.os.Parcel; import android.os.Parcelable; +import android.content.Context; import android.os.Process; import android.support.annotation.AnyThread; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.UiThread; import android.util.Log; import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.GeckoAppShell; +import org.mozilla.gecko.GeckoSystemStateListener; import org.mozilla.gecko.GeckoScreenOrientation; -import org.mozilla.gecko.GeckoSystemStateListener; import org.mozilla.gecko.GeckoThread; import org.mozilla.gecko.PrefsHelper; import org.mozilla.gecko.util.BundleEventListener; -import org.mozilla.gecko.util.DebugConfig; import org.mozilla.gecko.util.EventCallback; import org.mozilla.gecko.util.GeckoBundle; import org.mozilla.gecko.util.ThreadUtils; -import org.yaml.snakeyaml.error.YAMLException; import java.io.File; -import java.io.FileNotFoundException; public final class GeckoRuntime implements Parcelable { private static final String LOGTAG = "GeckoRuntime"; private static final boolean DEBUG = false; - private static final String CONFIG_FILE_PATH_TEMPLATE = "/data/local/tmp/%s-geckoview-config.yaml"; - /** * Intent action sent to the crash handler when a crash is encountered. * @see GeckoRuntimeSettings.Builder#crashHandler(Class) */ public static final String ACTION_CRASHED = "org.mozilla.gecko.ACTION_CRASHED"; /** * This is a key for extra data sent with {@link #ACTION_CRASHED}. It refers @@ -216,38 +210,16 @@ public final class GeckoRuntime implemen GeckoFontScaleListener.getInstance().attachToContext(context, settings); final GeckoThread.InitInfo info = new GeckoThread.InitInfo(); info.args = settings.getArguments(); info.extras = settings.getExtras(); info.flags = flags; info.prefs = settings.getPrefsMap(); - String configFilePath = settings.getConfigFilePath(); - if (configFilePath == null) { - // Default to /data/local/tmp/$PACKAGE-geckoview-config.yaml if android:debuggable="true" - // and to not read configuration from a file if android:debuggable="false". - final ApplicationInfo applicationInfo = context.getApplicationInfo(); - final boolean isPackageDebuggable = (applicationInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; - if (isPackageDebuggable) { - configFilePath = String.format(CONFIG_FILE_PATH_TEMPLATE, applicationInfo.packageName); - } - } - - if (configFilePath != null && !configFilePath.isEmpty()) { - try { - final DebugConfig debugConfig = DebugConfig.fromFile(new File(configFilePath)); - Log.i(LOGTAG, "Adding debug configuration from: " + configFilePath); - debugConfig.mergeIntoInitInfo(info); - } catch (YAMLException e) { - Log.w(LOGTAG, "Failed to add debug configuration from: " + configFilePath, e); - } catch (FileNotFoundException e) { - } - } - if (!GeckoThread.init(info)) { Log.w(LOGTAG, "init failed (could not initiate GeckoThread)"); return false; } if (!GeckoThread.launch()) { Log.w(LOGTAG, "init failed (GeckoThread already launched)"); return false;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java @@ -73,29 +73,16 @@ public final class GeckoRuntimeSettings if (extras == null) { throw new IllegalArgumentException("Extras must not be null"); } getSettings().mExtras = extras; return this; } /** - * Path to configuration file from which GeckoView will read configuration options such as - * Gecko process arguments, environment variables, and preferences. - * - * @param configFilePath Configuration file path to read from, or <code>null</code> to use - * default location <code>/data/local/tmp/$PACKAGE-geckoview-config.yaml</code>. - * @return This Builder instance. - */ - public @NonNull Builder configFilePath(final @Nullable String configFilePath) { - getSettings().mConfigFilePath = configFilePath; - return this; - } - - /** * Set whether JavaScript support should be enabled. * * @param flag A flag determining whether JavaScript should be enabled. * Default is true. * @return This Builder instance. */ public @NonNull Builder javaScriptEnabled(final boolean flag) { getSettings().mJavaScript.set(flag); @@ -338,17 +325,16 @@ public final class GeckoRuntimeSettings return this; } } private GeckoRuntime mRuntime; /* package */ boolean mUseContentProcess; /* package */ String[] mArgs; /* package */ Bundle mExtras; - /* package */ String mConfigFilePath; /* package */ ContentBlocking.Settings mContentBlocking; public @NonNull ContentBlocking.Settings getContentBlocking() { return mContentBlocking; } /* package */ final Pref<Boolean> mJavaScript = new Pref<Boolean>( @@ -421,17 +407,16 @@ public final class GeckoRuntimeSettings mDebugPause = settings.mDebugPause; mUseMaxScreenDepth = settings.mUseMaxScreenDepth; mDisplayDensityOverride = settings.mDisplayDensityOverride; mDisplayDpiOverride = settings.mDisplayDpiOverride; mScreenWidthOverride = settings.mScreenWidthOverride; mScreenHeightOverride = settings.mScreenHeightOverride; mCrashHandler = settings.mCrashHandler; mRequestedLocales = settings.mRequestedLocales; - mConfigFilePath = settings.mConfigFilePath; } /* package */ void commit() { commitLocales(); commitResetPrefs(); } /** @@ -457,28 +442,16 @@ public final class GeckoRuntimeSettings * * @return The Gecko intent extras. */ public @NonNull Bundle getExtras() { return mExtras; } /** - * Path to configuration file from which GeckoView will read configuration options such as - * Gecko process arguments, environment variables, and preferences. - * - * @return Path to configuration file from which GeckoView will read configuration options, - * or <code>null</code> for default location - * <code>/data/local/tmp/$PACKAGE-geckoview-config.yaml</code>. - */ - public @Nullable String getConfigFilePath() { - return mConfigFilePath; - } - - /** * Get whether JavaScript support is enabled. * * @return Whether JavaScript support is enabled. */ public boolean getJavaScriptEnabled() { return mJavaScript.get(); } @@ -844,17 +817,16 @@ public final class GeckoRuntimeSettings ParcelableUtils.writeBoolean(out, mDebugPause); ParcelableUtils.writeBoolean(out, mUseMaxScreenDepth); out.writeFloat(mDisplayDensityOverride); out.writeInt(mDisplayDpiOverride); out.writeInt(mScreenWidthOverride); out.writeInt(mScreenHeightOverride); out.writeString(mCrashHandler != null ? mCrashHandler.getName() : null); out.writeStringArray(mRequestedLocales); - out.writeString(mConfigFilePath); } // AIDL code may call readFromParcel even though it's not part of Parcelable. public void readFromParcel(final @NonNull Parcel source) { super.readFromParcel(source); mUseContentProcess = ParcelableUtils.readBoolean(source); mArgs = source.createStringArray(); @@ -874,17 +846,16 @@ public final class GeckoRuntimeSettings (Class<? extends Service>) Class.forName(crashHandlerName); mCrashHandler = handler; } catch (ClassNotFoundException e) { } } mRequestedLocales = source.createStringArray(); - mConfigFilePath = source.readString(); } public static final Parcelable.Creator<GeckoRuntimeSettings> CREATOR = new Parcelable.Creator<GeckoRuntimeSettings>() { @Override public GeckoRuntimeSettings createFromParcel(final Parcel in) { final GeckoRuntimeSettings settings = new GeckoRuntimeSettings(); settings.readFromParcel(in);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md @@ -37,23 +37,16 @@ exclude: true [68.8]: ../GeckoSession.SessionState.html#fromString-java.lang.String- - Added [`GeckoRuntimeSettings#setPreferredColorScheme`][68.9] to override the default color theme for web content ("light" or "dark"). [68.9]: ../GeckoRuntimeSettings.html#setPreferredColorScheme-int- -- Added [`GeckoRuntimeSettings.Builder#configFilePath`][68.10] to set - a path to a configuration file from which GeckoView will read - configuration options such as Gecko process arguments, environment - variables, and preferences. - -[68.10]: ../GeckoRuntimeSettings.Builder.html#configFilePath-java.lang.String- - ## v67 - Added [`setAutomaticFontSizeAdjustment`][67.2] to [`GeckoRuntimeSettings`][67.3] for automatically adjusting font size settings depending on the OS-level font size setting. [67.2]: ../GeckoRuntimeSettings.html#setAutomaticFontSizeAdjustment-boolean- [67.3]: ../GeckoRuntimeSettings.html @@ -250,9 +243,9 @@ exclude: true [65.23]: ../GeckoSession.FinderResult.html - Update [`CrashReporter#sendCrashReport`][65.24] to return the crash ID as a [`GeckoResult<String>`][65.25]. [65.24]: ../CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String- [65.25]: ../GeckoResult.html -[api-version]: affe9cc5dc22f0700867a1ac7f9b55a033a4b88c +[api-version]: 053d9b4164690ff13996be9e7288dd183e2a1db4