Backed out changeset 21632bd4c4ca (bug 1596588) for ESlint failures in android/modules/geckoview/GeckoViewPushController.jsm. CLOSED TREE

This commit is contained in:
Dorel Luca 2019-11-19 19:14:24 +02:00
Родитель 943da6f446
Коммит c75213f45a
5 изменённых файлов: 16 добавлений и 19 удалений

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

@ -1498,8 +1498,8 @@ package org.mozilla.geckoview {
}
public class WebPushController {
method @UiThread public void onPushEvent(@NonNull String);
method @UiThread public void onPushEvent(@NonNull String, @Nullable byte[]);
method @UiThread public void onPushEvent(@NonNull WebPushSubscription);
method @UiThread public void onPushEvent(@NonNull WebPushSubscription, @Nullable byte[]);
method @UiThread public void onSubscriptionChanged(@NonNull WebPushSubscription);
method @UiThread public void setDelegate(@Nullable WebPushDelegate);
}

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

@ -149,7 +149,7 @@ class WebPushTest : BaseSessionTest() {
val p = mainSession.evaluatePromiseJS("window.doWaitForPushEvent()")
val testPayload = "The Payload";
sessionRule.runtime.webPushController.onPushEvent(delegate!!.storedSubscription!!.scope, testPayload.toByteArray(Charsets.UTF_8))
sessionRule.runtime.webPushController.onPushEvent(delegate!!.storedSubscription!!, testPayload.toByteArray(Charsets.UTF_8))
assertThat("Push data should match", p.value as String, equalTo(testPayload))
}

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

@ -44,25 +44,26 @@ public class WebPushController {
/**
* Send a push event for a given subscription.
*
* @param scope The Service Worker scope associated with this subscription.
* @param subscription The WebPushSubscription that the event belongs to.
*/
@UiThread
public void onPushEvent(final @NonNull String scope) {
public void onPushEvent(final @NonNull WebPushSubscription subscription) {
ThreadUtils.assertOnUiThread();
onPushEvent(scope, null);
onPushEvent(subscription, null);
}
/**
* Send a push event with a payload for a given subscription.
* @param scope The Service Worker scope associated with this subscription.
*
* @param subscription The WebPushSubscription that the event belongs to.
* @param data The unencrypted payload.
*/
@UiThread
public void onPushEvent(final @NonNull String scope, final @Nullable byte[] data) {
public void onPushEvent(final @NonNull WebPushSubscription subscription, final @Nullable byte[] data) {
ThreadUtils.assertOnUiThread();
final GeckoBundle msg = new GeckoBundle(2);
msg.putString("scope", scope);
msg.putBundle("subscription", subscription.toBundle());
msg.putString("data", Base64Utils.encode(data));
EventDispatcher.getInstance().dispatch("GeckoView:PushEvent", msg);
}

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

@ -46,7 +46,6 @@ exclude: true
- ⚠️ Split [`ContentBlockingController.Event.LOADED_TRACKING_CONTENT`][72.15] into
[`ContentBlockingController.Event.LOADED_LEVEL_1_TRACKING_CONTENT`][72.16] and
[`ContentBlockingController.Event.LOADED_LEVEL_2_TRACKING_CONTENT`][72.17].
- Replaced `subscription` argument in [`WebPushDelegate.onPushEvent`][72.18] from a [`WebPushSubscription`][72.19] to the [`String`][72.20] `scope`.
[72.1]: {{javadoc_uri}}/GeckoSession.NavigationDelegate.LoadRequest#hasUserGesture-
[72.2]: {{javadoc_uri}}/Autofill.html
@ -65,9 +64,6 @@ exclude: true
[72.15]: {{javadoc_uri}}/ContentBlockingController.Event.html#LOADED_TRACKING_CONTENT
[72.16]: {{javadoc_uri}}/ContentBlockingController.Event.html#LOADED_LEVEL_1_TRACKING_CONTENT
[72.17]: {{javadoc_uri}}/ContentBlockingController.Event.html#LOADED_LEVEL_2_TRACKING_CONTENT
[72.18]: {{javadoc_uri}}/WebPushController.html#onPushEvent-org.mozilla.geckoview.WebPushSubscription-byte:A-
[72.19]: {{javadoc_uri}}/WebPushSubscription.html
[72.20]: https://developer.android.com/reference/java/lang/String
## v71
- Added a content blocking flag for blocked social cookies to [`ContentBlocking`][70.17].
@ -224,7 +220,7 @@ exclude: true
[70.28]: {{javadoc_uri}}/GeckoRuntime.html#getContentBlockingController--
## v69
- Modified behavior of ['setAutomaticFontSizeAdjustment'][69.1] so that it no
- Modified behavior of ['setAutomaticFontSizeAdjustment'][69.1] so that it no
longer has any effect on ['setFontInflationEnabled'][69.2]
- Add [GeckoSession.LOAD_FLAGS_FORCE_ALLOW_DATA_URI][69.14]
- Added [`GeckoResult.accept`][69.3] for consuming a result without
@ -261,7 +257,7 @@ exclude: true
- [`RuntimeTelemetry#getSnapshots`][68.10] returns a [`JSONObject`][68.30] now.
- Removed all `org.mozilla.gecko` references in the API.
- Added [`ContentBlocking#AT_FINGERPRINTING`][68.11] to block fingerprinting trackers.
- Added [`HistoryItem`][68.31] and [`HistoryList`][68.32] interfaces and [`onHistoryStateChange`][68.34] to
- Added [`HistoryItem`][68.31] and [`HistoryList`][68.32] interfaces and [`onHistoryStateChange`][68.34] to
[`HistoryDelegate`][68.12] and added [`gotoHistoryIndex`][68.33] to [`GeckoSession`][68.13].
- [`GeckoView`][70.5] will not create a [`GeckoSession`][65.9] anymore when
attached to a window without a session.
@ -455,14 +451,14 @@ exclude: true
[65.14]: {{javadoc_uri}}/WebRequest.html
[65.15]: {{javadoc_uri}}/WebResponse.html
[65.16]: {{javadoc_uri}}/GeckoWebExecutor.html
[65.17]: {{javadoc_uri}}/GeckoSession.HistoryDelegate.html
[65.17]: {{javadoc_uri}}/GeckoSession.HistoryDelegate.html
[65.18]: {{javadoc_uri}}/GeckoSession.ContentDelegate.html#onFirstComposite-org.mozilla.geckoview.GeckoSession-
[65.19]: {{javadoc_uri}}/GeckoSession.NavigationDelegate.LoadRequest.html#isRedirect
[65.20]: {{javadoc_uri}}/GeckoSession.html#LOAD_FLAGS_BYPASS_CLASSIFIER
[65.20]: {{javadoc_uri}}/GeckoSession.html#LOAD_FLAGS_BYPASS_CLASSIFIER
[65.21]: {{javadoc_uri}}/GeckoSession.ContentDelegate.ContextElement.html
[65.22]: {{javadoc_uri}}/GeckoSession.ContentDelegate.html#onContextMenu-org.mozilla.geckoview.GeckoSession-int-int-org.mozilla.geckoview.GeckoSession.ContentDelegate.ContextElement-
[65.23]: {{javadoc_uri}}/GeckoSession.FinderResult.html
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
[65.25]: {{javadoc_uri}}/GeckoResult.html
[api-version]: 4c9f04038d8478206efac05b518920819faeacea
[api-version]: d4fbf3825322768a22d225f79c659bfd36eebbc6

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

@ -44,7 +44,7 @@ const GeckoViewPushController = {
switch (aEvent) {
case "GeckoView:PushEvent": {
const {
scope,
subscription: { scope },
data,
} = aData;