From 560a0b51bed96516b2e90e68232f7507c7731169 Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Thu, 16 Apr 2026 08:08:26 +0200 Subject: [PATCH] deprecate and strip pref manager extension; rebuild pigeons; --- .../repositories/preference_settings.dart | 45 +- .../repositories/preference_settings.g.dart | 77 +- .../assets/extensions/pref_manager/api.js | 35 - .../extensions/pref_manager/background.js | 36 - .../extensions/pref_manager/manifest.json | 39 - .../extensions/pref_manager/schema.json | 22 - .../EngineProvider.kt | 2 - .../api/GeckoPrefApiImpl.kt | 45 +- .../feature/PrefManagerFeature.kt | 107 - .../pigeons/Gecko.g.kt | 1338 +++++- .../lib/src/domain/services/gecko_pref.dart | 8 - .../lib/src/pigeons/gecko.g.dart | 4058 +++++++---------- .../pigeons/gecko.dart | 2 - .../flutter_tor/generated/TorApi.g.kt | 186 +- packages/flutter_tor/lib/src/tor_api.g.dart | 265 +- .../locale_resolver/pigeons/Locales.g.kt | 153 +- .../lib/src/pigeons/locales.g.dart | 125 +- .../pigeons/Intent.g.kt | 157 +- .../lib/src/pigeons/intent.g.dart | 90 +- .../pigeons/SpeechToText.g.kt | 2 +- .../lib/src/pigeons/speech_to_text.g.dart | 72 +- 21 files changed, 3497 insertions(+), 3367 deletions(-) delete mode 100644 packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/api.js delete mode 100644 packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/background.js delete mode 100644 packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/manifest.json delete mode 100644 packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/schema.json delete mode 100644 packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/feature/PrefManagerFeature.kt diff --git a/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.dart b/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.dart index 310e85b9..ce0f604d 100644 --- a/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.dart +++ b/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.dart @@ -125,11 +125,22 @@ Future _preferenceSettingGroup( @Riverpod() class _PreferenceRepository extends _$PreferenceRepository { final _prefManager = GeckoPrefService(); - // Use BehaviorSubject instead of StreamController late BehaviorSubject> _prefSubject; Future _updatePrefs() async { - final prefs = await _prefManager.getAllPrefs(); + final groups = await ref.read( + _preferenceSettingGroupsProvider(partition).future, + ); + + final prefNames = groups.values + .map((group) => group.settings.keys) + .flattened + .toList(); + + final prefs = prefNames.isEmpty + ? {} + : await _prefManager.getPrefs(prefNames); + _prefSubject.add(prefs); } @@ -144,18 +155,28 @@ class _PreferenceRepository extends _$PreferenceRepository { } @override - Raw>> build() { + Raw>> build( + PreferencePartition partition, + ) async* { + final prefCompleter = Completer(); + _prefSubject = BehaviorSubject>(); ref.onDispose(() async { await _prefSubject.close(); }); - ref.onAddListener(() async { - await _updatePrefs(); + ref.onAddListener(() { + if (prefCompleter.isCompleted) { + ref.invalidateSelf(); + } }); - return _prefSubject.stream; + await _updatePrefs().whenComplete(() { + prefCompleter.complete(); + }); + + yield* _prefSubject.stream; } } @@ -166,7 +187,7 @@ class UnifiedPreferenceSettingsRepository Future apply() async { final preferenceRepository = ref.read( - _preferenceRepositoryProvider.notifier, + _preferenceRepositoryProvider(partition).notifier, ); _statelessGroups = await ref.read( @@ -187,7 +208,7 @@ class UnifiedPreferenceSettingsRepository Future reset() async { final preferenceRepository = ref.read( - _preferenceRepositoryProvider.notifier, + _preferenceRepositoryProvider(partition).notifier, ); _statelessGroups = await ref.read( @@ -210,7 +231,7 @@ class UnifiedPreferenceSettingsRepository _preferenceSettingGroupsProvider(partition).future, ); - final prefStream = ref.watch(_preferenceRepositoryProvider); + final prefStream = ref.watch(_preferenceRepositoryProvider(partition)); yield* prefStream.map( (prefs) => _statelessGroups!.map( @@ -235,7 +256,7 @@ class PreferenceSettingsGroupRepository Future apply({List? filter}) async { final preferenceRepository = ref.read( - _preferenceRepositoryProvider.notifier, + _preferenceRepositoryProvider(partition).notifier, ); _statelessSettingGroup ??= await ref.read( @@ -260,7 +281,7 @@ class PreferenceSettingsGroupRepository Future reset({List? filter}) async { final preferenceRepository = ref.read( - _preferenceRepositoryProvider.notifier, + _preferenceRepositoryProvider(partition).notifier, ); _statelessSettingGroup ??= await ref.read( @@ -288,7 +309,7 @@ class PreferenceSettingsGroupRepository _preferenceSettingGroupProvider(partition, groupName).future, ); - final prefStream = ref.watch(_preferenceRepositoryProvider); + final prefStream = ref.watch(_preferenceRepositoryProvider(partition)); yield* prefStream.map( (prefs) => _statelessSettingGroup!.copyWith.settings( diff --git a/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart b/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart index a5136dad..a44e216f 100644 --- a/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart +++ b/apps/weblibre/lib/features/geckoview/features/preferences/data/repositories/preference_settings.g.dart @@ -279,7 +279,7 @@ final class _PreferenceSettingGroupFamily extends $Family } @ProviderFor(_PreferenceRepository) -final _preferenceRepositoryProvider = _PreferenceRepositoryProvider._(); +final _preferenceRepositoryProvider = _PreferenceRepositoryFamily._(); final class _PreferenceRepositoryProvider extends @@ -287,20 +287,27 @@ final class _PreferenceRepositoryProvider _PreferenceRepository, Raw>> > { - _PreferenceRepositoryProvider._() - : super( - from: null, - argument: null, - retry: null, - name: r'_preferenceRepositoryProvider', - isAutoDispose: true, - dependencies: null, - $allTransitiveDependencies: null, - ); + _PreferenceRepositoryProvider._({ + required _PreferenceRepositoryFamily super.from, + required PreferencePartition super.argument, + }) : super( + retry: null, + name: r'_preferenceRepositoryProvider', + isAutoDispose: true, + dependencies: null, + $allTransitiveDependencies: null, + ); @override String debugGetCreateSourceHash() => _$_preferenceRepositoryHash(); + @override + String toString() { + return r'_preferenceRepositoryProvider' + '' + '($argument)'; + } + @$internal @override _PreferenceRepository create() => _PreferenceRepository(); @@ -314,14 +321,52 @@ final class _PreferenceRepositoryProvider ), ); } + + @override + bool operator ==(Object other) { + return other is _PreferenceRepositoryProvider && other.argument == argument; + } + + @override + int get hashCode { + return argument.hashCode; + } } String _$_preferenceRepositoryHash() => - r'0f6812988a23407f6648e32fb1585984d2433bbc'; + r'b7a0aab286dd1f8da758de5cf259ad0c14b733d9'; + +final class _PreferenceRepositoryFamily extends $Family + with + $ClassFamilyOverride< + _PreferenceRepository, + Raw>>, + Raw>>, + Raw>>, + PreferencePartition + > { + _PreferenceRepositoryFamily._() + : super( + retry: null, + name: r'_preferenceRepositoryProvider', + dependencies: null, + $allTransitiveDependencies: null, + isAutoDispose: true, + ); + + _PreferenceRepositoryProvider call(PreferencePartition partition) => + _PreferenceRepositoryProvider._(argument: partition, from: this); + + @override + String toString() => r'_preferenceRepositoryProvider'; +} abstract class _$PreferenceRepository extends $Notifier>>> { - Raw>> build(); + late final _$args = ref.$arg as PreferencePartition; + PreferencePartition get partition => _$args; + + Raw>> build(PreferencePartition partition); @$mustCallSuper @override void runBuild() { @@ -342,7 +387,7 @@ abstract class _$PreferenceRepository Object?, Object? >; - element.handleCreate(ref, build); + element.handleCreate(ref, () => build(_$args)); } } @@ -396,7 +441,7 @@ final class UnifiedPreferenceSettingsRepositoryProvider } String _$unifiedPreferenceSettingsRepositoryHash() => - r'800e74a051113b4ebc3631b6ade55d66cb7e1af1'; + r'03c8c2f247974ff32bba14b4b34857a0f14f6f37'; final class UnifiedPreferenceSettingsRepositoryFamily extends $Family with @@ -509,7 +554,7 @@ final class PreferenceSettingsGroupRepositoryProvider } String _$preferenceSettingsGroupRepositoryHash() => - r'8e025cdea5cef8a6ea029db6f9ebcd86abf906d8'; + r'b5c439643ec78094122c33983e58d0977641832a'; final class PreferenceSettingsGroupRepositoryFamily extends $Family with diff --git a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/api.js b/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/api.js deleted file mode 100644 index 756fc0da..00000000 --- a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/api.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -const { BackgroundTasksUtils } = ChromeUtils.importESModule( - "resource://gre/modules/BackgroundTasksUtils.sys.mjs" -); - -const lazy = {}; - -ChromeUtils.defineLazyGetter(lazy, "log", () => { - let { ConsoleAPI } = ChromeUtils.importESModule( - "resource://gre/modules/Console.sys.mjs" - ); - let consoleOptions = { - // tip: set maxLogLevel to "debug" and use log.debug() to create detailed - // messages during development. See LOG_LEVELS in Console.sys.mjs for details. - maxLogLevel: "error", - maxLogLevelPref: "app.update.background.loglevel", - prefix: "PrefsManager", - }; - return new ConsoleAPI(consoleOptions); -}); - -var prefmanager = class extends ExtensionAPI { - getAPI(context) { - return { - experiments: { - prefmanager: { - async getPrefList() { - return Services.prefs.getChildList(""); - } - } - } - }; - } -}; diff --git a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/background.js b/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/background.js deleted file mode 100644 index a741a9d1..00000000 --- a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/background.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const encoder = new TextEncoder(); - -const port = browser.runtime.connectNative("prefManager"); - -function sendJsonResultForRequest(id) { - return function (result) { - port.postMessage({ - "id": id, - "status": "success", - "result": result - }) - } -} - -function sendErrorForRequest(id) { - return function (error) { - console.error(error); - port.postMessage({ - "id": id, - "status": "error", - "error": error - }); - } -} - -port.onMessage.addListener(message => { - let requestId = message["id"] - switch (message["action"]) { - case "getPrefList": - browser.experiments.prefmanager.getPrefList() - .then(sendJsonResultForRequest(requestId)) - .catch(sendErrorForRequest(requestId)) - } -}); diff --git a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/manifest.json b/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/manifest.json deleted file mode 100644 index f722709a..00000000 --- a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/manifest.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "manifest_version": 2, - "name": "Pref Manager", - "version": "1.0", - "description": "Manipulate GeckoView preferences", - "browser_specific_settings": { - "gecko": { - "id": "pref-manager@weblibre.eu" - } - }, - "background": { - "scripts": [ - "background.js" - ] - }, - "experiment_apis": { - "prefmanager": { - "schema": "schema.json", - "parent": { - "scopes": [ - "addon_parent" - ], - "paths": [ - [ - "experiments", - "prefmanager" - ] - ], - "script": "api.js" - } - } - }, - "permissions": [ - "nativeMessaging", - "nativeMessagingFromContent", - "geckoViewAddons", - "" - ] -} \ No newline at end of file diff --git a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/schema.json b/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/schema.json deleted file mode 100644 index 1d062c32..00000000 --- a/packages/flutter_mozilla_components/android/src/main/assets/extensions/pref_manager/schema.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "namespace": "experiments.prefmanager", - "description": "Experimental API for updating Geckoview preferences", - "functions": [ - { - "name": "getPrefList", - "type": "function", - "description": "Retrieves list of all preferences", - "async": true, - "parameters": [], - "returns": { - "array": "object", - "description": "Object containing the preferences as key-value pairs", - "items": { - "type": "string" - } - } - } - ] - } -] \ No newline at end of file diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/EngineProvider.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/EngineProvider.kt index f9a9d25f..a23062f2 100644 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/EngineProvider.kt +++ b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/EngineProvider.kt @@ -7,7 +7,6 @@ package eu.weblibre.flutter_mozilla_components import android.content.Context import eu.weblibre.flutter_mozilla_components.feature.ContainerProxyFeature import eu.weblibre.flutter_mozilla_components.feature.CookieManagerFeature -import eu.weblibre.flutter_mozilla_components.feature.PrefManagerFeature import eu.weblibre.flutter_mozilla_components.feature.BrowserExtensionFeature import eu.weblibre.flutter_mozilla_components.feature.MLEngineFeature import eu.weblibre.flutter_mozilla_components.pigeons.BounceTrackingProtectionMode @@ -122,7 +121,6 @@ object EngineProvider { return GeckoEngine(context, defaultSettings, runtime).also { WebCompatFeature.install(it) //CookieManagerFeature.install(it) - PrefManagerFeature.install(it) ContainerProxyFeature.install(it, stateEvents) BrowserExtensionFeature.install(it, extensionEvents) MLEngineFeature.install(it) diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoPrefApiImpl.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoPrefApiImpl.kt index 7812a0e8..72d1fc53 100644 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoPrefApiImpl.kt +++ b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/api/GeckoPrefApiImpl.kt @@ -8,61 +8,18 @@ package eu.weblibre.flutter_mozilla_components.api import eu.weblibre.flutter_mozilla_components.GlobalComponents import eu.weblibre.flutter_mozilla_components.ext.EventSequence -import eu.weblibre.flutter_mozilla_components.feature.PrefManagerFeature -import eu.weblibre.flutter_mozilla_components.feature.ResultConsumer import eu.weblibre.flutter_mozilla_components.pigeons.GeckoPref import eu.weblibre.flutter_mozilla_components.pigeons.GeckoPrefApi import mozilla.components.ExperimentalAndroidComponentsApi import mozilla.components.concept.engine.preferences.Branch import mozilla.components.concept.engine.preferences.BrowserPrefObserverDelegate import mozilla.components.concept.engine.preferences.BrowserPreference -import mozilla.components.support.ktx.android.org.json.toList -import org.json.JSONObject -import org.json.JSONArray class GeckoPrefApiImpl : GeckoPrefApi, BrowserPrefObserverDelegate { private val components by lazy { requireNotNull(GlobalComponents.components) { "Components not initialized" } } - private fun List?.toJson(): JSONArray { - return JSONArray().apply { - this@toJson?.forEach { put(it) } - } - } - - fun JSONObject.toMap(): Map { - val map = mutableMapOf() - val keys = this.keys() - - while (keys.hasNext()) { - val key = keys.next() - when (val value = this.get(key)) { - is JSONObject -> map[key] = value.toMap() -// is JSONArray -> map[key] = value.toList() -// JSONObject.NULL -> map[key] = null - else -> map[key] = value - } - } - - return map - } - - override fun getPrefList(callback: (Result>) -> Unit) { - PrefManagerFeature.scheduleRequest( - "getPrefList", - Unit, - object : ResultConsumer { - override fun success(result: JSONObject) { - callback(Result.success(result.getJSONArray("result").toList())) - } - - override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) { - callback(Result.failure(Exception("$errorCode $errorMessage $errorDetails"))) - } - }) - } - @OptIn(ExperimentalAndroidComponentsApi::class) override fun getPrefs( preferenceFilter: List, @@ -212,4 +169,4 @@ class GeckoPrefApiImpl : GeckoPrefApi, BrowserPrefObserverDelegate { ) ) { _ -> } } -} \ No newline at end of file +} diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/feature/PrefManagerFeature.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/feature/PrefManagerFeature.kt deleted file mode 100644 index 65e1f3eb..00000000 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/feature/PrefManagerFeature.kt +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 https://mozilla.org/MPL/2.0/. - */ - -package eu.weblibre.flutter_mozilla_components.feature - -import androidx.annotation.VisibleForTesting -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.runBlocking -import kotlinx.coroutines.sync.Mutex -import kotlinx.coroutines.sync.withLock -import kotlinx.coroutines.withContext -import mozilla.components.concept.engine.webextension.MessageHandler -import mozilla.components.concept.engine.webextension.Port -import mozilla.components.concept.engine.webextension.WebExtensionRuntime -import mozilla.components.support.base.log.logger.Logger -import mozilla.components.support.webextensions.BuiltInWebExtensionController -import org.json.JSONObject - -object PrefManagerFeature { - private val logger = Logger("pref-manager") - - private const val PREF_MANAGER_REPORTER_EXTENSION_ID = "pref-manager@weblibre.eu" - private const val PREF_MANAGER_REPORTER_EXTENSION_URL = "resource://android/assets/extensions/pref_manager/" - private const val PREF_MANAGER_REPORTER_MESSAGING_ID = "prefManager" - - private var nextRequestId: Int = 0 - private val requestHandlers = HashMap>() - private val mutex = Mutex() - - @VisibleForTesting - // This is an internal var to make it mutable for unit testing purposes only - internal var extensionController = BuiltInWebExtensionController( - PREF_MANAGER_REPORTER_EXTENSION_ID, - PREF_MANAGER_REPORTER_EXTENSION_URL, - PREF_MANAGER_REPORTER_MESSAGING_ID, - ) - - fun scheduleRequest(command: String, args: Any, callback: ResultConsumer) { - val message = JSONObject() - message.put("action", command); - message.put("args", args) - - runBlocking { - withContext(Dispatchers.Default) { - mutex.withLock { - message.put("id", nextRequestId) - - requestHandlers[nextRequestId] = callback - - nextRequestId += 1 - - extensionController.sendBackgroundMessage(message) - } - } - } - } - - private class PrefManagerReporterBackgroundMessageHandler() : MessageHandler { - override fun onPortMessage(message: Any, port: Port) { - runBlocking { - withContext(Dispatchers.Default) { - mutex.withLock { - val messageJSON = message as JSONObject; - - val requestId = messageJSON.getInt("id") - val status = messageJSON.getString("status") - val handler = requestHandlers.remove(requestId) - if (status == "success") { - handler?.success(message) - } else { - handler?.error( - "Pref Manager", - "Failed to perform operation", - message.getString("error") - ) - } - } - } - } - } - } - - /** - * Installs the web extension in the runtime through the WebExtensionRuntime install method - * - * @param runtime a WebExtensionRuntime. - * @param productName a custom product name used to automatically label reports. Defaults to - * "android-components". - */ - fun install(runtime: WebExtensionRuntime) { - extensionController.registerBackgroundMessageHandler( - PrefManagerReporterBackgroundMessageHandler(), - ) - extensionController.install( - runtime, - onSuccess = { - logger.debug("Installed PrefManager webextension: ${it.id}") - }, - onError = { throwable -> - logger.error("Failed to install PrefManager webextension: ", throwable) - }, - ) - } -} diff --git a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/pigeons/Gecko.g.kt b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/pigeons/Gecko.g.kt index b7f95c1f..fedffe40 100644 --- a/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/pigeons/Gecko.g.kt +++ b/packages/flutter_mozilla_components/android/src/main/kotlin/eu/weblibre/flutter_mozilla_components/pigeons/Gecko.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -37,36 +37,150 @@ private object GeckoPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -627,15 +741,21 @@ data class TranslationOptions ( ) } override fun equals(other: Any?): Boolean { - if (other !is TranslationOptions) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TranslationOptions + return GeckoPigeonUtils.deepEquals(this.downloadModel, other.downloadModel) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.downloadModel) + return result + } } /** @@ -662,15 +782,22 @@ data class TranslationLanguage ( ) } override fun equals(other: Any?): Boolean { - if (other !is TranslationLanguage) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TranslationLanguage + return GeckoPigeonUtils.deepEquals(this.code, other.code) && GeckoPigeonUtils.deepEquals(this.localizedDisplayName, other.localizedDisplayName) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.code) + result = 31 * result + GeckoPigeonUtils.deepHash(this.localizedDisplayName) + return result + } } /** @@ -700,15 +827,23 @@ data class TranslationDetectedLanguages ( ) } override fun equals(other: Any?): Boolean { - if (other !is TranslationDetectedLanguages) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TranslationDetectedLanguages + return GeckoPigeonUtils.deepEquals(this.documentLangTag, other.documentLangTag) && GeckoPigeonUtils.deepEquals(this.supportedDocumentLang, other.supportedDocumentLang) && GeckoPigeonUtils.deepEquals(this.userPreferredLangTag, other.userPreferredLangTag) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.documentLangTag) + result = 31 * result + GeckoPigeonUtils.deepHash(this.supportedDocumentLang) + result = 31 * result + GeckoPigeonUtils.deepHash(this.userPreferredLangTag) + return result + } } /** @@ -735,15 +870,22 @@ data class TranslationPair ( ) } override fun equals(other: Any?): Boolean { - if (other !is TranslationPair) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TranslationPair + return GeckoPigeonUtils.deepEquals(this.fromLanguage, other.fromLanguage) && GeckoPigeonUtils.deepEquals(this.toLanguage, other.toLanguage) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.fromLanguage) + result = 31 * result + GeckoPigeonUtils.deepHash(this.toLanguage) + return result + } } /** @@ -773,15 +915,23 @@ data class TranslationEngineStateData ( ) } override fun equals(other: Any?): Boolean { - if (other !is TranslationEngineStateData) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TranslationEngineStateData + return GeckoPigeonUtils.deepEquals(this.isEngineSupported, other.isEngineSupported) && GeckoPigeonUtils.deepEquals(this.fromLanguages, other.fromLanguages) && GeckoPigeonUtils.deepEquals(this.toLanguages, other.toLanguages) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.isEngineSupported) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fromLanguages) + result = 31 * result + GeckoPigeonUtils.deepHash(this.toLanguages) + return result + } } /** @@ -835,15 +985,31 @@ data class TabTranslationStateData ( ) } override fun equals(other: Any?): Boolean { - if (other !is TabTranslationStateData) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TabTranslationStateData + return GeckoPigeonUtils.deepEquals(this.tabId, other.tabId) && GeckoPigeonUtils.deepEquals(this.isTranslated, other.isTranslated) && GeckoPigeonUtils.deepEquals(this.isTranslateProcessing, other.isTranslateProcessing) && GeckoPigeonUtils.deepEquals(this.isOfferTranslate, other.isOfferTranslate) && GeckoPigeonUtils.deepEquals(this.isExpectedTranslate, other.isExpectedTranslate) && GeckoPigeonUtils.deepEquals(this.detectedLanguageCode, other.detectedLanguageCode) && GeckoPigeonUtils.deepEquals(this.userPreferredLanguageCode, other.userPreferredLanguageCode) && GeckoPigeonUtils.deepEquals(this.requestedFromLanguage, other.requestedFromLanguage) && GeckoPigeonUtils.deepEquals(this.requestedToLanguage, other.requestedToLanguage) && GeckoPigeonUtils.deepEquals(this.translationErrorName, other.translationErrorName) && GeckoPigeonUtils.deepEquals(this.displayError, other.displayError) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.tabId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isTranslated) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isTranslateProcessing) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isOfferTranslate) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isExpectedTranslate) + result = 31 * result + GeckoPigeonUtils.deepHash(this.detectedLanguageCode) + result = 31 * result + GeckoPigeonUtils.deepHash(this.userPreferredLanguageCode) + result = 31 * result + GeckoPigeonUtils.deepHash(this.requestedFromLanguage) + result = 31 * result + GeckoPigeonUtils.deepHash(this.requestedToLanguage) + result = 31 * result + GeckoPigeonUtils.deepHash(this.translationErrorName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.displayError) + return result + } } /** @@ -904,15 +1070,27 @@ data class ReaderState ( ) } override fun equals(other: Any?): Boolean { - if (other !is ReaderState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ReaderState + return GeckoPigeonUtils.deepEquals(this.readerable, other.readerable) && GeckoPigeonUtils.deepEquals(this.active, other.active) && GeckoPigeonUtils.deepEquals(this.checkRequired, other.checkRequired) && GeckoPigeonUtils.deepEquals(this.connectRequired, other.connectRequired) && GeckoPigeonUtils.deepEquals(this.baseUrl, other.baseUrl) && GeckoPigeonUtils.deepEquals(this.activeUrl, other.activeUrl) && GeckoPigeonUtils.deepEquals(this.scrollY, other.scrollY) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.readerable) + result = 31 * result + GeckoPigeonUtils.deepHash(this.active) + result = 31 * result + GeckoPigeonUtils.deepHash(this.checkRequired) + result = 31 * result + GeckoPigeonUtils.deepHash(this.connectRequired) + result = 31 * result + GeckoPigeonUtils.deepHash(this.baseUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.activeUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.scrollY) + return result + } } /** @@ -960,15 +1138,29 @@ data class AddTabParams ( ) } override fun equals(other: Any?): Boolean { - if (other !is AddTabParams) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AddTabParams + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.startLoading, other.startLoading) && GeckoPigeonUtils.deepEquals(this.parentId, other.parentId) && GeckoPigeonUtils.deepEquals(this.flags, other.flags) && GeckoPigeonUtils.deepEquals(this.contextId, other.contextId) && GeckoPigeonUtils.deepEquals(this.source, other.source) && GeckoPigeonUtils.deepEquals(this.private, other.private) && GeckoPigeonUtils.deepEquals(this.historyMetadata, other.historyMetadata) && GeckoPigeonUtils.deepEquals(this.additionalHeaders, other.additionalHeaders) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.startLoading) + result = 31 * result + GeckoPigeonUtils.deepHash(this.parentId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.flags) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contextId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.source) + result = 31 * result + GeckoPigeonUtils.deepHash(this.private) + result = 31 * result + GeckoPigeonUtils.deepHash(this.historyMetadata) + result = 31 * result + GeckoPigeonUtils.deepHash(this.additionalHeaders) + return result + } } /** @@ -1016,15 +1208,23 @@ data class LastMediaAccessState ( ) } override fun equals(other: Any?): Boolean { - if (other !is LastMediaAccessState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as LastMediaAccessState + return GeckoPigeonUtils.deepEquals(this.lastMediaUrl, other.lastMediaUrl) && GeckoPigeonUtils.deepEquals(this.lastMediaAccess, other.lastMediaAccess) && GeckoPigeonUtils.deepEquals(this.mediaSessionActive, other.mediaSessionActive) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastMediaUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastMediaAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.mediaSessionActive) + return result + } } /** @@ -1067,15 +1267,23 @@ data class HistoryMetadataKey ( ) } override fun equals(other: Any?): Boolean { - if (other !is HistoryMetadataKey) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HistoryMetadataKey + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.searchTerm, other.searchTerm) && GeckoPigeonUtils.deepEquals(this.referrerUrl, other.referrerUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.searchTerm) + result = 31 * result + GeckoPigeonUtils.deepHash(this.referrerUrl) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1095,15 +1303,21 @@ data class PackageCategoryValue ( ) } override fun equals(other: Any?): Boolean { - if (other !is PackageCategoryValue) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as PackageCategoryValue + return GeckoPigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.value) + return result + } } /** @@ -1132,15 +1346,22 @@ data class ExternalPackage ( ) } override fun equals(other: Any?): Boolean { - if (other !is ExternalPackage) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ExternalPackage + return GeckoPigeonUtils.deepEquals(this.packageId, other.packageId) && GeckoPigeonUtils.deepEquals(this.category, other.category) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.packageId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.category) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1160,15 +1381,21 @@ data class LoadUrlFlagsValue ( ) } override fun equals(other: Any?): Boolean { - if (other !is LoadUrlFlagsValue) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as LoadUrlFlagsValue + return GeckoPigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.value) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1191,15 +1418,22 @@ data class SourceValue ( ) } override fun equals(other: Any?): Boolean { - if (other !is SourceValue) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SourceValue + return GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.caller, other.caller) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.caller) + return result + } } /** @@ -1290,15 +1524,35 @@ data class TabState ( ) } override fun equals(other: Any?): Boolean { - if (other !is TabState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TabState + return GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.parentId, other.parentId) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.searchTerm, other.searchTerm) && GeckoPigeonUtils.deepEquals(this.contextId, other.contextId) && GeckoPigeonUtils.deepEquals(this.readerState, other.readerState) && GeckoPigeonUtils.deepEquals(this.lastAccess, other.lastAccess) && GeckoPigeonUtils.deepEquals(this.createdAt, other.createdAt) && GeckoPigeonUtils.deepEquals(this.lastMediaAccessState, other.lastMediaAccessState) && GeckoPigeonUtils.deepEquals(this.private, other.private) && GeckoPigeonUtils.deepEquals(this.historyMetadata, other.historyMetadata) && GeckoPigeonUtils.deepEquals(this.source, other.source) && GeckoPigeonUtils.deepEquals(this.index, other.index) && GeckoPigeonUtils.deepEquals(this.hasFormData, other.hasFormData) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.parentId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.searchTerm) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contextId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.readerState) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.createdAt) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastMediaAccessState) + result = 31 * result + GeckoPigeonUtils.deepHash(this.private) + result = 31 * result + GeckoPigeonUtils.deepHash(this.historyMetadata) + result = 31 * result + GeckoPigeonUtils.deepHash(this.source) + result = 31 * result + GeckoPigeonUtils.deepHash(this.index) + result = 31 * result + GeckoPigeonUtils.deepHash(this.hasFormData) + return result + } } /** @@ -1327,15 +1581,22 @@ data class RecoverableTab ( ) } override fun equals(other: Any?): Boolean { - if (other !is RecoverableTab) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as RecoverableTab + return GeckoPigeonUtils.deepEquals(this.engineSessionStateJson, other.engineSessionStateJson) && GeckoPigeonUtils.deepEquals(this.state, other.state) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.engineSessionStateJson) + result = 31 * result + GeckoPigeonUtils.deepHash(this.state) + return result + } } /** @@ -1374,15 +1635,26 @@ data class IconRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is IconRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as IconRequest + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.size, other.size) && GeckoPigeonUtils.deepEquals(this.resources, other.resources) && GeckoPigeonUtils.deepEquals(this.color, other.color) && GeckoPigeonUtils.deepEquals(this.isPrivate, other.isPrivate) && GeckoPigeonUtils.deepEquals(this.waitOnNetworkLoad, other.waitOnNetworkLoad) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.size) + result = 31 * result + GeckoPigeonUtils.deepHash(this.resources) + result = 31 * result + GeckoPigeonUtils.deepHash(this.color) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isPrivate) + result = 31 * result + GeckoPigeonUtils.deepHash(this.waitOnNetworkLoad) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1405,15 +1677,22 @@ data class ResourceSize ( ) } override fun equals(other: Any?): Boolean { - if (other !is ResourceSize) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ResourceSize + return GeckoPigeonUtils.deepEquals(this.height, other.height) && GeckoPigeonUtils.deepEquals(this.width, other.width) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.height) + result = 31 * result + GeckoPigeonUtils.deepHash(this.width) + return result + } } /** @@ -1449,15 +1728,25 @@ data class Resource ( ) } override fun equals(other: Any?): Boolean { - if (other !is Resource) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as Resource + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.type, other.type) && GeckoPigeonUtils.deepEquals(this.sizes, other.sizes) && GeckoPigeonUtils.deepEquals(this.mimeType, other.mimeType) && GeckoPigeonUtils.deepEquals(this.maskable, other.maskable) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.type) + result = 31 * result + GeckoPigeonUtils.deepHash(this.sizes) + result = 31 * result + GeckoPigeonUtils.deepHash(this.mimeType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.maskable) + return result + } } /** @@ -1494,15 +1783,24 @@ data class IconResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is IconResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as IconResult + return GeckoPigeonUtils.deepEquals(this.image, other.image) && GeckoPigeonUtils.deepEquals(this.color, other.color) && GeckoPigeonUtils.deepEquals(this.source, other.source) && GeckoPigeonUtils.deepEquals(this.maskable, other.maskable) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.image) + result = 31 * result + GeckoPigeonUtils.deepHash(this.color) + result = 31 * result + GeckoPigeonUtils.deepHash(this.source) + result = 31 * result + GeckoPigeonUtils.deepHash(this.maskable) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1522,15 +1820,21 @@ data class CookiePartitionKey ( ) } override fun equals(other: Any?): Boolean { - if (other !is CookiePartitionKey) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as CookiePartitionKey + return GeckoPigeonUtils.deepEquals(this.topLevelSite, other.topLevelSite) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.topLevelSite) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1586,15 +1890,33 @@ data class Cookie ( ) } override fun equals(other: Any?): Boolean { - if (other !is Cookie) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as Cookie + return GeckoPigeonUtils.deepEquals(this.domain, other.domain) && GeckoPigeonUtils.deepEquals(this.expirationDate, other.expirationDate) && GeckoPigeonUtils.deepEquals(this.firstPartyDomain, other.firstPartyDomain) && GeckoPigeonUtils.deepEquals(this.hostOnly, other.hostOnly) && GeckoPigeonUtils.deepEquals(this.httpOnly, other.httpOnly) && GeckoPigeonUtils.deepEquals(this.name, other.name) && GeckoPigeonUtils.deepEquals(this.partitionKey, other.partitionKey) && GeckoPigeonUtils.deepEquals(this.path, other.path) && GeckoPigeonUtils.deepEquals(this.secure, other.secure) && GeckoPigeonUtils.deepEquals(this.session, other.session) && GeckoPigeonUtils.deepEquals(this.sameSite, other.sameSite) && GeckoPigeonUtils.deepEquals(this.storeId, other.storeId) && GeckoPigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.domain) + result = 31 * result + GeckoPigeonUtils.deepHash(this.expirationDate) + result = 31 * result + GeckoPigeonUtils.deepHash(this.firstPartyDomain) + result = 31 * result + GeckoPigeonUtils.deepHash(this.hostOnly) + result = 31 * result + GeckoPigeonUtils.deepHash(this.httpOnly) + result = 31 * result + GeckoPigeonUtils.deepHash(this.name) + result = 31 * result + GeckoPigeonUtils.deepHash(this.partitionKey) + result = 31 * result + GeckoPigeonUtils.deepHash(this.path) + result = 31 * result + GeckoPigeonUtils.deepHash(this.secure) + result = 31 * result + GeckoPigeonUtils.deepHash(this.session) + result = 31 * result + GeckoPigeonUtils.deepHash(this.sameSite) + result = 31 * result + GeckoPigeonUtils.deepHash(this.storeId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.value) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1632,15 +1954,27 @@ data class VisitInfo ( ) } override fun equals(other: Any?): Boolean { - if (other !is VisitInfo) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as VisitInfo + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.visitTime, other.visitTime) && GeckoPigeonUtils.deepEquals(this.visitType, other.visitType) && GeckoPigeonUtils.deepEquals(this.previewImageUrl, other.previewImageUrl) && GeckoPigeonUtils.deepEquals(this.isRemote, other.isRemote) && GeckoPigeonUtils.deepEquals(this.contentId, other.contentId) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.visitTime) + result = 31 * result + GeckoPigeonUtils.deepHash(this.visitType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.previewImageUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isRemote) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contentId) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1663,15 +1997,22 @@ data class HistoryHighlightWeights ( ) } override fun equals(other: Any?): Boolean { - if (other !is HistoryHighlightWeights) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HistoryHighlightWeights + return GeckoPigeonUtils.deepEquals(this.viewTime, other.viewTime) && GeckoPigeonUtils.deepEquals(this.frequency, other.frequency) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.viewTime) + result = 31 * result + GeckoPigeonUtils.deepHash(this.frequency) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1703,15 +2044,25 @@ data class HistoryHighlight ( ) } override fun equals(other: Any?): Boolean { - if (other !is HistoryHighlight) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HistoryHighlight + return GeckoPigeonUtils.deepEquals(this.score, other.score) && GeckoPigeonUtils.deepEquals(this.placeId, other.placeId) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.previewImageUrl, other.previewImageUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.score) + result = 31 * result + GeckoPigeonUtils.deepHash(this.placeId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.previewImageUrl) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1734,15 +2085,22 @@ data class TopFrecentSiteInfo ( ) } override fun equals(other: Any?): Boolean { - if (other !is TopFrecentSiteInfo) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TopFrecentSiteInfo + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.title, other.title) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1765,15 +2123,22 @@ data class HistoryItem ( ) } override fun equals(other: Any?): Boolean { - if (other !is HistoryItem) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HistoryItem + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.title, other.title) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1802,15 +2167,24 @@ data class HistoryState ( ) } override fun equals(other: Any?): Boolean { - if (other !is HistoryState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as HistoryState + return GeckoPigeonUtils.deepEquals(this.items, other.items) && GeckoPigeonUtils.deepEquals(this.currentIndex, other.currentIndex) && GeckoPigeonUtils.deepEquals(this.canGoBack, other.canGoBack) && GeckoPigeonUtils.deepEquals(this.canGoForward, other.canGoForward) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.items) + result = 31 * result + GeckoPigeonUtils.deepHash(this.currentIndex) + result = 31 * result + GeckoPigeonUtils.deepHash(this.canGoBack) + result = 31 * result + GeckoPigeonUtils.deepHash(this.canGoForward) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1838,15 +2212,22 @@ data class ReaderableState ( ) } override fun equals(other: Any?): Boolean { - if (other !is ReaderableState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ReaderableState + return GeckoPigeonUtils.deepEquals(this.readerable, other.readerable) && GeckoPigeonUtils.deepEquals(this.active, other.active) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.readerable) + result = 31 * result + GeckoPigeonUtils.deepHash(this.active) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1872,15 +2253,23 @@ data class SecurityInfoState ( ) } override fun equals(other: Any?): Boolean { - if (other !is SecurityInfoState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SecurityInfoState + return GeckoPigeonUtils.deepEquals(this.secure, other.secure) && GeckoPigeonUtils.deepEquals(this.host, other.host) && GeckoPigeonUtils.deepEquals(this.issuer, other.issuer) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.secure) + result = 31 * result + GeckoPigeonUtils.deepHash(this.host) + result = 31 * result + GeckoPigeonUtils.deepHash(this.issuer) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1927,15 +2316,30 @@ data class TabContentState ( ) } override fun equals(other: Any?): Boolean { - if (other !is TabContentState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TabContentState + return GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.parentId, other.parentId) && GeckoPigeonUtils.deepEquals(this.contextId, other.contextId) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.progress, other.progress) && GeckoPigeonUtils.deepEquals(this.isPrivate, other.isPrivate) && GeckoPigeonUtils.deepEquals(this.isFullScreen, other.isFullScreen) && GeckoPigeonUtils.deepEquals(this.isLoading, other.isLoading) && GeckoPigeonUtils.deepEquals(this.showToolbarAsExpanded, other.showToolbarAsExpanded) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.parentId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contextId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.progress) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isPrivate) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isFullScreen) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isLoading) + result = 31 * result + GeckoPigeonUtils.deepHash(this.showToolbarAsExpanded) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1961,15 +2365,23 @@ data class FindResultState ( ) } override fun equals(other: Any?): Boolean { - if (other !is FindResultState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as FindResultState + return GeckoPigeonUtils.deepEquals(this.activeMatchOrdinal, other.activeMatchOrdinal) && GeckoPigeonUtils.deepEquals(this.numberOfMatches, other.numberOfMatches) && GeckoPigeonUtils.deepEquals(this.isDoneCounting, other.isDoneCounting) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.activeMatchOrdinal) + result = 31 * result + GeckoPigeonUtils.deepHash(this.numberOfMatches) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isDoneCounting) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -1995,15 +2407,23 @@ data class CustomSelectionAction ( ) } override fun equals(other: Any?): Boolean { - if (other !is CustomSelectionAction) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as CustomSelectionAction + return GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.pattern, other.pattern) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.pattern) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2038,15 +2458,26 @@ data class WebExtensionData ( ) } override fun equals(other: Any?): Boolean { - if (other !is WebExtensionData) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as WebExtensionData + return GeckoPigeonUtils.deepEquals(this.extensionId, other.extensionId) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.enabled, other.enabled) && GeckoPigeonUtils.deepEquals(this.badgeText, other.badgeText) && GeckoPigeonUtils.deepEquals(this.badgeTextColor, other.badgeTextColor) && GeckoPigeonUtils.deepEquals(this.badgeBackgroundColor, other.badgeBackgroundColor) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.extensionId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.enabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.badgeText) + result = 31 * result + GeckoPigeonUtils.deepHash(this.badgeTextColor) + result = 31 * result + GeckoPigeonUtils.deepHash(this.badgeBackgroundColor) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2084,15 +2515,27 @@ data class GeckoSuggestion ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoSuggestion) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoSuggestion + return GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.type, other.type) && GeckoPigeonUtils.deepEquals(this.score, other.score) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.description, other.description) && GeckoPigeonUtils.deepEquals(this.editSuggestion, other.editSuggestion) && GeckoPigeonUtils.deepEquals(this.icon, other.icon) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.type) + result = 31 * result + GeckoPigeonUtils.deepHash(this.score) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.description) + result = 31 * result + GeckoPigeonUtils.deepHash(this.editSuggestion) + result = 31 * result + GeckoPigeonUtils.deepHash(this.icon) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2127,15 +2570,26 @@ data class TabContent ( ) } override fun equals(other: Any?): Boolean { - if (other !is TabContent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TabContent + return GeckoPigeonUtils.deepEquals(this.tabId, other.tabId) && GeckoPigeonUtils.deepEquals(this.fullContentMarkdown, other.fullContentMarkdown) && GeckoPigeonUtils.deepEquals(this.fullContentPlain, other.fullContentPlain) && GeckoPigeonUtils.deepEquals(this.isProbablyReaderable, other.isProbablyReaderable) && GeckoPigeonUtils.deepEquals(this.extractedContentMarkdown, other.extractedContentMarkdown) && GeckoPigeonUtils.deepEquals(this.extractedContentPlain, other.extractedContentPlain) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.tabId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fullContentMarkdown) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fullContentPlain) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isProbablyReaderable) + result = 31 * result + GeckoPigeonUtils.deepHash(this.extractedContentMarkdown) + result = 31 * result + GeckoPigeonUtils.deepHash(this.extractedContentPlain) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2164,15 +2618,24 @@ data class ContentBlocking ( ) } override fun equals(other: Any?): Boolean { - if (other !is ContentBlocking) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ContentBlocking + return GeckoPigeonUtils.deepEquals(this.queryParameterStripping, other.queryParameterStripping) && GeckoPigeonUtils.deepEquals(this.queryParameterStrippingAllowList, other.queryParameterStrippingAllowList) && GeckoPigeonUtils.deepEquals(this.queryParameterStrippingStripList, other.queryParameterStrippingStripList) && GeckoPigeonUtils.deepEquals(this.bounceTrackingProtectionMode, other.bounceTrackingProtectionMode) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.queryParameterStripping) + result = 31 * result + GeckoPigeonUtils.deepHash(this.queryParameterStrippingAllowList) + result = 31 * result + GeckoPigeonUtils.deepHash(this.queryParameterStrippingStripList) + result = 31 * result + GeckoPigeonUtils.deepHash(this.bounceTrackingProtectionMode) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2201,15 +2664,24 @@ data class DohSettings ( ) } override fun equals(other: Any?): Boolean { - if (other !is DohSettings) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DohSettings + return GeckoPigeonUtils.deepEquals(this.dohSettingsMode, other.dohSettingsMode) && GeckoPigeonUtils.deepEquals(this.dohProviderUrl, other.dohProviderUrl) && GeckoPigeonUtils.deepEquals(this.dohDefaultProviderUrl, other.dohDefaultProviderUrl) && GeckoPigeonUtils.deepEquals(this.dohExceptionsList, other.dohExceptionsList) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.dohSettingsMode) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dohProviderUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dohDefaultProviderUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dohExceptionsList) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2366,15 +2838,62 @@ data class GeckoEngineSettings ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoEngineSettings) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoEngineSettings + return GeckoPigeonUtils.deepEquals(this.javascriptEnabled, other.javascriptEnabled) && GeckoPigeonUtils.deepEquals(this.trackingProtectionPolicy, other.trackingProtectionPolicy) && GeckoPigeonUtils.deepEquals(this.httpsOnlyMode, other.httpsOnlyMode) && GeckoPigeonUtils.deepEquals(this.globalPrivacyControlEnabled, other.globalPrivacyControlEnabled) && GeckoPigeonUtils.deepEquals(this.preferredColorScheme, other.preferredColorScheme) && GeckoPigeonUtils.deepEquals(this.cookieBannerHandlingMode, other.cookieBannerHandlingMode) && GeckoPigeonUtils.deepEquals(this.cookieBannerHandlingModePrivateBrowsing, other.cookieBannerHandlingModePrivateBrowsing) && GeckoPigeonUtils.deepEquals(this.cookieBannerHandlingGlobalRules, other.cookieBannerHandlingGlobalRules) && GeckoPigeonUtils.deepEquals(this.cookieBannerHandlingGlobalRulesSubFrames, other.cookieBannerHandlingGlobalRulesSubFrames) && GeckoPigeonUtils.deepEquals(this.webContentIsolationStrategy, other.webContentIsolationStrategy) && GeckoPigeonUtils.deepEquals(this.userAgent, other.userAgent) && GeckoPigeonUtils.deepEquals(this.contentBlocking, other.contentBlocking) && GeckoPigeonUtils.deepEquals(this.enterpriseRootsEnabled, other.enterpriseRootsEnabled) && GeckoPigeonUtils.deepEquals(this.dohSettings, other.dohSettings) && GeckoPigeonUtils.deepEquals(this.fingerprintingProtectionOverrides, other.fingerprintingProtectionOverrides) && GeckoPigeonUtils.deepEquals(this.locales, other.locales) && GeckoPigeonUtils.deepEquals(this.blockCookies, other.blockCookies) && GeckoPigeonUtils.deepEquals(this.customCookiePolicy, other.customCookiePolicy) && GeckoPigeonUtils.deepEquals(this.blockTrackingContent, other.blockTrackingContent) && GeckoPigeonUtils.deepEquals(this.trackingContentScope, other.trackingContentScope) && GeckoPigeonUtils.deepEquals(this.blockCryptominers, other.blockCryptominers) && GeckoPigeonUtils.deepEquals(this.blockFingerprinters, other.blockFingerprinters) && GeckoPigeonUtils.deepEquals(this.blockRedirectTrackers, other.blockRedirectTrackers) && GeckoPigeonUtils.deepEquals(this.blockSuspectedFingerprinters, other.blockSuspectedFingerprinters) && GeckoPigeonUtils.deepEquals(this.suspectedFingerprintersScope, other.suspectedFingerprintersScope) && GeckoPigeonUtils.deepEquals(this.allowListBaseline, other.allowListBaseline) && GeckoPigeonUtils.deepEquals(this.allowListConvenience, other.allowListConvenience) && GeckoPigeonUtils.deepEquals(this.webFontsEnabled, other.webFontsEnabled) && GeckoPigeonUtils.deepEquals(this.automaticFontSizeAdjustment, other.automaticFontSizeAdjustment) && GeckoPigeonUtils.deepEquals(this.fontSizeFactor, other.fontSizeFactor) && GeckoPigeonUtils.deepEquals(this.fontInflationEnabled, other.fontInflationEnabled) && GeckoPigeonUtils.deepEquals(this.displayDensityOverride, other.displayDensityOverride) && GeckoPigeonUtils.deepEquals(this.screenWidthOverride, other.screenWidthOverride) && GeckoPigeonUtils.deepEquals(this.screenHeightOverride, other.screenHeightOverride) && GeckoPigeonUtils.deepEquals(this.inputAutoZoomEnabled, other.inputAutoZoomEnabled) && GeckoPigeonUtils.deepEquals(this.fissionEnabled, other.fissionEnabled) && GeckoPigeonUtils.deepEquals(this.isolatedProcessEnabled, other.isolatedProcessEnabled) && GeckoPigeonUtils.deepEquals(this.appZygoteProcessEnabled, other.appZygoteProcessEnabled) && GeckoPigeonUtils.deepEquals(this.extensionsWebAPIEnabled, other.extensionsWebAPIEnabled) && GeckoPigeonUtils.deepEquals(this.lnaBlocking, other.lnaBlocking) && GeckoPigeonUtils.deepEquals(this.lnaBlockTrackers, other.lnaBlockTrackers) && GeckoPigeonUtils.deepEquals(this.lnaEnabled, other.lnaEnabled) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.javascriptEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.trackingProtectionPolicy) + result = 31 * result + GeckoPigeonUtils.deepHash(this.httpsOnlyMode) + result = 31 * result + GeckoPigeonUtils.deepHash(this.globalPrivacyControlEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.preferredColorScheme) + result = 31 * result + GeckoPigeonUtils.deepHash(this.cookieBannerHandlingMode) + result = 31 * result + GeckoPigeonUtils.deepHash(this.cookieBannerHandlingModePrivateBrowsing) + result = 31 * result + GeckoPigeonUtils.deepHash(this.cookieBannerHandlingGlobalRules) + result = 31 * result + GeckoPigeonUtils.deepHash(this.cookieBannerHandlingGlobalRulesSubFrames) + result = 31 * result + GeckoPigeonUtils.deepHash(this.webContentIsolationStrategy) + result = 31 * result + GeckoPigeonUtils.deepHash(this.userAgent) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contentBlocking) + result = 31 * result + GeckoPigeonUtils.deepHash(this.enterpriseRootsEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dohSettings) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fingerprintingProtectionOverrides) + result = 31 * result + GeckoPigeonUtils.deepHash(this.locales) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockCookies) + result = 31 * result + GeckoPigeonUtils.deepHash(this.customCookiePolicy) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockTrackingContent) + result = 31 * result + GeckoPigeonUtils.deepHash(this.trackingContentScope) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockCryptominers) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockFingerprinters) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockRedirectTrackers) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blockSuspectedFingerprinters) + result = 31 * result + GeckoPigeonUtils.deepHash(this.suspectedFingerprintersScope) + result = 31 * result + GeckoPigeonUtils.deepHash(this.allowListBaseline) + result = 31 * result + GeckoPigeonUtils.deepHash(this.allowListConvenience) + result = 31 * result + GeckoPigeonUtils.deepHash(this.webFontsEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.automaticFontSizeAdjustment) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fontSizeFactor) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fontInflationEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.displayDensityOverride) + result = 31 * result + GeckoPigeonUtils.deepHash(this.screenWidthOverride) + result = 31 * result + GeckoPigeonUtils.deepHash(this.screenHeightOverride) + result = 31 * result + GeckoPigeonUtils.deepHash(this.inputAutoZoomEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fissionEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isolatedProcessEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.appZygoteProcessEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.extensionsWebAPIEnabled) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lnaBlocking) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lnaBlockTrackers) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lnaEnabled) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2406,15 +2925,25 @@ data class AutocompleteResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is AutocompleteResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AutocompleteResult + return GeckoPigeonUtils.deepEquals(this.input, other.input) && GeckoPigeonUtils.deepEquals(this.text, other.text) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.source, other.source) && GeckoPigeonUtils.deepEquals(this.totalItems, other.totalItems) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.input) + result = 31 * result + GeckoPigeonUtils.deepHash(this.text) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.source) + result = 31 * result + GeckoPigeonUtils.deepHash(this.totalItems) + return result + } } /** @@ -2449,15 +2978,22 @@ data class UnknownHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is UnknownHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as UnknownHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.linkText, other.linkText) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.linkText) + return result + } } /** @@ -2484,15 +3020,22 @@ data class ImageHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is ImageHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ImageHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.title, other.title) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + return result + } } /** @@ -2519,15 +3062,22 @@ data class VideoHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is VideoHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as VideoHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.title, other.title) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + return result + } } /** @@ -2554,15 +3104,22 @@ data class AudioHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is AudioHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AudioHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.title, other.title) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + return result + } } /** @@ -2589,15 +3146,22 @@ data class ImageSrcHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is ImageSrcHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ImageSrcHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.uri, other.uri) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.uri) + return result + } } /** @@ -2621,15 +3185,21 @@ data class PhoneHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is PhoneHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as PhoneHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + return result + } } /** @@ -2653,15 +3223,21 @@ data class EmailHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is EmailHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as EmailHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + return result + } } /** @@ -2685,15 +3261,21 @@ data class GeoHitResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeoHitResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeoHitResult + return GeckoPigeonUtils.deepEquals(this.src, other.src) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2761,15 +3343,37 @@ data class DownloadState ( ) } override fun equals(other: Any?): Boolean { - if (other !is DownloadState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as DownloadState + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.fileName, other.fileName) && GeckoPigeonUtils.deepEquals(this.contentType, other.contentType) && GeckoPigeonUtils.deepEquals(this.contentLength, other.contentLength) && GeckoPigeonUtils.deepEquals(this.currentBytesCopied, other.currentBytesCopied) && GeckoPigeonUtils.deepEquals(this.status, other.status) && GeckoPigeonUtils.deepEquals(this.userAgent, other.userAgent) && GeckoPigeonUtils.deepEquals(this.destinationDirectory, other.destinationDirectory) && GeckoPigeonUtils.deepEquals(this.directoryPath, other.directoryPath) && GeckoPigeonUtils.deepEquals(this.referrerUrl, other.referrerUrl) && GeckoPigeonUtils.deepEquals(this.skipConfirmation, other.skipConfirmation) && GeckoPigeonUtils.deepEquals(this.openInApp, other.openInApp) && GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.sessionId, other.sessionId) && GeckoPigeonUtils.deepEquals(this.private, other.private) && GeckoPigeonUtils.deepEquals(this.createdTime, other.createdTime) && GeckoPigeonUtils.deepEquals(this.notificationId, other.notificationId) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fileName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contentType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contentLength) + result = 31 * result + GeckoPigeonUtils.deepHash(this.currentBytesCopied) + result = 31 * result + GeckoPigeonUtils.deepHash(this.status) + result = 31 * result + GeckoPigeonUtils.deepHash(this.userAgent) + result = 31 * result + GeckoPigeonUtils.deepHash(this.destinationDirectory) + result = 31 * result + GeckoPigeonUtils.deepHash(this.directoryPath) + result = 31 * result + GeckoPigeonUtils.deepHash(this.referrerUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.skipConfirmation) + result = 31 * result + GeckoPigeonUtils.deepHash(this.openInApp) + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.sessionId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.private) + result = 31 * result + GeckoPigeonUtils.deepHash(this.createdTime) + result = 31 * result + GeckoPigeonUtils.deepHash(this.notificationId) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2798,15 +3402,24 @@ data class ShareInternetResourceState ( ) } override fun equals(other: Any?): Boolean { - if (other !is ShareInternetResourceState) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ShareInternetResourceState + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.contentType, other.contentType) && GeckoPigeonUtils.deepEquals(this.private, other.private) && GeckoPigeonUtils.deepEquals(this.referrerUrl, other.referrerUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.contentType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.private) + result = 31 * result + GeckoPigeonUtils.deepHash(this.referrerUrl) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2832,15 +3445,23 @@ data class AddonCollection ( ) } override fun equals(other: Any?): Boolean { - if (other !is AddonCollection) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as AddonCollection + return GeckoPigeonUtils.deepEquals(this.serverURL, other.serverURL) && GeckoPigeonUtils.deepEquals(this.collectionUser, other.collectionUser) && GeckoPigeonUtils.deepEquals(this.collectionName, other.collectionName) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.serverURL) + result = 31 * result + GeckoPigeonUtils.deepHash(this.collectionUser) + result = 31 * result + GeckoPigeonUtils.deepHash(this.collectionName) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2863,15 +3484,22 @@ data class SyncEngineStatus ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncEngineStatus) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncEngineStatus + return GeckoPigeonUtils.deepEquals(this.engine, other.engine) && GeckoPigeonUtils.deepEquals(this.enabled, other.enabled) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.engine) + result = 31 * result + GeckoPigeonUtils.deepHash(this.enabled) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2909,15 +3537,27 @@ data class SyncAccountInfo ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncAccountInfo) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncAccountInfo + return GeckoPigeonUtils.deepEquals(this.authenticated, other.authenticated) && GeckoPigeonUtils.deepEquals(this.syncing, other.syncing) && GeckoPigeonUtils.deepEquals(this.needsReauth, other.needsReauth) && GeckoPigeonUtils.deepEquals(this.email, other.email) && GeckoPigeonUtils.deepEquals(this.displayName, other.displayName) && GeckoPigeonUtils.deepEquals(this.lastSyncedAt, other.lastSyncedAt) && GeckoPigeonUtils.deepEquals(this.engines, other.engines) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.authenticated) + result = 31 * result + GeckoPigeonUtils.deepHash(this.syncing) + result = 31 * result + GeckoPigeonUtils.deepHash(this.needsReauth) + result = 31 * result + GeckoPigeonUtils.deepHash(this.email) + result = 31 * result + GeckoPigeonUtils.deepHash(this.displayName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastSyncedAt) + result = 31 * result + GeckoPigeonUtils.deepHash(this.engines) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2946,15 +3586,24 @@ data class SyncDevice ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncDevice) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncDevice + return GeckoPigeonUtils.deepEquals(this.deviceId, other.deviceId) && GeckoPigeonUtils.deepEquals(this.displayName, other.displayName) && GeckoPigeonUtils.deepEquals(this.isCurrentDevice, other.isCurrentDevice) && GeckoPigeonUtils.deepEquals(this.canSendTab, other.canSendTab) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.deviceId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.displayName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.isCurrentDevice) + result = 31 * result + GeckoPigeonUtils.deepHash(this.canSendTab) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -2983,15 +3632,24 @@ data class SyncIncomingTab ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncIncomingTab) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncIncomingTab + return GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.fromDeviceId, other.fromDeviceId) && GeckoPigeonUtils.deepEquals(this.fromDeviceName, other.fromDeviceName) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fromDeviceId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.fromDeviceName) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3023,15 +3681,25 @@ data class SyncRemoteTab ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncRemoteTab) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncRemoteTab + return GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.iconUrl, other.iconUrl) && GeckoPigeonUtils.deepEquals(this.lastUsed, other.lastUsed) && GeckoPigeonUtils.deepEquals(this.inactive, other.inactive) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.iconUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastUsed) + result = 31 * result + GeckoPigeonUtils.deepHash(this.inactive) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3057,15 +3725,23 @@ data class SyncDeviceTabs ( ) } override fun equals(other: Any?): Boolean { - if (other !is SyncDeviceTabs) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SyncDeviceTabs + return GeckoPigeonUtils.deepEquals(this.deviceId, other.deviceId) && GeckoPigeonUtils.deepEquals(this.deviceName, other.deviceName) && GeckoPigeonUtils.deepEquals(this.tabs, other.tabs) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.deviceId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.deviceName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.tabs) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3097,15 +3773,25 @@ data class GeckoPref ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoPref) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoPref + return GeckoPigeonUtils.deepEquals(this.name, other.name) && GeckoPigeonUtils.deepEquals(this.value, other.value) && GeckoPigeonUtils.deepEquals(this.defaultValue, other.defaultValue) && GeckoPigeonUtils.deepEquals(this.userValue, other.userValue) && GeckoPigeonUtils.deepEquals(this.hasUserChangedValue, other.hasUserChangedValue) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.name) + result = 31 * result + GeckoPigeonUtils.deepHash(this.value) + result = 31 * result + GeckoPigeonUtils.deepHash(this.defaultValue) + result = 31 * result + GeckoPigeonUtils.deepHash(this.userValue) + result = 31 * result + GeckoPigeonUtils.deepHash(this.hasUserChangedValue) + return result + } } /** @@ -3166,15 +3852,30 @@ data class MlProgressData ( ) } override fun equals(other: Any?): Boolean { - if (other !is MlProgressData) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as MlProgressData + return GeckoPigeonUtils.deepEquals(this.modelType, other.modelType) && GeckoPigeonUtils.deepEquals(this.progress, other.progress) && GeckoPigeonUtils.deepEquals(this.type, other.type) && GeckoPigeonUtils.deepEquals(this.status, other.status) && GeckoPigeonUtils.deepEquals(this.totalLoaded, other.totalLoaded) && GeckoPigeonUtils.deepEquals(this.currentLoaded, other.currentLoaded) && GeckoPigeonUtils.deepEquals(this.total, other.total) && GeckoPigeonUtils.deepEquals(this.units, other.units) && GeckoPigeonUtils.deepEquals(this.ok, other.ok) && GeckoPigeonUtils.deepEquals(this.id, other.id) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.modelType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.progress) + result = 31 * result + GeckoPigeonUtils.deepHash(this.type) + result = 31 * result + GeckoPigeonUtils.deepHash(this.status) + result = 31 * result + GeckoPigeonUtils.deepHash(this.totalLoaded) + result = 31 * result + GeckoPigeonUtils.deepHash(this.currentLoaded) + result = 31 * result + GeckoPigeonUtils.deepHash(this.total) + result = 31 * result + GeckoPigeonUtils.deepHash(this.units) + result = 31 * result + GeckoPigeonUtils.deepHash(this.ok) + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3206,15 +3907,25 @@ data class ContainerSiteAssignment ( ) } override fun equals(other: Any?): Boolean { - if (other !is ContainerSiteAssignment) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ContainerSiteAssignment + return GeckoPigeonUtils.deepEquals(this.requestId, other.requestId) && GeckoPigeonUtils.deepEquals(this.tabId, other.tabId) && GeckoPigeonUtils.deepEquals(this.originUrl, other.originUrl) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.blocked, other.blocked) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.requestId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.tabId) + result = 31 * result + GeckoPigeonUtils.deepHash(this.originUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.blocked) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3237,15 +3948,22 @@ data class GeckoHeader ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoHeader) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoHeader + return GeckoPigeonUtils.deepEquals(this.key, other.key) && GeckoPigeonUtils.deepEquals(this.value, other.value) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.key) + result = 31 * result + GeckoPigeonUtils.deepHash(this.value) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3301,15 +4019,33 @@ data class GeckoFetchRequest ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoFetchRequest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoFetchRequest + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.method, other.method) && GeckoPigeonUtils.deepEquals(this.headers, other.headers) && GeckoPigeonUtils.deepEquals(this.connectTimeoutMillis, other.connectTimeoutMillis) && GeckoPigeonUtils.deepEquals(this.readTimeoutMillis, other.readTimeoutMillis) && GeckoPigeonUtils.deepEquals(this.body, other.body) && GeckoPigeonUtils.deepEquals(this.redirect, other.redirect) && GeckoPigeonUtils.deepEquals(this.cookiePolicy, other.cookiePolicy) && GeckoPigeonUtils.deepEquals(this.useCaches, other.useCaches) && GeckoPigeonUtils.deepEquals(this.private, other.private) && GeckoPigeonUtils.deepEquals(this.useOhttp, other.useOhttp) && GeckoPigeonUtils.deepEquals(this.referrerUrl, other.referrerUrl) && GeckoPigeonUtils.deepEquals(this.conservative, other.conservative) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.method) + result = 31 * result + GeckoPigeonUtils.deepHash(this.headers) + result = 31 * result + GeckoPigeonUtils.deepHash(this.connectTimeoutMillis) + result = 31 * result + GeckoPigeonUtils.deepHash(this.readTimeoutMillis) + result = 31 * result + GeckoPigeonUtils.deepHash(this.body) + result = 31 * result + GeckoPigeonUtils.deepHash(this.redirect) + result = 31 * result + GeckoPigeonUtils.deepHash(this.cookiePolicy) + result = 31 * result + GeckoPigeonUtils.deepHash(this.useCaches) + result = 31 * result + GeckoPigeonUtils.deepHash(this.private) + result = 31 * result + GeckoPigeonUtils.deepHash(this.useOhttp) + result = 31 * result + GeckoPigeonUtils.deepHash(this.referrerUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.conservative) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3338,15 +4074,24 @@ data class GeckoFetchResponse ( ) } override fun equals(other: Any?): Boolean { - if (other !is GeckoFetchResponse) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as GeckoFetchResponse + return GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.status, other.status) && GeckoPigeonUtils.deepEquals(this.headers, other.headers) && GeckoPigeonUtils.deepEquals(this.body, other.body) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.status) + result = 31 * result + GeckoPigeonUtils.deepHash(this.headers) + result = 31 * result + GeckoPigeonUtils.deepHash(this.body) + return result + } } /** Generated class from Pigeon that represents data sent in messages. */ @@ -3390,15 +4135,29 @@ data class BookmarkNode ( ) } override fun equals(other: Any?): Boolean { - if (other !is BookmarkNode) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as BookmarkNode + return GeckoPigeonUtils.deepEquals(this.type, other.type) && GeckoPigeonUtils.deepEquals(this.guid, other.guid) && GeckoPigeonUtils.deepEquals(this.parentGuid, other.parentGuid) && GeckoPigeonUtils.deepEquals(this.position, other.position) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.dateAdded, other.dateAdded) && GeckoPigeonUtils.deepEquals(this.lastModified, other.lastModified) && GeckoPigeonUtils.deepEquals(this.children, other.children) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.type) + result = 31 * result + GeckoPigeonUtils.deepHash(this.guid) + result = 31 * result + GeckoPigeonUtils.deepHash(this.parentGuid) + result = 31 * result + GeckoPigeonUtils.deepHash(this.position) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dateAdded) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lastModified) + result = 31 * result + GeckoPigeonUtils.deepHash(this.children) + return result + } } /** @@ -3431,15 +4190,24 @@ data class BookmarkInfo ( ) } override fun equals(other: Any?): Boolean { - if (other !is BookmarkInfo) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as BookmarkInfo + return GeckoPigeonUtils.deepEquals(this.parentGuid, other.parentGuid) && GeckoPigeonUtils.deepEquals(this.position, other.position) && GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.url, other.url) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.parentGuid) + result = 31 * result + GeckoPigeonUtils.deepHash(this.position) + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + return result + } } /** @@ -3499,15 +4267,33 @@ data class SitePermissions ( ) } override fun equals(other: Any?): Boolean { - if (other !is SitePermissions) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as SitePermissions + return GeckoPigeonUtils.deepEquals(this.origin, other.origin) && GeckoPigeonUtils.deepEquals(this.camera, other.camera) && GeckoPigeonUtils.deepEquals(this.microphone, other.microphone) && GeckoPigeonUtils.deepEquals(this.location, other.location) && GeckoPigeonUtils.deepEquals(this.notification, other.notification) && GeckoPigeonUtils.deepEquals(this.persistentStorage, other.persistentStorage) && GeckoPigeonUtils.deepEquals(this.crossOriginStorageAccess, other.crossOriginStorageAccess) && GeckoPigeonUtils.deepEquals(this.mediaKeySystemAccess, other.mediaKeySystemAccess) && GeckoPigeonUtils.deepEquals(this.localDeviceAccess, other.localDeviceAccess) && GeckoPigeonUtils.deepEquals(this.localNetworkAccess, other.localNetworkAccess) && GeckoPigeonUtils.deepEquals(this.autoplayAudible, other.autoplayAudible) && GeckoPigeonUtils.deepEquals(this.autoplayInaudible, other.autoplayInaudible) && GeckoPigeonUtils.deepEquals(this.savedAt, other.savedAt) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.origin) + result = 31 * result + GeckoPigeonUtils.deepHash(this.camera) + result = 31 * result + GeckoPigeonUtils.deepHash(this.microphone) + result = 31 * result + GeckoPigeonUtils.deepHash(this.location) + result = 31 * result + GeckoPigeonUtils.deepHash(this.notification) + result = 31 * result + GeckoPigeonUtils.deepHash(this.persistentStorage) + result = 31 * result + GeckoPigeonUtils.deepHash(this.crossOriginStorageAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.mediaKeySystemAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.localDeviceAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.localNetworkAccess) + result = 31 * result + GeckoPigeonUtils.deepHash(this.autoplayAudible) + result = 31 * result + GeckoPigeonUtils.deepHash(this.autoplayInaudible) + result = 31 * result + GeckoPigeonUtils.deepHash(this.savedAt) + return result + } } /** @@ -3534,15 +4320,21 @@ data class TrackingProtectionException ( ) } override fun equals(other: Any?): Boolean { - if (other !is TrackingProtectionException) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TrackingProtectionException + return GeckoPigeonUtils.deepEquals(this.url, other.url) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + return result + } } /** @@ -3572,15 +4364,23 @@ data class PwaIcon ( ) } override fun equals(other: Any?): Boolean { - if (other !is PwaIcon) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as PwaIcon + return GeckoPigeonUtils.deepEquals(this.src, other.src) && GeckoPigeonUtils.deepEquals(this.sizes, other.sizes) && GeckoPigeonUtils.deepEquals(this.type, other.type) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.src) + result = 31 * result + GeckoPigeonUtils.deepHash(this.sizes) + result = 31 * result + GeckoPigeonUtils.deepHash(this.type) + return result + } } /** @@ -3607,15 +4407,22 @@ data class ShareTargetFiles ( ) } override fun equals(other: Any?): Boolean { - if (other !is ShareTargetFiles) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ShareTargetFiles + return GeckoPigeonUtils.deepEquals(this.name, other.name) && GeckoPigeonUtils.deepEquals(this.accept, other.accept) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.name) + result = 31 * result + GeckoPigeonUtils.deepHash(this.accept) + return result + } } /** @@ -3648,15 +4455,24 @@ data class ShareTargetParams ( ) } override fun equals(other: Any?): Boolean { - if (other !is ShareTargetParams) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ShareTargetParams + return GeckoPigeonUtils.deepEquals(this.title, other.title) && GeckoPigeonUtils.deepEquals(this.text, other.text) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.files, other.files) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.title) + result = 31 * result + GeckoPigeonUtils.deepHash(this.text) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.files) + return result + } } /** @@ -3689,15 +4505,24 @@ data class ShareTarget ( ) } override fun equals(other: Any?): Boolean { - if (other !is ShareTarget) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ShareTarget + return GeckoPigeonUtils.deepEquals(this.action, other.action) && GeckoPigeonUtils.deepEquals(this.method, other.method) && GeckoPigeonUtils.deepEquals(this.encType, other.encType) && GeckoPigeonUtils.deepEquals(this.params, other.params) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.action) + result = 31 * result + GeckoPigeonUtils.deepHash(this.method) + result = 31 * result + GeckoPigeonUtils.deepHash(this.encType) + result = 31 * result + GeckoPigeonUtils.deepHash(this.params) + return result + } } /** @@ -3730,15 +4555,24 @@ data class ExternalApplicationResource ( ) } override fun equals(other: Any?): Boolean { - if (other !is ExternalApplicationResource) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as ExternalApplicationResource + return GeckoPigeonUtils.deepEquals(this.platform, other.platform) && GeckoPigeonUtils.deepEquals(this.url, other.url) && GeckoPigeonUtils.deepEquals(this.id, other.id) && GeckoPigeonUtils.deepEquals(this.minVersion, other.minVersion) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.platform) + result = 31 * result + GeckoPigeonUtils.deepHash(this.url) + result = 31 * result + GeckoPigeonUtils.deepHash(this.id) + result = 31 * result + GeckoPigeonUtils.deepHash(this.minVersion) + return result + } } /** @@ -3814,15 +4648,36 @@ data class PwaManifest ( ) } override fun equals(other: Any?): Boolean { - if (other !is PwaManifest) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return GeckoPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as PwaManifest + return GeckoPigeonUtils.deepEquals(this.startUrl, other.startUrl) && GeckoPigeonUtils.deepEquals(this.name, other.name) && GeckoPigeonUtils.deepEquals(this.shortName, other.shortName) && GeckoPigeonUtils.deepEquals(this.display, other.display) && GeckoPigeonUtils.deepEquals(this.themeColor, other.themeColor) && GeckoPigeonUtils.deepEquals(this.backgroundColor, other.backgroundColor) && GeckoPigeonUtils.deepEquals(this.scope, other.scope) && GeckoPigeonUtils.deepEquals(this.description, other.description) && GeckoPigeonUtils.deepEquals(this.icons, other.icons) && GeckoPigeonUtils.deepEquals(this.dir, other.dir) && GeckoPigeonUtils.deepEquals(this.lang, other.lang) && GeckoPigeonUtils.deepEquals(this.orientation, other.orientation) && GeckoPigeonUtils.deepEquals(this.relatedApplications, other.relatedApplications) && GeckoPigeonUtils.deepEquals(this.preferRelatedApplications, other.preferRelatedApplications) && GeckoPigeonUtils.deepEquals(this.shareTarget, other.shareTarget) && GeckoPigeonUtils.deepEquals(this.currentUrl, other.currentUrl) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + GeckoPigeonUtils.deepHash(this.startUrl) + result = 31 * result + GeckoPigeonUtils.deepHash(this.name) + result = 31 * result + GeckoPigeonUtils.deepHash(this.shortName) + result = 31 * result + GeckoPigeonUtils.deepHash(this.display) + result = 31 * result + GeckoPigeonUtils.deepHash(this.themeColor) + result = 31 * result + GeckoPigeonUtils.deepHash(this.backgroundColor) + result = 31 * result + GeckoPigeonUtils.deepHash(this.scope) + result = 31 * result + GeckoPigeonUtils.deepHash(this.description) + result = 31 * result + GeckoPigeonUtils.deepHash(this.icons) + result = 31 * result + GeckoPigeonUtils.deepHash(this.dir) + result = 31 * result + GeckoPigeonUtils.deepHash(this.lang) + result = 31 * result + GeckoPigeonUtils.deepHash(this.orientation) + result = 31 * result + GeckoPigeonUtils.deepHash(this.relatedApplications) + result = 31 * result + GeckoPigeonUtils.deepHash(this.preferRelatedApplications) + result = 31 * result + GeckoPigeonUtils.deepHash(this.shareTarget) + result = 31 * result + GeckoPigeonUtils.deepHash(this.currentUrl) + return result + } } private open class GeckoPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { @@ -6221,7 +7076,6 @@ interface GeckoIconsApi { } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface GeckoPrefApi { - fun getPrefList(callback: (Result>) -> Unit) fun getPrefs(preferenceFilter: List, callback: (Result>) -> Unit) fun applyPrefs(prefs: Map, callback: (Result>) -> Unit) fun resetPrefs(preferenceNames: List, callback: (Result) -> Unit) @@ -6239,24 +7093,6 @@ interface GeckoPrefApi { @JvmOverloads fun setUp(binaryMessenger: BinaryMessenger, api: GeckoPrefApi?, messageChannelSuffix: String = "") { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_mozilla_components.GeckoPrefApi.getPrefList$separatedMessageChannelSuffix", codec) - if (api != null) { - channel.setMessageHandler { _, reply -> - api.getPrefList{ result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(GeckoPigeonUtils.wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(GeckoPigeonUtils.wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } run { val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_mozilla_components.GeckoPrefApi.getPrefs$separatedMessageChannelSuffix", codec) if (api != null) { diff --git a/packages/flutter_mozilla_components/lib/src/domain/services/gecko_pref.dart b/packages/flutter_mozilla_components/lib/src/domain/services/gecko_pref.dart index 7232ce75..1246221f 100644 --- a/packages/flutter_mozilla_components/lib/src/domain/services/gecko_pref.dart +++ b/packages/flutter_mozilla_components/lib/src/domain/services/gecko_pref.dart @@ -9,14 +9,6 @@ import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart'; final _apiInstance = GeckoPrefApi(); class GeckoPrefService { - Future> getPrefList() { - return _apiInstance.getPrefList(); - } - - Future> getAllPrefs() async { - return _apiInstance.getPrefs(await getPrefList()); - } - Future> getPrefs(List prefs) { return _apiInstance.getPrefs(prefs); } diff --git a/packages/flutter_mozilla_components/lib/src/pigeons/gecko.g.dart b/packages/flutter_mozilla_components/lib/src/pigeons/gecko.g.dart index afcc89c9..1e3a86c1 100644 --- a/packages/flutter_mozilla_components/lib/src/pigeons/gecko.g.dart +++ b/packages/flutter_mozilla_components/lib/src/pigeons/gecko.g.dart @@ -1,20 +1,40 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } + List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; @@ -25,19 +45,67 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + /// Indicates what location the tabs should be restored at enum RestoreLocation { @@ -377,13 +445,12 @@ class TranslationOptions { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(downloadModel, other.downloadModel); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// A language supported by the translation engine. @@ -424,13 +491,12 @@ class TranslationLanguage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(code, other.code) && _deepEquals(localizedDisplayName, other.localizedDisplayName); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Detected languages for a page. @@ -476,13 +542,12 @@ class TranslationDetectedLanguages { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(documentLangTag, other.documentLangTag) && _deepEquals(supportedDocumentLang, other.supportedDocumentLang) && _deepEquals(userPreferredLangTag, other.userPreferredLangTag); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// A from/to language pair for translation. @@ -523,13 +588,12 @@ class TranslationPair { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(fromLanguage, other.fromLanguage) && _deepEquals(toLanguage, other.toLanguage); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Browser-level translation engine state (global). @@ -575,13 +639,12 @@ class TranslationEngineStateData { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(isEngineSupported, other.isEngineSupported) && _deepEquals(fromLanguages, other.fromLanguages) && _deepEquals(toLanguages, other.toLanguages); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Per-tab translation state. @@ -667,13 +730,12 @@ class TabTranslationStateData { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(tabId, other.tabId) && _deepEquals(isTranslated, other.isTranslated) && _deepEquals(isTranslateProcessing, other.isTranslateProcessing) && _deepEquals(isOfferTranslate, other.isOfferTranslate) && _deepEquals(isExpectedTranslate, other.isExpectedTranslate) && _deepEquals(detectedLanguageCode, other.detectedLanguageCode) && _deepEquals(userPreferredLanguageCode, other.userPreferredLanguageCode) && _deepEquals(requestedFromLanguage, other.requestedFromLanguage) && _deepEquals(requestedToLanguage, other.requestedToLanguage) && _deepEquals(translationErrorName, other.translationErrorName) && _deepEquals(displayError, other.displayError); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Value type that represents the state of reader mode/view. @@ -750,13 +812,12 @@ class ReaderState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(readerable, other.readerable) && _deepEquals(active, other.active) && _deepEquals(checkRequired, other.checkRequired) && _deepEquals(connectRequired, other.connectRequired) && _deepEquals(baseUrl, other.baseUrl) && _deepEquals(activeUrl, other.activeUrl) && _deepEquals(scrollY, other.scrollY); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Parameters for adding a new tab. @@ -832,13 +893,12 @@ class AddTabParams { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(startLoading, other.startLoading) && _deepEquals(parentId, other.parentId) && _deepEquals(flags, other.flags) && _deepEquals(contextId, other.contextId) && _deepEquals(source, other.source) && _deepEquals(private, other.private) && _deepEquals(historyMetadata, other.historyMetadata) && _deepEquals(additionalHeaders, other.additionalHeaders); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Details about the last playing media in this tab. @@ -896,13 +956,12 @@ class LastMediaAccessState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(lastMediaUrl, other.lastMediaUrl) && _deepEquals(lastMediaAccess, other.lastMediaAccess) && _deepEquals(mediaSessionActive, other.mediaSessionActive); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents a set of history metadata values that uniquely identify a record. Note that @@ -957,13 +1016,12 @@ class HistoryMetadataKey { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(searchTerm, other.searchTerm) && _deepEquals(referrerUrl, other.referrerUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class PackageCategoryValue { @@ -998,13 +1056,12 @@ class PackageCategoryValue { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Describes an external package. @@ -1047,13 +1104,12 @@ class ExternalPackage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(packageId, other.packageId) && _deepEquals(category, other.category); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class LoadUrlFlagsValue { @@ -1088,13 +1144,12 @@ class LoadUrlFlagsValue { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SourceValue { @@ -1134,13 +1189,12 @@ class SourceValue { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(caller, other.caller); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// A tab that is no longer open and in the list of tabs, but that can be restored (recovered) at @@ -1267,13 +1321,12 @@ class TabState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(url, other.url) && _deepEquals(parentId, other.parentId) && _deepEquals(title, other.title) && _deepEquals(searchTerm, other.searchTerm) && _deepEquals(contextId, other.contextId) && _deepEquals(readerState, other.readerState) && _deepEquals(lastAccess, other.lastAccess) && _deepEquals(createdAt, other.createdAt) && _deepEquals(lastMediaAccessState, other.lastMediaAccessState) && _deepEquals(private, other.private) && _deepEquals(historyMetadata, other.historyMetadata) && _deepEquals(source, other.source) && _deepEquals(index, other.index) && _deepEquals(hasFormData, other.hasFormData); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// A recoverable version of [TabState]. @@ -1316,13 +1369,12 @@ class RecoverableTab { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(engineSessionStateJson, other.engineSessionStateJson) && _deepEquals(state, other.state); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// A request to load an [Icon]. @@ -1367,7 +1419,7 @@ class IconRequest { return IconRequest( url: result[0]! as String, size: result[1]! as IconSize, - resources: (result[2] as List?)!.cast(), + resources: (result[2]! as List).cast(), color: result[3] as int?, isPrivate: result[4]! as bool, waitOnNetworkLoad: result[5]! as bool, @@ -1383,13 +1435,12 @@ class IconRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(size, other.size) && _deepEquals(resources, other.resources) && _deepEquals(color, other.color) && _deepEquals(isPrivate, other.isPrivate) && _deepEquals(waitOnNetworkLoad, other.waitOnNetworkLoad); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class ResourceSize { @@ -1429,13 +1480,12 @@ class ResourceSize { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(height, other.height) && _deepEquals(width, other.width); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// An icon resource that can be loaded. @@ -1476,7 +1526,7 @@ class Resource { return Resource( url: result[0]! as String, type: result[1]! as IconType, - sizes: (result[2] as List?)!.cast(), + sizes: (result[2]! as List).cast(), mimeType: result[3] as String?, maskable: result[4]! as bool, ); @@ -1491,13 +1541,12 @@ class Resource { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(type, other.type) && _deepEquals(sizes, other.sizes) && _deepEquals(mimeType, other.mimeType) && _deepEquals(maskable, other.maskable); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// An [Icon] returned by [BrowserIcons] after processing an [IconRequest] @@ -1552,13 +1601,12 @@ class IconResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(image, other.image) && _deepEquals(color, other.color) && _deepEquals(source, other.source) && _deepEquals(maskable, other.maskable); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class CookiePartitionKey { @@ -1593,13 +1641,12 @@ class CookiePartitionKey { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(topLevelSite, other.topLevelSite); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class Cookie { @@ -1694,13 +1741,12 @@ class Cookie { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(domain, other.domain) && _deepEquals(expirationDate, other.expirationDate) && _deepEquals(firstPartyDomain, other.firstPartyDomain) && _deepEquals(hostOnly, other.hostOnly) && _deepEquals(httpOnly, other.httpOnly) && _deepEquals(name, other.name) && _deepEquals(partitionKey, other.partitionKey) && _deepEquals(path, other.path) && _deepEquals(secure, other.secure) && _deepEquals(session, other.session) && _deepEquals(sameSite, other.sameSite) && _deepEquals(storeId, other.storeId) && _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class VisitInfo { @@ -1765,13 +1811,12 @@ class VisitInfo { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(title, other.title) && _deepEquals(visitTime, other.visitTime) && _deepEquals(visitType, other.visitType) && _deepEquals(previewImageUrl, other.previewImageUrl) && _deepEquals(isRemote, other.isRemote) && _deepEquals(contentId, other.contentId); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class HistoryHighlightWeights { @@ -1811,13 +1856,12 @@ class HistoryHighlightWeights { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(viewTime, other.viewTime) && _deepEquals(frequency, other.frequency); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class HistoryHighlight { @@ -1872,13 +1916,12 @@ class HistoryHighlight { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(score, other.score) && _deepEquals(placeId, other.placeId) && _deepEquals(url, other.url) && _deepEquals(title, other.title) && _deepEquals(previewImageUrl, other.previewImageUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TopFrecentSiteInfo { @@ -1918,13 +1961,12 @@ class TopFrecentSiteInfo { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(title, other.title); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class HistoryItem { @@ -1964,13 +2006,12 @@ class HistoryItem { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(title, other.title); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class HistoryState { @@ -2004,7 +2045,7 @@ class HistoryState { static HistoryState decode(Object result) { result as List; return HistoryState( - items: (result[0] as List?)!.cast(), + items: (result[0]! as List).cast(), currentIndex: result[1]! as int, canGoBack: result[2]! as bool, canGoForward: result[3]! as bool, @@ -2020,13 +2061,12 @@ class HistoryState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(items, other.items) && _deepEquals(currentIndex, other.currentIndex) && _deepEquals(canGoBack, other.canGoBack) && _deepEquals(canGoForward, other.canGoForward); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class ReaderableState { @@ -2069,13 +2109,12 @@ class ReaderableState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(readerable, other.readerable) && _deepEquals(active, other.active); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SecurityInfoState { @@ -2120,13 +2159,12 @@ class SecurityInfoState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(secure, other.secure) && _deepEquals(host, other.host) && _deepEquals(issuer, other.issuer); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TabContentState { @@ -2206,13 +2244,12 @@ class TabContentState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(parentId, other.parentId) && _deepEquals(contextId, other.contextId) && _deepEquals(url, other.url) && _deepEquals(title, other.title) && _deepEquals(progress, other.progress) && _deepEquals(isPrivate, other.isPrivate) && _deepEquals(isFullScreen, other.isFullScreen) && _deepEquals(isLoading, other.isLoading) && _deepEquals(showToolbarAsExpanded, other.showToolbarAsExpanded); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class FindResultState { @@ -2257,13 +2294,12 @@ class FindResultState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(activeMatchOrdinal, other.activeMatchOrdinal) && _deepEquals(numberOfMatches, other.numberOfMatches) && _deepEquals(isDoneCounting, other.isDoneCounting); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class CustomSelectionAction { @@ -2308,13 +2344,12 @@ class CustomSelectionAction { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(title, other.title) && _deepEquals(pattern, other.pattern); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class WebExtensionData { @@ -2374,13 +2409,12 @@ class WebExtensionData { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(extensionId, other.extensionId) && _deepEquals(title, other.title) && _deepEquals(enabled, other.enabled) && _deepEquals(badgeText, other.badgeText) && _deepEquals(badgeTextColor, other.badgeTextColor) && _deepEquals(badgeBackgroundColor, other.badgeBackgroundColor); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoSuggestion { @@ -2445,13 +2479,12 @@ class GeckoSuggestion { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(id, other.id) && _deepEquals(type, other.type) && _deepEquals(score, other.score) && _deepEquals(title, other.title) && _deepEquals(description, other.description) && _deepEquals(editSuggestion, other.editSuggestion) && _deepEquals(icon, other.icon); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class TabContent { @@ -2511,13 +2544,12 @@ class TabContent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(tabId, other.tabId) && _deepEquals(fullContentMarkdown, other.fullContentMarkdown) && _deepEquals(fullContentPlain, other.fullContentPlain) && _deepEquals(isProbablyReaderable, other.isProbablyReaderable) && _deepEquals(extractedContentMarkdown, other.extractedContentMarkdown) && _deepEquals(extractedContentPlain, other.extractedContentPlain); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class ContentBlocking { @@ -2567,13 +2599,12 @@ class ContentBlocking { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(queryParameterStripping, other.queryParameterStripping) && _deepEquals(queryParameterStrippingAllowList, other.queryParameterStrippingAllowList) && _deepEquals(queryParameterStrippingStripList, other.queryParameterStrippingStripList) && _deepEquals(bounceTrackingProtectionMode, other.bounceTrackingProtectionMode); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DohSettings { @@ -2610,7 +2641,7 @@ class DohSettings { dohSettingsMode: result[0]! as DohSettingsMode, dohProviderUrl: result[1]! as String, dohDefaultProviderUrl: result[2]! as String, - dohExceptionsList: (result[3] as List?)!.cast(), + dohExceptionsList: (result[3]! as List).cast(), ); } @@ -2623,13 +2654,12 @@ class DohSettings { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(dohSettingsMode, other.dohSettingsMode) && _deepEquals(dohProviderUrl, other.dohProviderUrl) && _deepEquals(dohDefaultProviderUrl, other.dohDefaultProviderUrl) && _deepEquals(dohExceptionsList, other.dohExceptionsList); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoEngineSettings { @@ -2881,13 +2911,12 @@ class GeckoEngineSettings { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(javascriptEnabled, other.javascriptEnabled) && _deepEquals(trackingProtectionPolicy, other.trackingProtectionPolicy) && _deepEquals(httpsOnlyMode, other.httpsOnlyMode) && _deepEquals(globalPrivacyControlEnabled, other.globalPrivacyControlEnabled) && _deepEquals(preferredColorScheme, other.preferredColorScheme) && _deepEquals(cookieBannerHandlingMode, other.cookieBannerHandlingMode) && _deepEquals(cookieBannerHandlingModePrivateBrowsing, other.cookieBannerHandlingModePrivateBrowsing) && _deepEquals(cookieBannerHandlingGlobalRules, other.cookieBannerHandlingGlobalRules) && _deepEquals(cookieBannerHandlingGlobalRulesSubFrames, other.cookieBannerHandlingGlobalRulesSubFrames) && _deepEquals(webContentIsolationStrategy, other.webContentIsolationStrategy) && _deepEquals(userAgent, other.userAgent) && _deepEquals(contentBlocking, other.contentBlocking) && _deepEquals(enterpriseRootsEnabled, other.enterpriseRootsEnabled) && _deepEquals(dohSettings, other.dohSettings) && _deepEquals(fingerprintingProtectionOverrides, other.fingerprintingProtectionOverrides) && _deepEquals(locales, other.locales) && _deepEquals(blockCookies, other.blockCookies) && _deepEquals(customCookiePolicy, other.customCookiePolicy) && _deepEquals(blockTrackingContent, other.blockTrackingContent) && _deepEquals(trackingContentScope, other.trackingContentScope) && _deepEquals(blockCryptominers, other.blockCryptominers) && _deepEquals(blockFingerprinters, other.blockFingerprinters) && _deepEquals(blockRedirectTrackers, other.blockRedirectTrackers) && _deepEquals(blockSuspectedFingerprinters, other.blockSuspectedFingerprinters) && _deepEquals(suspectedFingerprintersScope, other.suspectedFingerprintersScope) && _deepEquals(allowListBaseline, other.allowListBaseline) && _deepEquals(allowListConvenience, other.allowListConvenience) && _deepEquals(webFontsEnabled, other.webFontsEnabled) && _deepEquals(automaticFontSizeAdjustment, other.automaticFontSizeAdjustment) && _deepEquals(fontSizeFactor, other.fontSizeFactor) && _deepEquals(fontInflationEnabled, other.fontInflationEnabled) && _deepEquals(displayDensityOverride, other.displayDensityOverride) && _deepEquals(screenWidthOverride, other.screenWidthOverride) && _deepEquals(screenHeightOverride, other.screenHeightOverride) && _deepEquals(inputAutoZoomEnabled, other.inputAutoZoomEnabled) && _deepEquals(fissionEnabled, other.fissionEnabled) && _deepEquals(isolatedProcessEnabled, other.isolatedProcessEnabled) && _deepEquals(appZygoteProcessEnabled, other.appZygoteProcessEnabled) && _deepEquals(extensionsWebAPIEnabled, other.extensionsWebAPIEnabled) && _deepEquals(lnaBlocking, other.lnaBlocking) && _deepEquals(lnaBlockTrackers, other.lnaBlockTrackers) && _deepEquals(lnaEnabled, other.lnaEnabled); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class AutocompleteResult { @@ -2942,13 +2971,12 @@ class AutocompleteResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(input, other.input) && _deepEquals(text, other.text) && _deepEquals(url, other.url) && _deepEquals(source, other.source) && _deepEquals(totalItems, other.totalItems); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents all the different supported types of data that can be found from long clicking @@ -2994,13 +3022,12 @@ class UnknownHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(linkText, other.linkText); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// If the HTML element was of type 'HTMLImageElement'. @@ -3041,13 +3068,12 @@ class ImageHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(title, other.title); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// If the HTML element was of type 'HTMLVideoElement'. @@ -3088,13 +3114,12 @@ class VideoHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(title, other.title); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// If the HTML element was of type 'HTMLAudioElement'. @@ -3135,13 +3160,12 @@ class AudioHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(title, other.title); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// If the HTML element was of type 'HTMLImageElement' and contained a URI. @@ -3182,13 +3206,12 @@ class ImageSrcHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(uri, other.uri); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// The type used if the URI is prepended with 'tel:'. @@ -3224,13 +3247,12 @@ class PhoneHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// The type used if the URI is prepended with 'mailto:'. @@ -3266,13 +3288,12 @@ class EmailHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// The type used if the URI is prepended with 'geo:'. @@ -3308,13 +3329,12 @@ class GeoHitResult extends HitResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class DownloadState { @@ -3429,13 +3449,12 @@ class DownloadState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(fileName, other.fileName) && _deepEquals(contentType, other.contentType) && _deepEquals(contentLength, other.contentLength) && _deepEquals(currentBytesCopied, other.currentBytesCopied) && _deepEquals(status, other.status) && _deepEquals(userAgent, other.userAgent) && _deepEquals(destinationDirectory, other.destinationDirectory) && _deepEquals(directoryPath, other.directoryPath) && _deepEquals(referrerUrl, other.referrerUrl) && _deepEquals(skipConfirmation, other.skipConfirmation) && _deepEquals(openInApp, other.openInApp) && _deepEquals(id, other.id) && _deepEquals(sessionId, other.sessionId) && _deepEquals(private, other.private) && _deepEquals(createdTime, other.createdTime) && _deepEquals(notificationId, other.notificationId); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class ShareInternetResourceState { @@ -3485,13 +3504,12 @@ class ShareInternetResourceState { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(contentType, other.contentType) && _deepEquals(private, other.private) && _deepEquals(referrerUrl, other.referrerUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class AddonCollection { @@ -3536,13 +3554,12 @@ class AddonCollection { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(serverURL, other.serverURL) && _deepEquals(collectionUser, other.collectionUser) && _deepEquals(collectionName, other.collectionName); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncEngineStatus { @@ -3582,13 +3599,12 @@ class SyncEngineStatus { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(engine, other.engine) && _deepEquals(enabled, other.enabled); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncAccountInfo { @@ -3640,7 +3656,7 @@ class SyncAccountInfo { email: result[3] as String?, displayName: result[4] as String?, lastSyncedAt: result[5] as int?, - engines: (result[6] as List?)!.cast(), + engines: (result[6]! as List).cast(), ); } @@ -3653,13 +3669,12 @@ class SyncAccountInfo { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(authenticated, other.authenticated) && _deepEquals(syncing, other.syncing) && _deepEquals(needsReauth, other.needsReauth) && _deepEquals(email, other.email) && _deepEquals(displayName, other.displayName) && _deepEquals(lastSyncedAt, other.lastSyncedAt) && _deepEquals(engines, other.engines); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncDevice { @@ -3709,13 +3724,12 @@ class SyncDevice { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(deviceId, other.deviceId) && _deepEquals(displayName, other.displayName) && _deepEquals(isCurrentDevice, other.isCurrentDevice) && _deepEquals(canSendTab, other.canSendTab); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncIncomingTab { @@ -3765,13 +3779,12 @@ class SyncIncomingTab { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(title, other.title) && _deepEquals(url, other.url) && _deepEquals(fromDeviceId, other.fromDeviceId) && _deepEquals(fromDeviceName, other.fromDeviceName); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncRemoteTab { @@ -3826,13 +3839,12 @@ class SyncRemoteTab { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(title, other.title) && _deepEquals(url, other.url) && _deepEquals(iconUrl, other.iconUrl) && _deepEquals(lastUsed, other.lastUsed) && _deepEquals(inactive, other.inactive); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class SyncDeviceTabs { @@ -3864,7 +3876,7 @@ class SyncDeviceTabs { return SyncDeviceTabs( deviceId: result[0]! as String, deviceName: result[1]! as String, - tabs: (result[2] as List?)!.cast(), + tabs: (result[2]! as List).cast(), ); } @@ -3877,13 +3889,12 @@ class SyncDeviceTabs { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(deviceId, other.deviceId) && _deepEquals(deviceName, other.deviceName) && _deepEquals(tabs, other.tabs); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoPref { @@ -3938,13 +3949,12 @@ class GeckoPref { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(name, other.name) && _deepEquals(value, other.value) && _deepEquals(defaultValue, other.defaultValue) && _deepEquals(userValue, other.userValue) && _deepEquals(hasUserChangedValue, other.hasUserChangedValue); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Progress information for ML model operations @@ -4035,13 +4045,12 @@ class MlProgressData { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(modelType, other.modelType) && _deepEquals(progress, other.progress) && _deepEquals(type, other.type) && _deepEquals(status, other.status) && _deepEquals(totalLoaded, other.totalLoaded) && _deepEquals(currentLoaded, other.currentLoaded) && _deepEquals(total, other.total) && _deepEquals(units, other.units) && _deepEquals(ok, other.ok) && _deepEquals(id, other.id); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class ContainerSiteAssignment { @@ -4096,13 +4105,12 @@ class ContainerSiteAssignment { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(requestId, other.requestId) && _deepEquals(tabId, other.tabId) && _deepEquals(originUrl, other.originUrl) && _deepEquals(url, other.url) && _deepEquals(blocked, other.blocked); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoHeader { @@ -4142,13 +4150,12 @@ class GeckoHeader { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(key, other.key) && _deepEquals(value, other.value); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoFetchRequest { @@ -4220,7 +4227,7 @@ class GeckoFetchRequest { return GeckoFetchRequest( url: result[0]! as String, method: result[1]! as GeckoFetchMethod, - headers: (result[2] as List?)!.cast(), + headers: (result[2]! as List).cast(), connectTimeoutMillis: result[3] as int?, readTimeoutMillis: result[4] as int?, body: result[5] as String?, @@ -4243,13 +4250,12 @@ class GeckoFetchRequest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(method, other.method) && _deepEquals(headers, other.headers) && _deepEquals(connectTimeoutMillis, other.connectTimeoutMillis) && _deepEquals(readTimeoutMillis, other.readTimeoutMillis) && _deepEquals(body, other.body) && _deepEquals(redirect, other.redirect) && _deepEquals(cookiePolicy, other.cookiePolicy) && _deepEquals(useCaches, other.useCaches) && _deepEquals(private, other.private) && _deepEquals(useOhttp, other.useOhttp) && _deepEquals(referrerUrl, other.referrerUrl) && _deepEquals(conservative, other.conservative); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class GeckoFetchResponse { @@ -4285,7 +4291,7 @@ class GeckoFetchResponse { return GeckoFetchResponse( url: result[0]! as String, status: result[1]! as int, - headers: (result[2] as List?)!.cast(), + headers: (result[2]! as List).cast(), body: result[3]! as Uint8List, ); } @@ -4299,13 +4305,12 @@ class GeckoFetchResponse { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url) && _deepEquals(status, other.status) && _deepEquals(headers, other.headers) && _deepEquals(body, other.body); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } class BookmarkNode { @@ -4380,13 +4385,12 @@ class BookmarkNode { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(type, other.type) && _deepEquals(guid, other.guid) && _deepEquals(parentGuid, other.parentGuid) && _deepEquals(position, other.position) && _deepEquals(title, other.title) && _deepEquals(url, other.url) && _deepEquals(dateAdded, other.dateAdded) && _deepEquals(lastModified, other.lastModified) && _deepEquals(children, other.children); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Class for making alterations to any bookmark node @@ -4437,13 +4441,12 @@ class BookmarkInfo { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(parentGuid, other.parentGuid) && _deepEquals(position, other.position) && _deepEquals(title, other.title) && _deepEquals(url, other.url); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Site permissions data structure @@ -4539,13 +4542,12 @@ class SitePermissions { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(origin, other.origin) && _deepEquals(camera, other.camera) && _deepEquals(microphone, other.microphone) && _deepEquals(location, other.location) && _deepEquals(notification, other.notification) && _deepEquals(persistentStorage, other.persistentStorage) && _deepEquals(crossOriginStorageAccess, other.crossOriginStorageAccess) && _deepEquals(mediaKeySystemAccess, other.mediaKeySystemAccess) && _deepEquals(localDeviceAccess, other.localDeviceAccess) && _deepEquals(localNetworkAccess, other.localNetworkAccess) && _deepEquals(autoplayAudible, other.autoplayAudible) && _deepEquals(autoplayInaudible, other.autoplayInaudible) && _deepEquals(savedAt, other.savedAt); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Tracking protection exception for a site @@ -4584,13 +4586,12 @@ class TrackingProtectionException { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(url, other.url); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents an icon from a PWA manifest. @@ -4636,13 +4637,12 @@ class PwaIcon { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(src, other.src) && _deepEquals(sizes, other.sizes) && _deepEquals(type, other.type); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents a file entry in share target params. @@ -4670,7 +4670,7 @@ class ShareTargetFiles { result as List; return ShareTargetFiles( name: result[0]! as String, - accept: (result[1] as List?)!.cast(), + accept: (result[1]! as List).cast(), ); } @@ -4683,13 +4683,12 @@ class ShareTargetFiles { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(name, other.name) && _deepEquals(accept, other.accept); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents share target params. @@ -4727,7 +4726,7 @@ class ShareTargetParams { title: result[0] as String?, text: result[1] as String?, url: result[2] as String?, - files: (result[3] as List?)!.cast(), + files: (result[3]! as List).cast(), ); } @@ -4740,13 +4739,12 @@ class ShareTargetParams { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(title, other.title) && _deepEquals(text, other.text) && _deepEquals(url, other.url) && _deepEquals(files, other.files); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents a share target for PWA. @@ -4797,13 +4795,12 @@ class ShareTarget { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(action, other.action) && _deepEquals(method, other.method) && _deepEquals(encType, other.encType) && _deepEquals(params, other.params); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents an external application resource. @@ -4854,13 +4851,12 @@ class ExternalApplicationResource { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(platform, other.platform) && _deepEquals(url, other.url) && _deepEquals(id, other.id) && _deepEquals(minVersion, other.minVersion); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Represents a PWA web app manifest. @@ -4956,11 +4952,11 @@ class PwaManifest { backgroundColor: result[5] as String?, scope: result[6] as String?, description: result[7] as String?, - icons: (result[8] as List?)!.cast(), + icons: (result[8]! as List).cast(), dir: result[9] as String?, lang: result[10] as String?, orientation: result[11] as String?, - relatedApplications: (result[12] as List?)!.cast(), + relatedApplications: (result[12]! as List).cast(), preferRelatedApplications: result[13]! as bool, shareTarget: result[14] as ShareTarget?, currentUrl: result[15]! as String, @@ -4976,13 +4972,12 @@ class PwaManifest { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(startUrl, other.startUrl) && _deepEquals(name, other.name) && _deepEquals(shortName, other.shortName) && _deepEquals(display, other.display) && _deepEquals(themeColor, other.themeColor) && _deepEquals(backgroundColor, other.backgroundColor) && _deepEquals(scope, other.scope) && _deepEquals(description, other.description) && _deepEquals(icons, other.icons) && _deepEquals(dir, other.dir) && _deepEquals(lang, other.lang) && _deepEquals(orientation, other.orientation) && _deepEquals(relatedApplications, other.relatedApplications) && _deepEquals(preferRelatedApplications, other.preferRelatedApplications) && _deepEquals(shareTarget, other.shareTarget) && _deepEquals(currentUrl, other.currentUrl); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -5319,250 +5314,250 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final value = readValue(buffer) as int?; return value == null ? null : RestoreLocation.values[value]; - case 130: + case 130: final value = readValue(buffer) as int?; return value == null ? null : IconType.values[value]; - case 131: + case 131: final value = readValue(buffer) as int?; return value == null ? null : IconSize.values[value]; - case 132: + case 132: final value = readValue(buffer) as int?; return value == null ? null : IconSource.values[value]; - case 133: + case 133: final value = readValue(buffer) as int?; return value == null ? null : CookieSameSiteStatus.values[value]; - case 134: + case 134: final value = readValue(buffer) as int?; return value == null ? null : VisitType.values[value]; - case 135: + case 135: final value = readValue(buffer) as int?; return value == null ? null : FrecencyThresholdOption.values[value]; - case 136: + case 136: final value = readValue(buffer) as int?; return value == null ? null : SelectionPattern.values[value]; - case 137: + case 137: final value = readValue(buffer) as int?; return value == null ? null : WebExtensionActionType.values[value]; - case 138: + case 138: final value = readValue(buffer) as int?; return value == null ? null : GeckoSuggestionType.values[value]; - case 139: + case 139: final value = readValue(buffer) as int?; return value == null ? null : TrackingProtectionPolicy.values[value]; - case 140: + case 140: final value = readValue(buffer) as int?; return value == null ? null : HttpsOnlyMode.values[value]; - case 141: + case 141: final value = readValue(buffer) as int?; return value == null ? null : QueryParameterStripping.values[value]; - case 142: + case 142: final value = readValue(buffer) as int?; return value == null ? null : BounceTrackingProtectionMode.values[value]; - case 143: + case 143: final value = readValue(buffer) as int?; return value == null ? null : ColorScheme.values[value]; - case 144: + case 144: final value = readValue(buffer) as int?; return value == null ? null : CookieBannerHandlingMode.values[value]; - case 145: + case 145: final value = readValue(buffer) as int?; return value == null ? null : AppLinksMode.values[value]; - case 146: + case 146: final value = readValue(buffer) as int?; return value == null ? null : WebContentIsolationStrategy.values[value]; - case 147: + case 147: final value = readValue(buffer) as int?; return value == null ? null : CustomCookiePolicy.values[value]; - case 148: + case 148: final value = readValue(buffer) as int?; return value == null ? null : TrackingScope.values[value]; - case 149: + case 149: final value = readValue(buffer) as int?; return value == null ? null : DohSettingsMode.values[value]; - case 150: + case 150: final value = readValue(buffer) as int?; return value == null ? null : DownloadStatus.values[value]; - case 151: + case 151: final value = readValue(buffer) as int?; return value == null ? null : LogLevel.values[value]; - case 152: + case 152: final value = readValue(buffer) as int?; return value == null ? null : SyncEngineValue.values[value]; - case 153: + case 153: final value = readValue(buffer) as int?; return value == null ? null : MlProgressType.values[value]; - case 154: + case 154: final value = readValue(buffer) as int?; return value == null ? null : MlProgressStatus.values[value]; - case 155: + case 155: final value = readValue(buffer) as int?; return value == null ? null : ClearDataType.values[value]; - case 156: + case 156: final value = readValue(buffer) as int?; return value == null ? null : GeckoFetchMethod.values[value]; - case 157: + case 157: final value = readValue(buffer) as int?; return value == null ? null : GeckoFetchRedircet.values[value]; - case 158: + case 158: final value = readValue(buffer) as int?; return value == null ? null : GeckoFetchCookiePolicy.values[value]; - case 159: + case 159: final value = readValue(buffer) as int?; return value == null ? null : BookmarkNodeType.values[value]; - case 160: + case 160: final value = readValue(buffer) as int?; return value == null ? null : SitePermissionStatus.values[value]; - case 161: + case 161: final value = readValue(buffer) as int?; return value == null ? null : AutoplayStatus.values[value]; - case 162: + case 162: return TranslationOptions.decode(readValue(buffer)!); - case 163: + case 163: return TranslationLanguage.decode(readValue(buffer)!); - case 164: + case 164: return TranslationDetectedLanguages.decode(readValue(buffer)!); - case 165: + case 165: return TranslationPair.decode(readValue(buffer)!); - case 166: + case 166: return TranslationEngineStateData.decode(readValue(buffer)!); - case 167: + case 167: return TabTranslationStateData.decode(readValue(buffer)!); - case 168: + case 168: return ReaderState.decode(readValue(buffer)!); - case 169: + case 169: return AddTabParams.decode(readValue(buffer)!); - case 170: + case 170: return LastMediaAccessState.decode(readValue(buffer)!); - case 171: + case 171: return HistoryMetadataKey.decode(readValue(buffer)!); - case 172: + case 172: return PackageCategoryValue.decode(readValue(buffer)!); - case 173: + case 173: return ExternalPackage.decode(readValue(buffer)!); - case 174: + case 174: return LoadUrlFlagsValue.decode(readValue(buffer)!); - case 175: + case 175: return SourceValue.decode(readValue(buffer)!); - case 176: + case 176: return TabState.decode(readValue(buffer)!); - case 177: + case 177: return RecoverableTab.decode(readValue(buffer)!); - case 178: + case 178: return IconRequest.decode(readValue(buffer)!); - case 179: + case 179: return ResourceSize.decode(readValue(buffer)!); - case 180: + case 180: return Resource.decode(readValue(buffer)!); - case 181: + case 181: return IconResult.decode(readValue(buffer)!); - case 182: + case 182: return CookiePartitionKey.decode(readValue(buffer)!); - case 183: + case 183: return Cookie.decode(readValue(buffer)!); - case 184: + case 184: return VisitInfo.decode(readValue(buffer)!); - case 185: + case 185: return HistoryHighlightWeights.decode(readValue(buffer)!); - case 186: + case 186: return HistoryHighlight.decode(readValue(buffer)!); - case 187: + case 187: return TopFrecentSiteInfo.decode(readValue(buffer)!); - case 188: + case 188: return HistoryItem.decode(readValue(buffer)!); - case 189: + case 189: return HistoryState.decode(readValue(buffer)!); - case 190: + case 190: return ReaderableState.decode(readValue(buffer)!); - case 191: + case 191: return SecurityInfoState.decode(readValue(buffer)!); - case 192: + case 192: return TabContentState.decode(readValue(buffer)!); - case 193: + case 193: return FindResultState.decode(readValue(buffer)!); - case 194: + case 194: return CustomSelectionAction.decode(readValue(buffer)!); - case 195: + case 195: return WebExtensionData.decode(readValue(buffer)!); - case 196: + case 196: return GeckoSuggestion.decode(readValue(buffer)!); - case 197: + case 197: return TabContent.decode(readValue(buffer)!); - case 198: + case 198: return ContentBlocking.decode(readValue(buffer)!); - case 199: + case 199: return DohSettings.decode(readValue(buffer)!); - case 200: + case 200: return GeckoEngineSettings.decode(readValue(buffer)!); - case 201: + case 201: return AutocompleteResult.decode(readValue(buffer)!); - case 202: + case 202: return UnknownHitResult.decode(readValue(buffer)!); - case 203: + case 203: return ImageHitResult.decode(readValue(buffer)!); - case 204: + case 204: return VideoHitResult.decode(readValue(buffer)!); - case 205: + case 205: return AudioHitResult.decode(readValue(buffer)!); - case 206: + case 206: return ImageSrcHitResult.decode(readValue(buffer)!); - case 207: + case 207: return PhoneHitResult.decode(readValue(buffer)!); - case 208: + case 208: return EmailHitResult.decode(readValue(buffer)!); - case 209: + case 209: return GeoHitResult.decode(readValue(buffer)!); - case 210: + case 210: return DownloadState.decode(readValue(buffer)!); - case 211: + case 211: return ShareInternetResourceState.decode(readValue(buffer)!); - case 212: + case 212: return AddonCollection.decode(readValue(buffer)!); - case 213: + case 213: return SyncEngineStatus.decode(readValue(buffer)!); - case 214: + case 214: return SyncAccountInfo.decode(readValue(buffer)!); - case 215: + case 215: return SyncDevice.decode(readValue(buffer)!); - case 216: + case 216: return SyncIncomingTab.decode(readValue(buffer)!); - case 217: + case 217: return SyncRemoteTab.decode(readValue(buffer)!); - case 218: + case 218: return SyncDeviceTabs.decode(readValue(buffer)!); - case 219: + case 219: return GeckoPref.decode(readValue(buffer)!); - case 220: + case 220: return MlProgressData.decode(readValue(buffer)!); - case 221: + case 221: return ContainerSiteAssignment.decode(readValue(buffer)!); - case 222: + case 222: return GeckoHeader.decode(readValue(buffer)!); - case 223: + case 223: return GeckoFetchRequest.decode(readValue(buffer)!); - case 224: + case 224: return GeckoFetchResponse.decode(readValue(buffer)!); - case 225: + case 225: return BookmarkNode.decode(readValue(buffer)!); - case 226: + case 226: return BookmarkInfo.decode(readValue(buffer)!); - case 227: + case 227: return SitePermissions.decode(readValue(buffer)!); - case 228: + case 228: return TrackingProtectionException.decode(readValue(buffer)!); - case 229: + case 229: return PwaIcon.decode(readValue(buffer)!); - case 230: + case 230: return ShareTargetFiles.decode(readValue(buffer)!); - case 231: + case 231: return ShareTargetParams.decode(readValue(buffer)!); - case 232: + case 232: return ShareTarget.decode(readValue(buffer)!); - case 233: + case 233: return ExternalApplicationResource.decode(readValue(buffer)!); - case 234: + case 234: return PwaManifest.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -5592,22 +5587,14 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } Future initialize(String profileFolder, LogLevel logLevel, ContentBlocking contentBlocking, AddonCollection? addonCollection, String? fxaServerOverride, String? syncTokenServerOverride, GeckoEngineSettings? startupSettings) async { @@ -5619,17 +5606,13 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([profileFolder, logLevel, contentBlocking, addonCollection, fxaServerOverride, syncTokenServerOverride, startupSettings]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future showNativeFragment() async { @@ -5641,22 +5624,14 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } Future onTrimMemory(int level) async { @@ -5668,17 +5643,13 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([level]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future openInCustomTab({required String url, required bool private, required String? contextId, }) async { @@ -5690,17 +5661,13 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url, private, contextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future isDefaultBrowser() async { @@ -5712,22 +5679,14 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } Future requestDefaultBrowser() async { @@ -5739,17 +5698,13 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future shutdown() async { @@ -5761,17 +5716,13 @@ class GeckoBrowserApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -5797,22 +5748,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as SyncAccountInfo?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as SyncAccountInfo; } Future beginAuthentication() async { @@ -5824,17 +5767,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future beginPairingAuthentication(String pairingUrl) async { @@ -5846,17 +5785,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([pairingUrl]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future logout() async { @@ -5868,17 +5803,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future syncNow() async { @@ -5890,17 +5821,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future setEngineEnabled(SyncEngineValue engine, bool enabled) async { @@ -5912,17 +5839,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([engine, enabled]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future> getSyncedTabs() async { @@ -5934,22 +5857,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future> getDevices() async { @@ -5961,22 +5876,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future sendTabToDevice(String deviceId, String title, String url, bool private) async { @@ -5988,22 +5895,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([deviceId, title, url, private]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } Future refreshDevices() async { @@ -6015,17 +5914,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future pollDeviceCommands() async { @@ -6037,17 +5932,13 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future> drainIncomingTabs() async { @@ -6059,22 +5950,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future getDeviceName() async { @@ -6086,17 +5969,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as String?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as String?; } Future setDeviceName(String newName) async { @@ -6108,22 +5988,14 @@ class GeckoSyncApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([newName]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -6149,17 +6021,13 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([settings]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future updateRuntimeSettings(GeckoEngineSettings settings) async { @@ -6171,17 +6039,13 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([settings]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future setPullToRefreshEnabled(bool enabled) async { @@ -6193,17 +6057,13 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([enabled]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Sets the app links mode preference (stored in SharedPreferences). @@ -6217,17 +6077,13 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([mode]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future getAppLinksMode() async { @@ -6239,22 +6095,14 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as AppLinksMode?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as AppLinksMode; } /// Sets whether to use external download managers for downloads. @@ -6268,17 +6116,13 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([enabled]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future getUseExternalDownloadManager() async { @@ -6290,22 +6134,14 @@ class GeckoEngineSettingsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -6331,17 +6167,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, url, flags, additionalHeaders]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future loadData({required String? tabId, required String data, required String mimeType, required String encoding, }) async { @@ -6353,17 +6185,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, data, mimeType, encoding]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future reload({required String? tabId, required LoadUrlFlagsValue flags}) async { @@ -6375,17 +6203,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, flags]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future stopLoading({required String? tabId}) async { @@ -6397,17 +6221,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future goBack({required String? tabId, required bool userInteraction}) async { @@ -6419,17 +6239,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, userInteraction]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future goForward({required String? tabId, required bool userInteraction}) async { @@ -6441,17 +6257,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, userInteraction]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future goToHistoryIndex({required int index, required String? tabId}) async { @@ -6463,17 +6275,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([index, tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future requestDesktopSite({required String? tabId, required bool enable}) async { @@ -6485,17 +6293,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, enable]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future exitFullscreen({required String? tabId}) async { @@ -6507,17 +6311,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future saveToPdf({required String? tabId}) async { @@ -6529,17 +6329,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future printContent({required String? tabId}) async { @@ -6551,17 +6347,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future translate({required String? tabId, required String fromLanguage, required String toLanguage, required TranslationOptions? options, }) async { @@ -6573,17 +6365,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, fromLanguage, toLanguage, options]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future translateRestore({required String? tabId}) async { @@ -6595,17 +6383,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future crashRecovery({required List? tabIds}) async { @@ -6617,17 +6401,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabIds]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future purgeHistory() async { @@ -6639,17 +6419,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future updateLastAccess({required String? tabId, required int? lastAccess}) async { @@ -6661,17 +6437,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, lastAccess]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future requestScreenshot(bool sendBack) async { @@ -6683,17 +6455,14 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([sendBack]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as Uint8List?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as Uint8List?; } Future dispatchKeyEvent({required int keyCode}) async { @@ -6705,17 +6474,13 @@ class GeckoSessionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([keyCode]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -6741,17 +6506,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([onSelectedTabChange, onTabListChange, onTabContentStateChange, onIconChange, onSecurityInfoStateChange, onReaderableStateChange, onHistoryStateChange, onFindResults, onThumbnailChange, onBrowserExtensionsChange, onPageExtensionsChange, onBrowserExtensionIcons, onPageExtensionIcons, onTranslationStateChange]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future selectTab({required String tabId}) async { @@ -6763,17 +6524,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removeTab({required String tabId}) async { @@ -6785,17 +6542,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future addTab({required String url, required bool selectTab, required bool startLoading, required String? parentId, required LoadUrlFlagsValue flags, required String? contextId, required SourceValue source, required bool private, required HistoryMetadataKey? historyMetadata, required Map? additionalHeaders, }) async { @@ -6807,22 +6560,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url, selectTab, startLoading, parentId, flags, contextId, source, private, historyMetadata, additionalHeaders]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } Future> addMultipleTabs({required List tabs, required String? selectTabId}) async { @@ -6834,22 +6579,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabs, selectTabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future removeAllTabs({required bool recoverable}) async { @@ -6861,17 +6598,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([recoverable]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removeTabs({required List ids}) async { @@ -6883,17 +6616,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([ids]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removeNormalTabs() async { @@ -6905,17 +6634,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removePrivateTabs() async { @@ -6927,17 +6652,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future undo() async { @@ -6949,17 +6670,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future restoreTabsByList({required List tabs, required String? selectTabId, required RestoreLocation restoreLocation, }) async { @@ -6971,17 +6688,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabs, selectTabId, restoreLocation]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Selects an already existing tab with the matching [HistoryMetadataKey] or otherwise @@ -6995,22 +6708,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url, historyMetadata]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } /// Selects an already existing tab displaying [url] or otherwise creates a new tab. @@ -7023,22 +6728,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url, private, source, flags, ignoreFragment]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } Future duplicateTab({required String? selectTabId, required bool selectNewTab, required String? newContextId, }) async { @@ -7050,22 +6747,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([selectTabId, selectNewTab, newContextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } Future moveTabs({required List tabIds, required String targetTabId, required bool placeAfter, }) async { @@ -7077,17 +6766,13 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabIds, targetTabId, placeAfter]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future migratePrivateTabUseCase({required String tabId, required String? alternativeUrl}) async { @@ -7099,22 +6784,14 @@ class GeckoTabsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, alternativeUrl]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } } @@ -7140,17 +6817,13 @@ class GeckoFindApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, text]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future findNext(String? tabId, bool forward) async { @@ -7162,17 +6835,13 @@ class GeckoFindApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, forward]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future clearMatches(String? tabId) async { @@ -7184,17 +6853,13 @@ class GeckoFindApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -7220,22 +6885,14 @@ class GeckoIconsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([request]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as IconResult?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as IconResult; } } @@ -7252,33 +6909,6 @@ class GeckoPrefApi { final String pigeonVar_messageChannelSuffix; - Future> getPrefList() async { - final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoPrefApi.getPrefList$pigeonVar_messageChannelSuffix'; - final pigeonVar_channel = BasicMessageChannel( - pigeonVar_channelName, - pigeonChannelCodec, - binaryMessenger: pigeonVar_binaryMessenger, - ); - final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); - final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } - } - Future> getPrefs(List preferenceFilter) async { final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_mozilla_components.GeckoPrefApi.getPrefs$pigeonVar_messageChannelSuffix'; final pigeonVar_channel = BasicMessageChannel( @@ -7288,22 +6918,14 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([preferenceFilter]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as Map).cast(); } Future> applyPrefs(Map prefs) async { @@ -7315,22 +6937,14 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([prefs]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Map?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as Map).cast(); } Future resetPrefs(List preferenceNames) async { @@ -7342,17 +6956,13 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([preferenceNames]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future startObserveChanges() async { @@ -7364,17 +6974,13 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future stopObserveChanges() async { @@ -7386,17 +6992,13 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future registerPrefForObservation(String name) async { @@ -7408,17 +7010,13 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future unregisterPrefForObservation(String name) async { @@ -7430,17 +7028,13 @@ class GeckoPrefApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([name]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -7466,22 +7060,14 @@ class GeckoMlApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([documents]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } Future> generateDocumentEmbeddings(List documents) async { @@ -7493,22 +7079,14 @@ class GeckoMlApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([documents]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as List; } } @@ -7534,22 +7112,14 @@ class GeckoBrowserExtensionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([htmlList]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } } @@ -7575,17 +7145,13 @@ class GeckoContainerProxyApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([port]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future addContainerProxy(String contextId) async { @@ -7597,17 +7163,13 @@ class GeckoContainerProxyApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([contextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removeContainerProxy(String contextId) async { @@ -7619,17 +7181,13 @@ class GeckoContainerProxyApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([contextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future setSiteAssignments(Map assignments) async { @@ -7641,17 +7199,13 @@ class GeckoContainerProxyApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([assignments]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future healthcheck() async { @@ -7663,22 +7217,14 @@ class GeckoContainerProxyApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -7704,22 +7250,14 @@ class GeckoCookieApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([firstPartyDomain, name, partitionKey, storeId, url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as Cookie?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as Cookie; } Future> getAllCookies(String? domain, String? firstPartyDomain, String? name, CookiePartitionKey? partitionKey, String? storeId, String url) async { @@ -7731,22 +7269,14 @@ class GeckoCookieApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([domain, firstPartyDomain, name, partitionKey, storeId, url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future setCookie(String? domain, int? expirationDate, String? firstPartyDomain, bool? httpOnly, String? name, CookiePartitionKey? partitionKey, String? path, CookieSameSiteStatus? sameSite, bool? secure, String? storeId, String url, String? value) async { @@ -7758,17 +7288,13 @@ class GeckoCookieApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([domain, expirationDate, firstPartyDomain, httpOnly, name, partitionKey, path, sameSite, secure, storeId, url, value]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future removeCookie(String? firstPartyDomain, String name, CookiePartitionKey? partitionKey, String? storeId, String url) async { @@ -7780,17 +7306,13 @@ class GeckoCookieApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([firstPartyDomain, name, partitionKey, storeId, url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -7847,17 +7369,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onViewReadyStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onViewReadyStateChange was null, expected non-null int.'); - final bool? arg_state = (args[1] as bool?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onViewReadyStateChange was null, expected non-null bool.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final bool arg_state = args[1]! as bool; try { - api.onViewReadyStateChange(arg_sequence!, arg_state!); + api.onViewReadyStateChange(arg_sequence, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -7875,17 +7391,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onEngineReadyStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onEngineReadyStateChange was null, expected non-null int.'); - final bool? arg_state = (args[1] as bool?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onEngineReadyStateChange was null, expected non-null bool.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final bool arg_state = args[1]! as bool; try { - api.onEngineReadyStateChange(arg_sequence!, arg_state!); + api.onEngineReadyStateChange(arg_sequence, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -7903,20 +7413,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconUpdate was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconUpdate was null, expected non-null int.'); - final String? arg_url = (args[1] as String?); - assert(arg_url != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconUpdate was null, expected non-null String.'); - final Uint8List? arg_bytes = (args[2] as Uint8List?); - assert(arg_bytes != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconUpdate was null, expected non-null Uint8List.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_url = args[1]! as String; + final Uint8List arg_bytes = args[2]! as Uint8List; try { - api.onIconUpdate(arg_sequence!, arg_url!, arg_bytes!); + api.onIconUpdate(arg_sequence, arg_url, arg_bytes); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -7934,17 +7436,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabAdded was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabAdded was null, expected non-null int.'); - final String? arg_tabId = (args[1] as String?); - assert(arg_tabId != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabAdded was null, expected non-null String.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_tabId = args[1]! as String; try { - api.onTabAdded(arg_sequence!, arg_tabId!); + api.onTabAdded(arg_sequence, arg_tabId); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -7962,17 +7458,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabListChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabListChange was null, expected non-null int.'); - final List? arg_tabIds = (args[1] as List?)?.cast(); - assert(arg_tabIds != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabListChange was null, expected non-null List.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final List arg_tabIds = (args[1]! as List).cast(); try { - api.onTabListChange(arg_sequence!, arg_tabIds!); + api.onTabListChange(arg_sequence, arg_tabIds); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -7990,15 +7480,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSelectedTabChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSelectedTabChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String? arg_id = args[1] as String?; try { - api.onSelectedTabChange(arg_sequence!, arg_id); + api.onSelectedTabChange(arg_sequence, arg_id); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8016,17 +7502,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabContentStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabContentStateChange was null, expected non-null int.'); - final TabContentState? arg_state = (args[1] as TabContentState?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabContentStateChange was null, expected non-null TabContentState.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final TabContentState arg_state = args[1]! as TabContentState; try { - api.onTabContentStateChange(arg_sequence!, arg_state!); + api.onTabContentStateChange(arg_sequence, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8044,20 +7524,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onHistoryStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onHistoryStateChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onHistoryStateChange was null, expected non-null String.'); - final HistoryState? arg_state = (args[2] as HistoryState?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onHistoryStateChange was null, expected non-null HistoryState.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final HistoryState arg_state = args[2]! as HistoryState; try { - api.onHistoryStateChange(arg_sequence!, arg_id!, arg_state!); + api.onHistoryStateChange(arg_sequence, arg_id, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8075,20 +7547,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onReaderableStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onReaderableStateChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onReaderableStateChange was null, expected non-null String.'); - final ReaderableState? arg_state = (args[2] as ReaderableState?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onReaderableStateChange was null, expected non-null ReaderableState.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final ReaderableState arg_state = args[2]! as ReaderableState; try { - api.onReaderableStateChange(arg_sequence!, arg_id!, arg_state!); + api.onReaderableStateChange(arg_sequence, arg_id, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8106,20 +7570,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSecurityInfoStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSecurityInfoStateChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSecurityInfoStateChange was null, expected non-null String.'); - final SecurityInfoState? arg_state = (args[2] as SecurityInfoState?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onSecurityInfoStateChange was null, expected non-null SecurityInfoState.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final SecurityInfoState arg_state = args[2]! as SecurityInfoState; try { - api.onSecurityInfoStateChange(arg_sequence!, arg_id!, arg_state!); + api.onSecurityInfoStateChange(arg_sequence, arg_id, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8137,18 +7593,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onIconChange was null, expected non-null String.'); - final Uint8List? arg_bytes = (args[2] as Uint8List?); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final Uint8List? arg_bytes = args[2] as Uint8List?; try { - api.onIconChange(arg_sequence!, arg_id!, arg_bytes); + api.onIconChange(arg_sequence, arg_id, arg_bytes); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8166,18 +7616,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onThumbnailChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onThumbnailChange was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onThumbnailChange was null, expected non-null String.'); - final Uint8List? arg_bytes = (args[2] as Uint8List?); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final Uint8List? arg_bytes = args[2] as Uint8List?; try { - api.onThumbnailChange(arg_sequence!, arg_id!, arg_bytes); + api.onThumbnailChange(arg_sequence, arg_id, arg_bytes); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8195,20 +7639,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onFindResults was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onFindResults was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onFindResults was null, expected non-null String.'); - final List? arg_results = (args[2] as List?)?.cast(); - assert(arg_results != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onFindResults was null, expected non-null List.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final List arg_results = (args[2]! as List).cast(); try { - api.onFindResults(arg_sequence!, arg_id!, arg_results!); + api.onFindResults(arg_sequence, arg_id, arg_results); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8226,20 +7662,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onLongPress was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onLongPress was null, expected non-null int.'); - final String? arg_id = (args[1] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onLongPress was null, expected non-null String.'); - final HitResult? arg_hitResult = (args[2] as HitResult?); - assert(arg_hitResult != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onLongPress was null, expected non-null HitResult.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_id = args[1]! as String; + final HitResult arg_hitResult = args[2]! as HitResult; try { - api.onLongPress(arg_sequence!, arg_id!, arg_hitResult!); + api.onLongPress(arg_sequence, arg_id, arg_hitResult); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8257,17 +7685,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onPreferenceChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onPreferenceChange was null, expected non-null int.'); - final GeckoPref? arg_value = (args[1] as GeckoPref?); - assert(arg_value != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onPreferenceChange was null, expected non-null GeckoPref.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final GeckoPref arg_value = args[1]! as GeckoPref; try { - api.onPreferenceChange(arg_sequence!, arg_value!); + api.onPreferenceChange(arg_sequence, arg_value); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8285,17 +7707,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onContainerSiteAssignment was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onContainerSiteAssignment was null, expected non-null int.'); - final ContainerSiteAssignment? arg_details = (args[1] as ContainerSiteAssignment?); - assert(arg_details != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onContainerSiteAssignment was null, expected non-null ContainerSiteAssignment.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final ContainerSiteAssignment arg_details = args[1]! as ContainerSiteAssignment; try { - api.onContainerSiteAssignment(arg_sequence!, arg_details!); + api.onContainerSiteAssignment(arg_sequence, arg_details); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8313,17 +7729,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onMlProgress was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onMlProgress was null, expected non-null int.'); - final MlProgressData? arg_progress = (args[1] as MlProgressData?); - assert(arg_progress != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onMlProgress was null, expected non-null MlProgressData.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final MlProgressData arg_progress = args[1]! as MlProgressData; try { - api.onMlProgress(arg_sequence!, arg_progress!); + api.onMlProgress(arg_sequence, arg_progress); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8341,18 +7751,12 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onManifestUpdate was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onManifestUpdate was null, expected non-null int.'); - final String? arg_tabId = (args[1] as String?); - assert(arg_tabId != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onManifestUpdate was null, expected non-null String.'); - final PwaManifest? arg_manifest = (args[2] as PwaManifest?); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_tabId = args[1]! as String; + final PwaManifest? arg_manifest = args[2] as PwaManifest?; try { - api.onManifestUpdate(arg_sequence!, arg_tabId!, arg_manifest); + api.onManifestUpdate(arg_sequence, arg_tabId, arg_manifest); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8370,17 +7774,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTranslationEngineStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTranslationEngineStateChange was null, expected non-null int.'); - final TranslationEngineStateData? arg_state = (args[1] as TranslationEngineStateData?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTranslationEngineStateChange was null, expected non-null TranslationEngineStateData.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final TranslationEngineStateData arg_state = args[1]! as TranslationEngineStateData; try { - api.onTranslationEngineStateChange(arg_sequence!, arg_state!); + api.onTranslationEngineStateChange(arg_sequence, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8398,17 +7796,11 @@ abstract class GeckoStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabTranslationStateChange was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabTranslationStateChange was null, expected non-null int.'); - final TabTranslationStateData? arg_state = (args[1] as TabTranslationStateData?); - assert(arg_state != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoStateEvents.onTabTranslationStateChange was null, expected non-null TabTranslationStateData.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final TabTranslationStateData arg_state = args[1]! as TabTranslationStateData; try { - api.onTabTranslationStateChange(arg_sequence!, arg_state!); + api.onTabTranslationStateChange(arg_sequence, arg_state); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8442,17 +7834,11 @@ abstract class GeckoSyncStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onAuthStateChanged was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onAuthStateChanged was null, expected non-null int.'); - final SyncAccountInfo? arg_accountInfo = (args[1] as SyncAccountInfo?); - assert(arg_accountInfo != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onAuthStateChanged was null, expected non-null SyncAccountInfo.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final SyncAccountInfo arg_accountInfo = args[1]! as SyncAccountInfo; try { - api.onAuthStateChanged(arg_sequence!, arg_accountInfo!); + api.onAuthStateChanged(arg_sequence, arg_accountInfo); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8470,14 +7856,10 @@ abstract class GeckoSyncStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncStarted was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncStarted was null, expected non-null int.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; try { - api.onSyncStarted(arg_sequence!); + api.onSyncStarted(arg_sequence); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8495,14 +7877,10 @@ abstract class GeckoSyncStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncCompleted was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncCompleted was null, expected non-null int.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; try { - api.onSyncCompleted(arg_sequence!); + api.onSyncCompleted(arg_sequence); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8520,15 +7898,11 @@ abstract class GeckoSyncStateEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncError was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSyncStateEvents.onSyncError was null, expected non-null int.'); - final String? arg_errorMessage = (args[1] as String?); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String? arg_errorMessage = args[1] as String?; try { - api.onSyncError(arg_sequence!, arg_errorMessage); + api.onSyncError(arg_sequence, arg_errorMessage); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8556,17 +7930,11 @@ abstract class GeckoLogging { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoLogging.onLog was null.'); - final List args = (message as List?)!; - final LogLevel? arg_level = (args[0] as LogLevel?); - assert(arg_level != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoLogging.onLog was null, expected non-null LogLevel.'); - final String? arg_message = (args[1] as String?); - assert(arg_message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoLogging.onLog was null, expected non-null String.'); + final List args = message! as List; + final LogLevel arg_level = args[0]! as LogLevel; + final String arg_message = args[1]! as String; try { - api.onLog(arg_level!, arg_message!); + api.onLog(arg_level, arg_message); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8601,17 +7969,13 @@ class ReaderViewEvents { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([enable]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future onAppearanceButtonTap() async { @@ -8623,17 +7987,13 @@ class ReaderViewEvents { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -8652,17 +8012,11 @@ abstract class ReaderViewController { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.ReaderViewController.appearanceButtonVisibility was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.ReaderViewController.appearanceButtonVisibility was null, expected non-null int.'); - final bool? arg_visible = (args[1] as bool?); - assert(arg_visible != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.ReaderViewController.appearanceButtonVisibility was null, expected non-null bool.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final bool arg_visible = args[1]! as bool; try { - api.appearanceButtonVisibility(arg_sequence!, arg_visible!); + api.appearanceButtonVisibility(arg_sequence, arg_visible); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8697,17 +8051,13 @@ class GeckoSelectionActionController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([actions]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -8726,17 +8076,11 @@ abstract class GeckoSelectionActionEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSelectionActionEvents.performSelectionAction was null.'); - final List args = (message as List?)!; - final String? arg_id = (args[0] as String?); - assert(arg_id != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSelectionActionEvents.performSelectionAction was null, expected non-null String.'); - final String? arg_selectedText = (args[1] as String?); - assert(arg_selectedText != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSelectionActionEvents.performSelectionAction was null, expected non-null String.'); + final List args = message! as List; + final String arg_id = args[0]! as String; + final String arg_selectedText = args[1]! as String; try { - api.performSelectionAction(arg_id!, arg_selectedText!); + api.performSelectionAction(arg_id, arg_selectedText); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8771,17 +8115,13 @@ class GeckoAddonsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future startAddonSettingsActivity(String extensionId) async { @@ -8793,17 +8133,13 @@ class GeckoAddonsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([extensionId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future invokeAddonAction(String extensionId, WebExtensionActionType actionType) async { @@ -8815,17 +8151,13 @@ class GeckoAddonsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([extensionId, actionType]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future installAddon(String url) async { @@ -8837,17 +8169,13 @@ class GeckoAddonsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -8870,23 +8198,13 @@ abstract class GeckoAddonEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpsertWebExtensionAction was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpsertWebExtensionAction was null, expected non-null int.'); - final String? arg_extensionId = (args[1] as String?); - assert(arg_extensionId != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpsertWebExtensionAction was null, expected non-null String.'); - final WebExtensionActionType? arg_actionType = (args[2] as WebExtensionActionType?); - assert(arg_actionType != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpsertWebExtensionAction was null, expected non-null WebExtensionActionType.'); - final WebExtensionData? arg_extensionData = (args[3] as WebExtensionData?); - assert(arg_extensionData != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpsertWebExtensionAction was null, expected non-null WebExtensionData.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_extensionId = args[1]! as String; + final WebExtensionActionType arg_actionType = args[2]! as WebExtensionActionType; + final WebExtensionData arg_extensionData = args[3]! as WebExtensionData; try { - api.onUpsertWebExtensionAction(arg_sequence!, arg_extensionId!, arg_actionType!, arg_extensionData!); + api.onUpsertWebExtensionAction(arg_sequence, arg_extensionId, arg_actionType, arg_extensionData); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8904,20 +8222,12 @@ abstract class GeckoAddonEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onRemoveWebExtensionAction was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onRemoveWebExtensionAction was null, expected non-null int.'); - final String? arg_extensionId = (args[1] as String?); - assert(arg_extensionId != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onRemoveWebExtensionAction was null, expected non-null String.'); - final WebExtensionActionType? arg_actionType = (args[2] as WebExtensionActionType?); - assert(arg_actionType != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onRemoveWebExtensionAction was null, expected non-null WebExtensionActionType.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_extensionId = args[1]! as String; + final WebExtensionActionType arg_actionType = args[2]! as WebExtensionActionType; try { - api.onRemoveWebExtensionAction(arg_sequence!, arg_extensionId!, arg_actionType!); + api.onRemoveWebExtensionAction(arg_sequence, arg_extensionId, arg_actionType); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8935,23 +8245,13 @@ abstract class GeckoAddonEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpdateWebExtensionIcon was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpdateWebExtensionIcon was null, expected non-null int.'); - final String? arg_extensionId = (args[1] as String?); - assert(arg_extensionId != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpdateWebExtensionIcon was null, expected non-null String.'); - final WebExtensionActionType? arg_actionType = (args[2] as WebExtensionActionType?); - assert(arg_actionType != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpdateWebExtensionIcon was null, expected non-null WebExtensionActionType.'); - final Uint8List? arg_icon = (args[3] as Uint8List?); - assert(arg_icon != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoAddonEvents.onUpdateWebExtensionIcon was null, expected non-null Uint8List.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_extensionId = args[1]! as String; + final WebExtensionActionType arg_actionType = args[2]! as WebExtensionActionType; + final Uint8List arg_icon = args[3]! as Uint8List; try { - api.onUpdateWebExtensionIcon(arg_sequence!, arg_extensionId!, arg_actionType!, arg_icon!); + api.onUpdateWebExtensionIcon(arg_sequence, arg_extensionId, arg_actionType, arg_icon); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -8986,17 +8286,14 @@ class GeckoSuggestionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([query]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as AutocompleteResult?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as AutocompleteResult?; } Future querySuggestions(String text, List providers) async { @@ -9008,17 +8305,13 @@ class GeckoSuggestionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([text, providers]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -9037,20 +8330,12 @@ abstract class GeckoSuggestionEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSuggestionEvents.onSuggestionResult was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSuggestionEvents.onSuggestionResult was null, expected non-null int.'); - final GeckoSuggestionType? arg_suggestionType = (args[1] as GeckoSuggestionType?); - assert(arg_suggestionType != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSuggestionEvents.onSuggestionResult was null, expected non-null GeckoSuggestionType.'); - final List? arg_suggestions = (args[2] as List?)?.cast(); - assert(arg_suggestions != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoSuggestionEvents.onSuggestionResult was null, expected non-null List.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final GeckoSuggestionType arg_suggestionType = args[1]! as GeckoSuggestionType; + final List arg_suggestions = (args[2]! as List).cast(); try { - api.onSuggestionResult(arg_sequence!, arg_suggestionType!, arg_suggestions!); + api.onSuggestionResult(arg_sequence, arg_suggestionType, arg_suggestions); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -9078,17 +8363,11 @@ abstract class GeckoTabContentEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoTabContentEvents.onContentUpdate was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoTabContentEvents.onContentUpdate was null, expected non-null int.'); - final TabContent? arg_content = (args[1] as TabContent?); - assert(arg_content != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoTabContentEvents.onContentUpdate was null, expected non-null TabContent.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final TabContent arg_content = args[1]! as TabContent; try { - api.onContentUpdate(arg_sequence!, arg_content!); + api.onContentUpdate(arg_sequence, arg_content); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -9123,17 +8402,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteBrowsingHistory() async { @@ -9145,17 +8420,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteCookiesAndSiteData() async { @@ -9167,17 +8438,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteCachedFiles() async { @@ -9189,17 +8456,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteSitePermissions() async { @@ -9211,17 +8474,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteDownloads() async { @@ -9233,17 +8492,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future clearDataForSessionContext(String contextId) async { @@ -9255,17 +8510,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([contextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Clear browsing data for a specific host/domain @@ -9278,17 +8529,13 @@ class GeckoDeleteBrowsingDataController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([host, dataTypes]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -9314,22 +8561,14 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([startMillis, endMillis, excludeTypes]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future> getVisitsPaginated(int offset, int count, List excludeTypes) async { @@ -9341,22 +8580,14 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([offset, count, excludeTypes]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future deleteVisit(String url, int timestamp) async { @@ -9368,17 +8599,13 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url, timestamp]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteDownload(String id) async { @@ -9390,17 +8617,13 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([id]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future deleteVisitsBetween(int startMillis, int endMillis) async { @@ -9412,17 +8635,13 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([startMillis, endMillis]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future> getHistoryHighlights(HistoryHighlightWeights weights, int limit) async { @@ -9434,22 +8653,14 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([weights, limit]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } Future> getTopFrecentSites(int limit, FrecencyThresholdOption frecencyThreshold) async { @@ -9461,22 +8672,14 @@ class GeckoHistoryApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([limit, frecencyThreshold]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } } @@ -9502,17 +8705,13 @@ class GeckoDownloadsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, state]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future copyInternetResource(String tabId, ShareInternetResourceState state) async { @@ -9524,17 +8723,13 @@ class GeckoDownloadsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, state]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } Future shareInternetResource(String tabId, ShareInternetResourceState state) async { @@ -9546,17 +8741,13 @@ class GeckoDownloadsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, state]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -9575,17 +8766,11 @@ abstract class BrowserExtensionEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.BrowserExtensionEvents.onFeedRequested was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.BrowserExtensionEvents.onFeedRequested was null, expected non-null int.'); - final String? arg_url = (args[1] as String?); - assert(arg_url != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.BrowserExtensionEvents.onFeedRequested was null, expected non-null String.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final String arg_url = args[1]! as String; try { - api.onFeedRequested(arg_sequence!, arg_url!); + api.onFeedRequested(arg_sequence, arg_url); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -9620,22 +8805,14 @@ class GeckoFetchApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([request]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as GeckoFetchResponse?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as GeckoFetchResponse; } } @@ -9679,17 +8856,13 @@ class GeckoViewportApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([heightPx]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Sets the vertical clipping offset for the GeckoView content. @@ -9710,17 +8883,13 @@ class GeckoViewportApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([clippingPx]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -9760,23 +8929,13 @@ abstract class GeckoViewportEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onKeyboardVisibilityChanged was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onKeyboardVisibilityChanged was null, expected non-null int.'); - final int? arg_heightPx = (args[1] as int?); - assert(arg_heightPx != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onKeyboardVisibilityChanged was null, expected non-null int.'); - final bool? arg_isVisible = (args[2] as bool?); - assert(arg_isVisible != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onKeyboardVisibilityChanged was null, expected non-null bool.'); - final bool? arg_isAnimating = (args[3] as bool?); - assert(arg_isAnimating != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onKeyboardVisibilityChanged was null, expected non-null bool.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final int arg_heightPx = args[1]! as int; + final bool arg_isVisible = args[2]! as bool; + final bool arg_isAnimating = args[3]! as bool; try { - api.onKeyboardVisibilityChanged(arg_sequence!, arg_heightPx!, arg_isVisible!, arg_isAnimating!); + api.onKeyboardVisibilityChanged(arg_sequence, arg_heightPx, arg_isVisible, arg_isAnimating); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -9794,17 +8953,11 @@ abstract class GeckoViewportEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onBrowserHandlingScrollChanged was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onBrowserHandlingScrollChanged was null, expected non-null int.'); - final bool? arg_isHandling = (args[1] as bool?); - assert(arg_isHandling != null, - 'Argument for dev.flutter.pigeon.flutter_mozilla_components.GeckoViewportEvents.onBrowserHandlingScrollChanged was null, expected non-null bool.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final bool arg_isHandling = args[1]! as bool; try { - api.onBrowserHandlingScrollChanged(arg_sequence!, arg_isHandling!); + api.onBrowserHandlingScrollChanged(arg_sequence, arg_isHandling); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -9844,17 +8997,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([guid, recursive]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as BookmarkNode?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as BookmarkNode?; } /// Obtains the details of a bookmark without children, if one exists with that guid. Otherwise, null. @@ -9870,17 +9020,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([guid]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as BookmarkNode?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as BookmarkNode?; } /// Produces a list of all bookmarks with the given URL. @@ -9896,22 +9043,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } /// Produces a list of the most recently added bookmarks. @@ -9929,22 +9068,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([limit, maxAge, currentTime]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } /// Searches bookmarks with a query string. @@ -9961,22 +9092,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([query, limit]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } /// Adds a new bookmark item to a given node. @@ -9997,22 +9120,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([parentGuid, url, title, position]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } /// Adds a new bookmark folder to a given node. @@ -10032,22 +9147,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([parentGuid, title, position]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } /// Edits the properties of an existing bookmark item and/or moves an existing one underneath a new parent guid. @@ -10065,17 +9172,13 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([guid, info]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Deletes a bookmark node and all of its children, if any. @@ -10092,22 +9195,14 @@ class GeckoBookmarksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([guid]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -10135,17 +9230,14 @@ class GeckoSitePermissionsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([origin, private]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return (pigeonVar_replyList[0] as SitePermissions?); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; + return pigeonVar_replyValue as SitePermissions?; } /// Save/update permissions (persisted by GeckoView) @@ -10158,17 +9250,13 @@ class GeckoSitePermissionsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([permissions, private]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Delete permissions for origin (removed from GeckoView storage) @@ -10181,17 +9269,13 @@ class GeckoSitePermissionsApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([origin, private]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -10220,22 +9304,14 @@ class GeckoPublicSuffixListApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([host]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as String?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as String; } } @@ -10270,22 +9346,14 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } /// Add tracking protection exception for a tab (disable ETP for this site) @@ -10301,17 +9369,13 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Remove tracking protection exception for a tab (enable ETP for this site) @@ -10327,17 +9391,13 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Remove a specific exception by URL @@ -10353,17 +9413,13 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Fetch all tracking protection exceptions @@ -10378,22 +9434,14 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } /// Remove all tracking protection exceptions @@ -10408,17 +9456,13 @@ class GeckoTrackingProtectionApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -10454,22 +9498,14 @@ class GeckoAppLinksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } /// Opens the URL in an external application if available. @@ -10489,22 +9525,14 @@ class GeckoAppLinksApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([url]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -10544,22 +9572,14 @@ class GeckoPwaApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, profileUuid, contextId]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } /// Returns a list of all installed PWA manifests. @@ -10572,22 +9592,14 @@ class GeckoPwaApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as List?)!.cast(); - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return (pigeonVar_replyValue! as List).cast(); } /// Creates a basic bookmark shortcut on the home screen (no manifest required). @@ -10610,21 +9622,13 @@ class GeckoPwaApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([tabId, profileUuid, contextId, overrideShortcutName]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } diff --git a/packages/flutter_mozilla_components/pigeons/gecko.dart b/packages/flutter_mozilla_components/pigeons/gecko.dart index e9240991..96b40f2e 100644 --- a/packages/flutter_mozilla_components/pigeons/gecko.dart +++ b/packages/flutter_mozilla_components/pigeons/gecko.dart @@ -1504,8 +1504,6 @@ class GeckoPref { @HostApi() abstract class GeckoPrefApi { - @async - List getPrefList(); @async Map getPrefs(List preferenceFilter); @async diff --git a/packages/flutter_tor/android/src/main/kotlin/eu/weblibre/flutter_tor/generated/TorApi.g.kt b/packages/flutter_tor/android/src/main/kotlin/eu/weblibre/flutter_tor/generated/TorApi.g.kt index 9963fe4d..a7eb25bb 100644 --- a/packages/flutter_tor/android/src/main/kotlin/eu/weblibre/flutter_tor/generated/TorApi.g.kt +++ b/packages/flutter_tor/android/src/main/kotlin/eu/weblibre/flutter_tor/generated/TorApi.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -37,36 +37,150 @@ private object TorApiPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -145,15 +259,25 @@ data class TorConfiguration ( ) } override fun equals(other: Any?): Boolean { - if (other !is TorConfiguration) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return TorApiPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TorConfiguration + return TorApiPigeonUtils.deepEquals(this.transport, other.transport) && TorApiPigeonUtils.deepEquals(this.bridgeLines, other.bridgeLines) && TorApiPigeonUtils.deepEquals(this.entryNodeCountries, other.entryNodeCountries) && TorApiPigeonUtils.deepEquals(this.exitNodeCountries, other.exitNodeCountries) && TorApiPigeonUtils.deepEquals(this.strictNodes, other.strictNodes) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + TorApiPigeonUtils.deepHash(this.transport) + result = 31 * result + TorApiPigeonUtils.deepHash(this.bridgeLines) + result = 31 * result + TorApiPigeonUtils.deepHash(this.entryNodeCountries) + result = 31 * result + TorApiPigeonUtils.deepHash(this.exitNodeCountries) + result = 31 * result + TorApiPigeonUtils.deepHash(this.strictNodes) + return result + } } /** @@ -194,15 +318,25 @@ data class TorStatus ( ) } override fun equals(other: Any?): Boolean { - if (other !is TorStatus) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return TorApiPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TorStatus + return TorApiPigeonUtils.deepEquals(this.isRunning, other.isRunning) && TorApiPigeonUtils.deepEquals(this.socksPort, other.socksPort) && TorApiPigeonUtils.deepEquals(this.bootstrapProgress, other.bootstrapProgress) && TorApiPigeonUtils.deepEquals(this.currentCircuit, other.currentCircuit) && TorApiPigeonUtils.deepEquals(this.exitNodeCountry, other.exitNodeCountry) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + TorApiPigeonUtils.deepHash(this.isRunning) + result = 31 * result + TorApiPigeonUtils.deepHash(this.socksPort) + result = 31 * result + TorApiPigeonUtils.deepHash(this.bootstrapProgress) + result = 31 * result + TorApiPigeonUtils.deepHash(this.currentCircuit) + result = 31 * result + TorApiPigeonUtils.deepHash(this.exitNodeCountry) + return result + } } /** @@ -235,15 +369,23 @@ data class TorLogMessage ( ) } override fun equals(other: Any?): Boolean { - if (other !is TorLogMessage) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return TorApiPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as TorLogMessage + return TorApiPigeonUtils.deepEquals(this.severity, other.severity) && TorApiPigeonUtils.deepEquals(this.message, other.message) && TorApiPigeonUtils.deepEquals(this.timestamp, other.timestamp) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + TorApiPigeonUtils.deepHash(this.severity) + result = 31 * result + TorApiPigeonUtils.deepHash(this.message) + result = 31 * result + TorApiPigeonUtils.deepHash(this.timestamp) + return result + } } private open class TorApiPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/flutter_tor/lib/src/tor_api.g.dart b/packages/flutter_tor/lib/src/tor_api.g.dart index a4a00beb..5192d6a0 100644 --- a/packages/flutter_tor/lib/src/tor_api.g.dart +++ b/packages/flutter_tor/lib/src/tor_api.g.dart @@ -1,20 +1,40 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } + List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; @@ -25,19 +45,67 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + /// Transport types for Tor connections enum TransportType { @@ -101,7 +169,7 @@ class TorConfiguration { result as List; return TorConfiguration( transport: result[0]! as TransportType, - bridgeLines: (result[1] as List?)!.cast(), + bridgeLines: (result[1]! as List).cast(), entryNodeCountries: result[2] as String?, exitNodeCountries: result[3] as String?, strictNodes: result[4] as bool?, @@ -117,13 +185,12 @@ class TorConfiguration { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(transport, other.transport) && _deepEquals(bridgeLines, other.bridgeLines) && _deepEquals(entryNodeCountries, other.entryNodeCountries) && _deepEquals(exitNodeCountries, other.exitNodeCountries) && _deepEquals(strictNodes, other.strictNodes); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Current Tor status @@ -184,13 +251,12 @@ class TorStatus { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(isRunning, other.isRunning) && _deepEquals(socksPort, other.socksPort) && _deepEquals(bootstrapProgress, other.bootstrapProgress) && _deepEquals(currentCircuit, other.currentCircuit) && _deepEquals(exitNodeCountry, other.exitNodeCountry); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } /// Log message from Tor @@ -239,13 +305,12 @@ class TorLogMessage { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(severity, other.severity) && _deepEquals(message, other.message) && _deepEquals(timestamp, other.timestamp); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -276,14 +341,14 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final value = readValue(buffer) as int?; return value == null ? null : TransportType.values[value]; - case 130: + case 130: return TorConfiguration.decode(readValue(buffer)!); - case 131: + case 131: return TorStatus.decode(readValue(buffer)!); - case 132: + case 132: return TorLogMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -316,22 +381,14 @@ class TorApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([config]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as int?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as int; } /// Stop Tor @@ -344,17 +401,13 @@ class TorApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } /// Get current status @@ -367,22 +420,14 @@ class TorApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as TorStatus?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as TorStatus; } /// Request a new Tor identity (new circuit) @@ -395,17 +440,13 @@ class TorApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send(null); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } @@ -429,14 +470,10 @@ abstract class TorLogApi { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage was null.'); - final List args = (message as List?)!; - final TorLogMessage? arg_log = (args[0] as TorLogMessage?); - assert(arg_log != null, - 'Argument for dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage was null, expected non-null TorLogMessage.'); + final List args = message! as List; + final TorLogMessage arg_log = args[0]! as TorLogMessage; try { - api.onLogMessage(arg_log!); + api.onLogMessage(arg_log); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -454,14 +491,10 @@ abstract class TorLogApi { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged was null.'); - final List args = (message as List?)!; - final TorStatus? arg_status = (args[0] as TorStatus?); - assert(arg_status != null, - 'Argument for dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged was null, expected non-null TorStatus.'); + final List args = message! as List; + final TorStatus arg_status = args[0]! as TorStatus; try { - api.onStatusChanged(arg_status!); + api.onStatusChanged(arg_status); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -496,22 +529,14 @@ class IPtProxyController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([proxyType, proxy]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as int?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as int; } Future stop(TransportType proxyType) async { @@ -523,16 +548,12 @@ class IPtProxyController { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([proxyType]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else { - return; - } + + _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: true, + ) + ; } } diff --git a/packages/locale_resolver/android/src/main/kotlin/eu/weblibre/locale_resolver/pigeons/Locales.g.kt b/packages/locale_resolver/android/src/main/kotlin/eu/weblibre/locale_resolver/pigeons/Locales.g.kt index ac0bdcf2..1f3744fd 100644 --- a/packages/locale_resolver/android/src/main/kotlin/eu/weblibre/locale_resolver/pigeons/Locales.g.kt +++ b/packages/locale_resolver/android/src/main/kotlin/eu/weblibre/locale_resolver/pigeons/Locales.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -34,36 +34,150 @@ private object LocalesPigeonUtils { ) } } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -98,15 +212,22 @@ data class LocalizedResult ( ) } override fun equals(other: Any?): Boolean { - if (other !is LocalizedResult) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return LocalesPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as LocalizedResult + return LocalesPigeonUtils.deepEquals(this.languageName, other.languageName) && LocalesPigeonUtils.deepEquals(this.countryName, other.countryName) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + LocalesPigeonUtils.deepHash(this.languageName) + result = 31 * result + LocalesPigeonUtils.deepHash(this.countryName) + return result + } } private open class LocalesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/locale_resolver/lib/src/pigeons/locales.g.dart b/packages/locale_resolver/lib/src/pigeons/locales.g.dart index ab677b69..32028b6d 100644 --- a/packages/locale_resolver/lib/src/pigeons/locales.g.dart +++ b/packages/locale_resolver/lib/src/pigeons/locales.g.dart @@ -1,33 +1,101 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } + bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class LocalizedResult { LocalizedResult({ @@ -66,13 +134,12 @@ class LocalizedResult { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(languageName, other.languageName) && _deepEquals(countryName, other.countryName); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -94,7 +161,7 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return LocalizedResult.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -124,21 +191,13 @@ class LocaleResolver { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([languageTag, targetLangouageTag]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as LocalizedResult?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as LocalizedResult; } } diff --git a/packages/simple_intent_receiver/android/src/main/kotlin/eu/weblibre/simple_intent_receiver/pigeons/Intent.g.kt b/packages/simple_intent_receiver/android/src/main/kotlin/eu/weblibre/simple_intent_receiver/pigeons/Intent.g.kt index 6a83786f..e3324e65 100644 --- a/packages/simple_intent_receiver/android/src/main/kotlin/eu/weblibre/simple_intent_receiver/pigeons/Intent.g.kt +++ b/packages/simple_intent_receiver/android/src/main/kotlin/eu/weblibre/simple_intent_receiver/pigeons/Intent.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") @@ -17,36 +17,150 @@ private object IntentPigeonUtils { fun createConnectionError(channelName: String): FlutterError { return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "") } + fun doubleEquals(a: Double, b: Double): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN()) + } + + fun floatEquals(a: Float, b: Float): Boolean { + // Normalize -0.0 to 0.0 and handle NaN equality. + return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN()) + } + + fun doubleHash(d: Double): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (d == 0.0) 0.0 else d + val bits = java.lang.Double.doubleToLongBits(normalized) + return (bits xor (bits ushr 32)).toInt() + } + + fun floatHash(f: Float): Int { + // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes. + val normalized = if (f == 0.0f) 0.0f else f + return java.lang.Float.floatToIntBits(normalized) + } + fun deepEquals(a: Any?, b: Any?): Boolean { + if (a === b) { + return true + } + if (a == null || b == null) { + return false + } if (a is ByteArray && b is ByteArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is IntArray && b is IntArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is LongArray && b is LongArray) { - return a.contentEquals(b) + return a.contentEquals(b) } if (a is DoubleArray && b is DoubleArray) { - return a.contentEquals(b) + if (a.size != b.size) return false + for (i in a.indices) { + if (!doubleEquals(a[i], b[i])) return false + } + return true + } + if (a is FloatArray && b is FloatArray) { + if (a.size != b.size) return false + for (i in a.indices) { + if (!floatEquals(a[i], b[i])) return false + } + return true } if (a is Array<*> && b is Array<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + for (i in a.indices) { + if (!deepEquals(a[i], b[i])) return false + } + return true } if (a is List<*> && b is List<*>) { - return a.size == b.size && - a.indices.all{ deepEquals(a[it], b[it]) } + if (a.size != b.size) return false + val iterA = a.iterator() + val iterB = b.iterator() + while (iterA.hasNext() && iterB.hasNext()) { + if (!deepEquals(iterA.next(), iterB.next())) return false + } + return true } if (a is Map<*, *> && b is Map<*, *>) { - return a.size == b.size && a.all { - (b as Map).contains(it.key) && - deepEquals(it.value, b[it.key]) + if (a.size != b.size) return false + for (entry in a) { + val key = entry.key + var found = false + for (bEntry in b) { + if (deepEquals(key, bEntry.key)) { + if (deepEquals(entry.value, bEntry.value)) { + found = true + break + } else { + return false + } + } + } + if (!found) return false } + return true + } + if (a is Double && b is Double) { + return doubleEquals(a, b) + } + if (a is Float && b is Float) { + return floatEquals(a, b) } return a == b } - + + fun deepHash(value: Any?): Int { + return when (value) { + null -> 0 + is ByteArray -> value.contentHashCode() + is IntArray -> value.contentHashCode() + is LongArray -> value.contentHashCode() + is DoubleArray -> { + var result = 1 + for (item in value) { + result = 31 * result + doubleHash(item) + } + result + } + is FloatArray -> { + var result = 1 + for (item in value) { + result = 31 * result + floatHash(item) + } + result + } + is Array<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is List<*> -> { + var result = 1 + for (item in value) { + result = 31 * result + deepHash(item) + } + result + } + is Map<*, *> -> { + var result = 0 + for (entry in value) { + result += ((deepHash(entry.key) * 31) xor deepHash(entry.value)) + } + result + } + is Double -> doubleHash(value) + is Float -> floatHash(value) + else -> value.hashCode() + } + } + } /** @@ -93,15 +207,26 @@ data class Intent ( ) } override fun equals(other: Any?): Boolean { - if (other !is Intent) { + if (other == null || other.javaClass != javaClass) { return false } if (this === other) { return true } - return IntentPigeonUtils.deepEquals(toList(), other.toList()) } + val other = other as Intent + return IntentPigeonUtils.deepEquals(this.fromPackageName, other.fromPackageName) && IntentPigeonUtils.deepEquals(this.action, other.action) && IntentPigeonUtils.deepEquals(this.data, other.data) && IntentPigeonUtils.deepEquals(this.categories, other.categories) && IntentPigeonUtils.deepEquals(this.mimeType, other.mimeType) && IntentPigeonUtils.deepEquals(this.extra, other.extra) + } - override fun hashCode(): Int = toList().hashCode() + override fun hashCode(): Int { + var result = javaClass.hashCode() + result = 31 * result + IntentPigeonUtils.deepHash(this.fromPackageName) + result = 31 * result + IntentPigeonUtils.deepHash(this.action) + result = 31 * result + IntentPigeonUtils.deepHash(this.data) + result = 31 * result + IntentPigeonUtils.deepHash(this.categories) + result = 31 * result + IntentPigeonUtils.deepHash(this.mimeType) + result = 31 * result + IntentPigeonUtils.deepHash(this.extra) + return result + } } private open class IntentPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { diff --git a/packages/simple_intent_receiver/lib/src/pigeons/intent.g.dart b/packages/simple_intent_receiver/lib/src/pigeons/intent.g.dart index 070b0674..5df0e2cc 100644 --- a/packages/simple_intent_receiver/lib/src/pigeons/intent.g.dart +++ b/packages/simple_intent_receiver/lib/src/pigeons/intent.g.dart @@ -1,12 +1,13 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { @@ -18,19 +19,67 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } bool _deepEquals(Object? a, Object? b) { + if (identical(a, b)) { + return true; + } + if (a is double && b is double) { + if (a.isNaN && b.isNaN) { + return true; + } + return a == b; + } if (a is List && b is List) { return a.length == b.length && a.indexed - .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); + .every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1])); } if (a is Map && b is Map) { - return a.length == b.length && a.entries.every((MapEntry entry) => - (b as Map).containsKey(entry.key) && - _deepEquals(entry.value, b[entry.key])); + if (a.length != b.length) { + return false; + } + for (final MapEntry entryA in a.entries) { + bool found = false; + for (final MapEntry entryB in b.entries) { + if (_deepEquals(entryA.key, entryB.key)) { + if (_deepEquals(entryA.value, entryB.value)) { + found = true; + break; + } else { + return false; + } + } + } + if (!found) { + return false; + } + } + return true; } return a == b; } +int _deepHash(Object? value) { + if (value is List) { + return Object.hashAll(value.map(_deepHash)); + } + if (value is Map) { + int result = 0; + for (final MapEntry entry in value.entries) { + result += (_deepHash(entry.key) * 31) ^ _deepHash(entry.value); + } + return result; + } + if (value is double && value.isNaN) { + // Normalize NaN to a consistent hash. + return 0x7FF8000000000000.hashCode; + } + if (value is double && value == 0.0) { + // Normalize -0.0 to 0.0 so they have the same hash code. + return 0.0.hashCode; + } + return value.hashCode; +} + class Intent { Intent({ @@ -74,9 +123,9 @@ class Intent { fromPackageName: result[0] as String?, action: result[1] as String?, data: result[2] as String?, - categories: (result[3] as List?)!.cast(), + categories: (result[3]! as List).cast(), mimeType: result[4] as String?, - extra: (result[5] as Map?)!.cast(), + extra: (result[5]! as Map).cast(), ); } @@ -89,13 +138,12 @@ class Intent { if (identical(this, other)) { return true; } - return _deepEquals(encode(), other.encode()); + return _deepEquals(fromPackageName, other.fromPackageName) && _deepEquals(action, other.action) && _deepEquals(data, other.data) && _deepEquals(categories, other.categories) && _deepEquals(mimeType, other.mimeType) && _deepEquals(extra, other.extra); } @override // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hashAll(_toList()) -; + int get hashCode => _deepHash([runtimeType, ..._toList()]); } @@ -117,7 +165,7 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return Intent.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -140,17 +188,11 @@ abstract class IntentEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived was null.'); - final List args = (message as List?)!; - final int? arg_sequence = (args[0] as int?); - assert(arg_sequence != null, - 'Argument for dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived was null, expected non-null int.'); - final Intent? arg_intent = (args[1] as Intent?); - assert(arg_intent != null, - 'Argument for dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived was null, expected non-null Intent.'); + final List args = message! as List; + final int arg_sequence = args[0]! as int; + final Intent arg_intent = args[1]! as Intent; try { - api.onIntentReceived(arg_sequence!, arg_intent!); + api.onIntentReceived(arg_sequence, arg_intent); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/speech_to_text_dialog/android/src/main/kotlin/eu/weblibre/speech_to_text_dialog/pigeons/SpeechToText.g.kt b/packages/speech_to_text_dialog/android/src/main/kotlin/eu/weblibre/speech_to_text_dialog/pigeons/SpeechToText.g.kt index 5d487ff9..13a11241 100644 --- a/packages/speech_to_text_dialog/android/src/main/kotlin/eu/weblibre/speech_to_text_dialog/pigeons/SpeechToText.g.kt +++ b/packages/speech_to_text_dialog/android/src/main/kotlin/eu/weblibre/speech_to_text_dialog/pigeons/SpeechToText.g.kt @@ -1,4 +1,4 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") diff --git a/packages/speech_to_text_dialog/lib/src/pigeons/speech_to_text.g.dart b/packages/speech_to_text_dialog/lib/src/pigeons/speech_to_text.g.dart index 1665f8e2..afe8a3e3 100644 --- a/packages/speech_to_text_dialog/lib/src/pigeons/speech_to_text.g.dart +++ b/packages/speech_to_text_dialog/lib/src/pigeons/speech_to_text.g.dart @@ -1,20 +1,40 @@ -// Autogenerated from Pigeon (v26.1.7), do not edit directly. +// Autogenerated from Pigeon (v26.3.2), do not edit directly. // See also: https://pub.dev/packages/pigeon -// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, omit_obvious_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers +// ignore_for_file: unused_import, unused_shown_name +// ignore_for_file: type=lint import 'dart:async'; -import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; +import 'dart:typed_data' show Float64List, Int32List, Int64List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; +import 'package:meta/meta.dart' show immutable, protected, visibleForTesting; -PlatformException _createConnectionError(String channelName) { - return PlatformException( - code: 'channel-error', - message: 'Unable to establish connection on channel: "$channelName".', - ); +Object? _extractReplyValueOrThrow( + List? replyList, + String channelName, { + required bool isNullValid, +}) { + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel: "$channelName".', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } + return replyList.firstOrNull; } + List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; @@ -77,22 +97,14 @@ class SpeechToTextApi { ); final Future pigeonVar_sendFuture = pigeonVar_channel.send([locale]); final pigeonVar_replyList = await pigeonVar_sendFuture as List?; - if (pigeonVar_replyList == null) { - throw _createConnectionError(pigeonVar_channelName); - } else if (pigeonVar_replyList.length > 1) { - throw PlatformException( - code: pigeonVar_replyList[0]! as String, - message: pigeonVar_replyList[1] as String?, - details: pigeonVar_replyList[2], - ); - } else if (pigeonVar_replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); - } else { - return (pigeonVar_replyList[0] as bool?)!; - } + + final Object? pigeonVar_replyValue = _extractReplyValueOrThrow( + pigeonVar_replyList, + pigeonVar_channelName, + isNullValid: false, + ) + ; + return pigeonVar_replyValue! as bool; } } @@ -116,14 +128,10 @@ abstract class SpeechToTextEvents { pigeonVar_channel.setMessageHandler(null); } else { pigeonVar_channel.setMessageHandler((Object? message) async { - assert(message != null, - 'Argument for dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived was null.'); - final List args = (message as List?)!; - final String? arg_text = (args[0] as String?); - assert(arg_text != null, - 'Argument for dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived was null, expected non-null String.'); + final List args = message! as List; + final String arg_text = args[0]! as String; try { - api.onTextReceived(arg_text!); + api.onTextReceived(arg_text); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e);