Bug 1571088 - Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags r=geckoview-reviewers,snorp,droeh

Bug 1571088 - Add LOAD_FLAGS_REPLACE_HISTORY to GeckoSession LoadFlags

Differential Revision: https://phabricator.services.mozilla.com/D40908

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Randall E. Barker 2019-08-07 22:58:48 +00:00
Родитель 85cac89c70
Коммит 5911905e7c
4 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -465,6 +465,7 @@ package org.mozilla.geckoview {
field public static final int LOAD_FLAGS_EXTERNAL = 4; field public static final int LOAD_FLAGS_EXTERNAL = 4;
field public static final int LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 32; field public static final int LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 32;
field public static final int LOAD_FLAGS_NONE = 0; field public static final int LOAD_FLAGS_NONE = 0;
field public static final int LOAD_FLAGS_REPLACE_HISTORY = 64;
field @Nullable protected GeckoSession.Window mWindow; field @Nullable protected GeckoSession.Window mWindow;
} }

Просмотреть файл

@ -1486,7 +1486,7 @@ public class GeckoSession implements Parcelable {
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, @IntDef(flag = true,
value = { LOAD_FLAGS_NONE, LOAD_FLAGS_BYPASS_CACHE, LOAD_FLAGS_BYPASS_PROXY, value = { LOAD_FLAGS_NONE, LOAD_FLAGS_BYPASS_CACHE, LOAD_FLAGS_BYPASS_PROXY,
LOAD_FLAGS_EXTERNAL, LOAD_FLAGS_ALLOW_POPUPS, LOAD_FLAGS_FORCE_ALLOW_DATA_URI }) LOAD_FLAGS_EXTERNAL, LOAD_FLAGS_ALLOW_POPUPS, LOAD_FLAGS_FORCE_ALLOW_DATA_URI, LOAD_FLAGS_REPLACE_HISTORY })
/* package */ @interface LoadFlags {} /* package */ @interface LoadFlags {}
// These flags follow similarly named ones in Gecko's nsIWebNavigation.idl // These flags follow similarly named ones in Gecko's nsIWebNavigation.idl
@ -1531,6 +1531,11 @@ public class GeckoSession implements Parcelable {
*/ */
public static final int LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 1 << 5; public static final int LOAD_FLAGS_FORCE_ALLOW_DATA_URI = 1 << 5;
/**
* This flag specifies that any existing history entry should be replaced.
*/
public static final int LOAD_FLAGS_REPLACE_HISTORY = 1 << 6;
/** /**
* Load the given URI. * Load the given URI.
* @param uri The URI of the resource to load. * @param uri The URI of the resource to load.

Просмотреть файл

@ -12,6 +12,8 @@ exclude: true
## v70 ## v70
- Add GeckoSession.LOAD_FLAGS_REPLACE_HISTORY
- Removed the obsolete `success` parameter from - Removed the obsolete `success` parameter from
[`CrashReporter#sendCrashReport(Context, File, File, String)`][70.3] and [`CrashReporter#sendCrashReport(Context, File, File, String)`][70.3] and
[`CrashReporter#sendCrashReport(Context, File, Map, String)`][70.4]. [`CrashReporter#sendCrashReport(Context, File, Map, String)`][70.4].
@ -289,4 +291,4 @@ exclude: true
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String- [65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
[65.25]: {{javadoc_uri}}/GeckoResult.html [65.25]: {{javadoc_uri}}/GeckoResult.html
[api-version]: b101f0344e941cb50eaaf75326e126ce3efc52b4 [api-version]: d2e22c0efa7c1dbec1f68965e035a9ccc47eca39

Просмотреть файл

@ -134,6 +134,10 @@ class GeckoViewNavigation extends GeckoViewModule {
navFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI; navFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
} }
if (flags & (1 << 6)) {
navFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
}
if (this.settings.useMultiprocess) { if (this.settings.useMultiprocess) {
this.moduleManager.updateRemoteTypeForURI(uri); this.moduleManager.updateRemoteTypeForURI(uri);
} }