From nobody Sat Jan 21 18:35:16 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NzlR94H2Gz2stSb; Sat, 21 Jan 2023 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NzlR93xJRz4YXf; Sat, 21 Jan 2023 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674326117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCYUvXWJZ3BeOCLN2vFv2x6o5yvg9QKsIXNFlz/eIhI=; b=sbQYLmUkN+fTqoMO8vtyVlXv4Wr1bhPtJv8HRFsJHickGBygqXWN+vB+qZJ75yMSH+ZfrW C50fLaz9DoMy1tXZ3pf8m7eRRau0/T7kiXRUZPccMvJQcUTXH/3yCOC9JVSqO05thYWkfE k/L3r17JSKmmTsGcRe+ir+V3jdAZ+VAFSyaNGKF+hpJotjteIzs8k79aHS0cxaD7bBq6CC /KSZ/F91MvHErsPUYnkCkUw3KDt0YlIMoGIvE6LIKZaMRacnzKiw6q7f11NCoF56kVE5gF 9M+QnZ4yciBcEM0KyvvKber7fH/U7yDnFZepZj/HZQdNM4pkiHGWTVzkXGNSdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674326117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eCYUvXWJZ3BeOCLN2vFv2x6o5yvg9QKsIXNFlz/eIhI=; b=sZIwBpXNWJT6/9RFeEF2S34GH8JW+rhffIxlFfGxF64lNzF5I7Z6Cw77k50XH5NjLwC3WN oFfJ2BbYUvyYpokVRHdQeVSB6X9pGjgpeopsQQ+vGxete2bDRmGZbvuf1OwnUTJ09oeaDK PBKpSuEh0qknVigLMkVbytUwlGaRtNkXzamHSh6M02ZGATXPJL4eLEWf6iGks3PmWoz8bh PVfnppZYQ6RI2P11eLZ8d9jVsulDKP+HIyGhmaTZ9GOmyTE/pJtgGCygGRO5HRTdzuzCij Be0iUIV+aQNlga3MgG+tzPQ1dJXbuotUsvVTDqS3OQHN5HDlVHa4DY5ehZwuIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674326117; a=rsa-sha256; cv=none; b=D01Swqcdu47n2dNNB10pCEBVyPQmKKj6BB73g8YvBkF/x/R/o/J5LFfKXRKnMB1fKwk+fM TWf2Ej3fHEIWUkJmG7Z2ICQxV599alS1MKEs5NanhUuTUJV1RejkdijqEOuB1he8Fw1mMx uEEewyZgWRg1Q/BdgT6yeSWtoJpZ+4Hu3p2bpgzqsl2C8gLTiTaCK8sxIYTgFInITGR2L4 IQN/6oZG+zmjOpIZzFTsvDAon4xIkoVF3EzadmKx2p3yXyu7RAZuC9Ggg9kTKdFr9krtJ4 IwTHg94D2VmKMPx8A9kEq9+AHeo86kW1vU2X6Vh9GuJSp/6QYTqEKs1G/kY64Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NzlR92zwQzKrZ; Sat, 21 Jan 2023 18:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30LIZHEI095969; Sat, 21 Jan 2023 18:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30LIZGqT095965; Sat, 21 Jan 2023 18:35:16 GMT (envelope-from git) Date: Sat, 21 Jan 2023 18:35:16 GMT Message-Id: <202301211835.30LIZGqT095965@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jesper Schmitz Mouridsen Subject: git: 4e77dee79c17 - main - www/librewolf: New port List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jsm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e77dee79c17245e0c3b4b98af5a718ed2c5eb81 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jsm: URL: https://cgit.FreeBSD.org/ports/commit/?id=4e77dee79c17245e0c3b4b98af5a718ed2c5eb81 commit 4e77dee79c17245e0c3b4b98af5a718ed2c5eb81 Author: Martin Filla AuthorDate: 2023-01-19 18:52:57 +0000 Commit: Jesper Schmitz Mouridsen CommitDate: 2023-01-21 18:34:48 +0000 www/librewolf: New port PR: 258503 --- www/Makefile | 1 + www/librewolf/Makefile | 99 + www/librewolf/distinfo | 5 + www/librewolf/files/RustTabs.jsm | 1181 + www/librewolf/files/UniFFIGeneratedScaffolding.cpp | 283 + www/librewolf/files/patch-addon-search | 53 + .../files/patch-browser-app-nsBrowserApp.cpp | 14 + www/librewolf/files/patch-bug1269654_comment5 | 43 + www/librewolf/files/patch-bug1504834_comment10 | 36 + www/librewolf/files/patch-bug1504834_comment5 | 85 + www/librewolf/files/patch-bug1504834_comment9 | 49 + www/librewolf/files/patch-bug1559213 | 123 + www/librewolf/files/patch-bug1612181_comment1 | 191 + www/librewolf/files/patch-bug1626236 | 92 + www/librewolf/files/patch-bug1628567 | 32 + www/librewolf/files/patch-bug1640982 | 17 + www/librewolf/files/patch-bug1659612 | 35 + www/librewolf/files/patch-bug1680982 | 388 + www/librewolf/files/patch-bug1716707 | 56 + www/librewolf/files/patch-bug847568 | 292 + .../files/patch-dom_media_flac_FlacDecoder.cpp | 23 + www/librewolf/files/patch-env-api-keys | 21 + .../files/patch-gfx_skia_skia_src_core_SkCpu.cpp | 32 + www/librewolf/files/patch-i386-protobuf-alignment | 15 + www/librewolf/files/patch-libwebrtc-generated | 89350 +++++++++++++++++++ www/librewolf/files/patch-libwebrtc-powerpc64 | 264 + .../files/patch-memory_mozalloc_throw__gcc.h | 69 + www/librewolf/files/patch-pipewire_init | 120 + ...patch-python_mozbuild_mozbuild_gn__processor.py | 39 + ...rd__party_libwebrtc_build_config_BUILDCONFIG.gn | 37 + ...third__party_libwebrtc_rtc__base_ip__address.cc | 23 + ..._party_libwebrtc_third__party_pffft_src_pffft.c | 10 + .../files/patch-third__party_sqlite3_src_moz.build | 12 + .../files/patch-tools_profiler_core_patform.cpp | 51 + www/librewolf/pkg-descr | 13 + www/librewolf/pkg-message | 50 + 36 files changed, 93204 insertions(+) diff --git a/www/Makefile b/www/Makefile index 7b2d18979e1d..dd69efd4b9c4 100644 --- a/www/Makefile +++ b/www/Makefile @@ -297,6 +297,7 @@ SUBDIR += libnghttp3 SUBDIR += libresonic-standalone SUBDIR += librespeed + SUBDIR += librewolf SUBDIR += librtcdcpp SUBDIR += libwpe SUBDIR += libwww diff --git a/www/librewolf/Makefile b/www/librewolf/Makefile new file mode 100644 index 000000000000..7741caaa7d7d --- /dev/null +++ b/www/librewolf/Makefile @@ -0,0 +1,99 @@ +PORTNAME= librewolf +DISTVERSION= 108.0.1-1 +CATEGORIES= www wayland +MASTER_SITES= https://gitlab.com/api/v4/projects/32320088/packages/generic/librewolf-source/${DISTVERSION}/ +DISTNAME= ${PORTNAME}-${DISTVERSION}.source. +EXTRACT_SUFX= tar.gz + +PATCH_SITES= https://gitlab.com/librewolf-community/browser/source/-/raw/${DISTVERSION}/ +PATCHFILES= patches/unity-menubar.patch?inline=false:-p1 + +MAINTAINER= freebsd@sysctl.cz +COMMENT= Custom version of Firefox, focused on privacy, security and freedom +WWW= https://librewolf.net/ + +BUILD_DEPENDS= nspr>=4.32:devel/nspr \ + nss>=3.84:security/nss \ + icu>=71.1:devel/icu \ + libevent>=2.1.8:devel/libevent \ + harfbuzz>=4.4.1:print/harfbuzz \ + graphite2>=1.3.14:graphics/graphite2 \ + png>=1.6.37:graphics/png \ + dav1d>=1.0.0:multimedia/dav1d \ + libvpx>=1.12.0:multimedia/libvpx \ + ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ + v4l_compat>0:multimedia/v4l_compat \ + autoconf2.13:devel/autoconf2.13 \ + nasm:devel/nasm \ + yasm:devel/yasm \ + zip:archivers/zip + +.include "${.CURDIR}/../../www/firefox/Makefile.options" +.include +.if ${ARCH} != powerpc64 +BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \ + ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \ + ${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT} +.endif + +USES= tar:xz +USE_GECKO= gecko +USE_MOZILLA= -sqlite +CFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234 +# work around bindgen not finding ICU, e.g. +# dist/include/mozilla/intl/ICU4CGlue.h:8:10: fatal error: 'unicode/uenum.h' file not found, err: true +CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" +CONFIGURE_ENV+= MOZ_REQUIRE_SIGNING="" +MOZ_EXPORT+= MOZ_TELEMETRY_REPORTING="" \ + MOZILLA_OFFICIAL="1" \ + MOZ_OFFICIAL_BRANDING="1" \ + MOZ_APP_DISPLAYNAME="Librewolf" \ + MOZ_APP_NAME="librewolf" + +MOZ_OPTIONs= --enable-application=browser \ + --allow-addon-sideload \ + --disable-crashreporter \ + --disable-debug \ + --disable-default-browser-agent \ + --disable-tests \ + --disable-updater \ + --enable-hardening \ + --enable-optimize \ + --enable-release \ + --enable-rust-simd \ + --with-app-name=librewolf \ + --with-branding=browser/branding/librewolf \ + --with-unsigned-addon-scopes=app,system \ + --with-l10n-base=$PWD/browser/locales/l10n \ + --enable-bootstrap \ + MOZ_CRASHREPORTER=0 \ + MOZ_DATA_REPORTING=0 \ + MOZ_SERVICES_HEALTHREPORT=0 + +# helpful when testing beta +WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} + +FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png +FIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/firefox-snap/firefox.desktop + +.if ${ARCH} == powerpc64 +MOZ_OPTIONS+= --disable-webrtc --without-wasm-sandboxed-libraries +.else +BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \ + ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \ + ${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT} +MOZ_OPTIONS+= --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/browser/app/nsBrowserApp.cpp + @${RM} ${WRKSRC}/mozconfig + +post-install: + ${CP} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop + ${REINPLACE_CMD} -e 's|Firefox|Librewolf|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop + ${REINPLACE_CMD} -e 's|firefox|librewolf|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop + ${REINPLACE_CMD} -e 's|Icon=.*|Icon=${FIREFOX_ICON_SRC}|g' ${STAGEDIR}${PREFIX}/share/applications/librewolf.desktop + +.include diff --git a/www/librewolf/distinfo b/www/librewolf/distinfo new file mode 100644 index 000000000000..9ce5561a7db6 --- /dev/null +++ b/www/librewolf/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1671892824 +SHA256 (librewolf-108.0.1-1.source.tar.gz) = d1978f870ebddbcb71e92da9887e6de99818c4d8045642c46a5b3d2e2b970e81 +SIZE (librewolf-108.0.1-1.source.tar.gz) = 828438372 +SHA256 (patches/unity-menubar.patch?inline=false) = 84c03a4eb5dcc1bb9e2cfc343e0b98bbbc8dc791647747082d3f50ba638de965 +SIZE (patches/unity-menubar.patch?inline=false) = 163635 diff --git a/www/librewolf/files/RustTabs.jsm b/www/librewolf/files/RustTabs.jsm new file mode 100644 index 000000000000..95b1bd035b17 --- /dev/null +++ b/www/librewolf/files/RustTabs.jsm @@ -0,0 +1,1181 @@ +// This file was autogenerated by the `uniffi-bindgen-gecko-js` crate. +// Trust me, you don't want to mess with it! + + + +"use strict"; + +var EXPORTED_SYMBOLS = []; + +// Write/Read data to/from an ArrayBuffer +class ArrayBufferDataStream { + constructor(arrayBuffer) { + this.dataView = new DataView(arrayBuffer); + this.pos = 0; + } + + readUint8() { + let rv = this.dataView.getUint8(this.pos); + this.pos += 1; + return rv; + } + + writeUint8(value) { + this.dataView.setUint8(this.pos, value); + this.pos += 1; + } + + readUint16() { + let rv = this.dataView.getUint16(this.pos); + this.pos += 2; + return rv; + } + + writeUint16(value) { + this.dataView.setUint16(this.pos, value); + this.pos += 2; + } + + readUint32() { + let rv = this.dataView.getUint32(this.pos); + this.pos += 4; + return rv; + } + + writeUint32(value) { + this.dataView.setUint32(this.pos, value); + this.pos += 4; + } + + readUint64() { + let rv = this.dataView.getBigUint64(this.pos); + this.pos += 8; + return Number(rv); + } + + writeUint64(value) { + this.dataView.setBigUint64(this.pos, BigInt(value)); + this.pos += 8; + } + + + readInt8() { + let rv = this.dataView.getInt8(this.pos); + this.pos += 1; + return rv; + } + + writeInt8(value) { + this.dataView.setInt8(this.pos, value); + this.pos += 1; + } + + readInt16() { + let rv = this.dataView.getInt16(this.pos); + this.pos += 2; + return rv; + } + + writeInt16(value) { + this.dataView.setInt16(this.pos, value); + this.pos += 2; + } + + readInt32() { + let rv = this.dataView.getInt32(this.pos); + this.pos += 4; + return rv; + } + + writeInt32(value) { + this.dataView.setInt32(this.pos, value); + this.pos += 4; + } + + readInt64() { + let rv = this.dataView.getBigInt64(this.pos); + this.pos += 8; + return Number(rv); + } + + writeInt64(value) { + this.dataView.setBigInt64(this.pos, BigInt(value)); + this.pos += 8; + } + + + readFloat32() { + let rv = this.dataView.getFloat32(this.pos); + this.pos += 4; + return rv; + } + + writeFloat32(value) { + this.dataView.setFloat32(this.pos, value); + this.pos += 4; + } + + readFloat64() { + let rv = this.dataView.getFloat64(this.pos); + this.pos += 8; + return rv; + } + + writeFloat64(value) { + this.dataView.setFloat64(this.pos, value); + this.pos += 8; + } + + + writeString(value) { + const encoder = new TextEncoder(); + // Note: in order to efficiently write this data, we first write the + // string data, reserving 4 bytes for the size. + const dest = new Uint8Array(this.dataView.buffer, this.pos + 4); + const encodeResult = encoder.encodeInto(value, dest); + if (encodeResult.read != value.length) { + throw new UniFFIError( + "writeString: out of space when writing to ArrayBuffer. Did the computeSize() method returned the wrong result?" + ); + } + const size = encodeResult.written; + // Next, go back and write the size before the string data + this.dataView.setUint32(this.pos, size); + // Finally, advance our position past both the size and string data + this.pos += size + 4; + } + + readString() { + const decoder = new TextDecoder(); + const size = this.readUint32(); + const source = new Uint8Array(this.dataView.buffer, this.pos, size) + const value = decoder.decode(source); + this.pos += size; + return value; + } + + // Reads a TabsStore pointer from the data stream + // UniFFI Pointers are **always** 8 bytes long. That is enforced + // by the C++ and Rust Scaffolding code. + readPointerTabsStore() { + const pointerId = 0; // tabs:TabsStore + const res = UniFFIScaffolding.readPointer(pointerId, this.dataView.buffer, this.pos); + this.pos += 8; + return res; + } + + // Writes a TabsStore pointer into the data stream + // UniFFI Pointers are **always** 8 bytes long. That is enforced + // by the C++ and Rust Scaffolding code. + writePointerTabsStore(value) { + const pointerId = 0; // tabs:TabsStore + UniFFIScaffolding.writePointer(pointerId, value, this.dataView.buffer, this.pos); + this.pos += 8; + } + + + // Reads a TabsBridgedEngine pointer from the data stream + // UniFFI Pointers are **always** 8 bytes long. That is enforced + // by the C++ and Rust Scaffolding code. + readPointerTabsBridgedEngine() { + const pointerId = 1; // tabs:TabsBridgedEngine + const res = UniFFIScaffolding.readPointer(pointerId, this.dataView.buffer, this.pos); + this.pos += 8; + return res; + } + + // Writes a TabsBridgedEngine pointer into the data stream + // UniFFI Pointers are **always** 8 bytes long. That is enforced + // by the C++ and Rust Scaffolding code. + writePointerTabsBridgedEngine(value) { + const pointerId = 1; // tabs:TabsBridgedEngine + UniFFIScaffolding.writePointer(pointerId, value, this.dataView.buffer, this.pos); + this.pos += 8; + } + +} + +function handleRustResult(result, liftCallback, liftErrCallback) { + switch (result.code) { + case "success": + return liftCallback(result.data); + + case "error": + throw liftErrCallback(result.data); + + case "internal-error": + let message = result.internalErrorMessage; + if (message) { + throw new UniFFIInternalError(message); + } else { + throw new UniFFIInternalError("Unknown error"); + } + + default: + throw new UniFFIError(`Unexpected status code: ${result.code}`); + } +} + +class UniFFIError { + constructor(message) { + this.message = message; + } +} + +class UniFFIInternalError extends UniFFIError {} + +// Base class for FFI converters +class FfiConverter { + static checkType(name, value) { + if (value === undefined ) { + throw TypeError(`${name} is undefined`); + } + if (value === null ) { + throw TypeError(`${name} is null`); + } + } +} + +// Base class for FFI converters that lift/lower by reading/writing to an ArrayBuffer +class FfiConverterArrayBuffer extends FfiConverter { + static lift(buf) { + return this.read(new ArrayBufferDataStream(buf)); + } + + static lower(value) { + const buf = new ArrayBuffer(this.computeSize(value)); + const dataStream = new ArrayBufferDataStream(buf); + this.write(dataStream, value); + return buf; + } +} + +// Symbols that are used to ensure that Object constructors +// can only be used with a proper UniFFI pointer +const uniffiObjectPtr = Symbol("uniffiObjectPtr"); +const constructUniffiObject = Symbol("constructUniffiObject"); + +class FfiConverterI64 extends FfiConverter { + static checkType(name, value) { + super.checkType(name, value); + if (!Number.isSafeInteger(value)) { + throw TypeError(`${name} exceeds the safe integer bounds (${value})`); + } + } + static computeSize() { + return 8; + } + static lift(value) { + return value; + } + static lower(value) { + return value; + } + static write(dataStream, value) { + dataStream.writeInt64(value) + } + static read(dataStream) { + return dataStream.readInt64() + } +} + +// Export the FFIConverter object to make external types work. +EXPORTED_SYMBOLS.push("FfiConverterI64"); + +class FfiConverterString extends FfiConverter { + static lift(buf) { + const decoder = new TextDecoder(); + const utf8Arr = new Uint8Array(buf); + return decoder.decode(utf8Arr); + } + static lower(value) { + const encoder = new TextEncoder(); + return encoder.encode(value).buffer; + } + + static write(dataStream, value) { + dataStream.writeString(value); + } + + static read(dataStream) { + return dataStream.readString(); + } + + static computeSize(value) { + const encoder = new TextEncoder(); + return 4 + encoder.encode(value).length + } +} + +// Export the FFIConverter object to make external types work. +EXPORTED_SYMBOLS.push("FfiConverterString"); + +class TabsBridgedEngine { + // Use `init` to instantiate this class. + // DO NOT USE THIS CONSTRUCTOR DIRECTLY + constructor(opts) { + if (!Object.prototype.hasOwnProperty.call(opts, constructUniffiObject)) { + throw new UniFFIError("Attempting to construct an object using the JavaScript constructor directly" + + "Please use a UDL defined constructor, or the init function for the primary constructor") + } + if (!opts[constructUniffiObject] instanceof UniFFIPointer) { + throw new UniFFIError("Attempting to create a UniFFI object with a pointer that is not an instance of UniFFIPointer") + } + this[uniffiObjectPtr] = opts[constructUniffiObject]; + } + lastSync() { + const liftResult = (result) => FfiConverterI64.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 7, // tabs:tabs_af8e_TabsBridgedEngine_last_sync + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + setLastSync(lastSync) { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterI64.checkType("lastSync", lastSync); + return UniFFIScaffolding.callAsync( + 8, // tabs:tabs_af8e_TabsBridgedEngine_set_last_sync + FfiConverterTypeTabsBridgedEngine.lower(this), + FfiConverterI64.lower(lastSync), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + syncId() { + const liftResult = (result) => FfiConverterOptionalstring.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 9, // tabs:tabs_af8e_TabsBridgedEngine_sync_id + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + resetSyncId() { + const liftResult = (result) => FfiConverterString.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 10, // tabs:tabs_af8e_TabsBridgedEngine_reset_sync_id + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + ensureCurrentSyncId(newSyncId) { + const liftResult = (result) => FfiConverterString.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterString.checkType("newSyncId", newSyncId); + return UniFFIScaffolding.callAsync( + 11, // tabs:tabs_af8e_TabsBridgedEngine_ensure_current_sync_id + FfiConverterTypeTabsBridgedEngine.lower(this), + FfiConverterString.lower(newSyncId), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + prepareForSync(clientData) { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterString.checkType("clientData", clientData); + return UniFFIScaffolding.callAsync( + 12, // tabs:tabs_af8e_TabsBridgedEngine_prepare_for_sync + FfiConverterTypeTabsBridgedEngine.lower(this), + FfiConverterString.lower(clientData), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + syncStarted() { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 13, // tabs:tabs_af8e_TabsBridgedEngine_sync_started + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + storeIncoming(incomingEnvelopesAsJson) { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterSequencestring.checkType("incomingEnvelopesAsJson", incomingEnvelopesAsJson); + return UniFFIScaffolding.callAsync( + 14, // tabs:tabs_af8e_TabsBridgedEngine_store_incoming + FfiConverterTypeTabsBridgedEngine.lower(this), + FfiConverterSequencestring.lower(incomingEnvelopesAsJson), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + apply() { + const liftResult = (result) => FfiConverterSequencestring.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 15, // tabs:tabs_af8e_TabsBridgedEngine_apply + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + setUploaded(newTimestamp,uploadedIds) { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterI64.checkType("newTimestamp", newTimestamp); + FfiConverterSequenceTypeTabsGuid.checkType("uploadedIds", uploadedIds); + return UniFFIScaffolding.callAsync( + 16, // tabs:tabs_af8e_TabsBridgedEngine_set_uploaded + FfiConverterTypeTabsBridgedEngine.lower(this), + FfiConverterI64.lower(newTimestamp), + FfiConverterSequenceTypeTabsGuid.lower(uploadedIds), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + syncFinished() { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 17, // tabs:tabs_af8e_TabsBridgedEngine_sync_finished + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + reset() { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 18, // tabs:tabs_af8e_TabsBridgedEngine_reset + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + wipe() { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 19, // tabs:tabs_af8e_TabsBridgedEngine_wipe + FfiConverterTypeTabsBridgedEngine.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + +} + +class FfiConverterTypeTabsBridgedEngine extends FfiConverter { + static lift(value) { + const opts = {}; + opts[constructUniffiObject] = value; + return new TabsBridgedEngine(opts); + } + + static lower(value) { + return value[uniffiObjectPtr]; + } + + static read(dataStream) { + return this.lift(dataStream.readPointerTabsBridgedEngine()); + } + + static write(dataStream, value) { + dataStream.writePointerTabsBridgedEngine(value[uniffiObjectPtr]); + } + + static computeSize(value) { + return 8; + } +} + +EXPORTED_SYMBOLS.push("TabsBridgedEngine"); + +// Export the FFIConverter object to make external types work. +EXPORTED_SYMBOLS.push("FfiConverterTypeTabsBridgedEngine"); + +class TabsStore { + // Use `init` to instantiate this class. + // DO NOT USE THIS CONSTRUCTOR DIRECTLY + constructor(opts) { + if (!Object.prototype.hasOwnProperty.call(opts, constructUniffiObject)) { + throw new UniFFIError("Attempting to construct an object using the JavaScript constructor directly" + + "Please use a UDL defined constructor, or the init function for the primary constructor") + } + if (!opts[constructUniffiObject] instanceof UniFFIPointer) { + throw new UniFFIError("Attempting to create a UniFFI object with a pointer that is not an instance of UniFFIPointer") + } + this[uniffiObjectPtr] = opts[constructUniffiObject]; + } + /** + * An async constructor for TabsStore. + * + * @returns {Promise}: A promise that resolves + * to a newly constructed TabsStore + */ + static init(path) { + const liftResult = (result) => FfiConverterTypeTabsStore.lift(result); + const liftError = null; + const functionCall = () => { + FfiConverterString.checkType("path", path); + return UniFFIScaffolding.callAsync( + 0, // tabs:tabs_af8e_TabsStore_new + FfiConverterString.lower(path), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + getAll() { + const liftResult = (result) => FfiConverterSequenceTypeClientRemoteTabs.lift(result); + const liftError = null; + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 1, // tabs:tabs_af8e_TabsStore_get_all + FfiConverterTypeTabsStore.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + setLocalTabs(remoteTabs) { + const liftResult = (result) => undefined; + const liftError = null; + const functionCall = () => { + FfiConverterSequenceTypeRemoteTabRecord.checkType("remoteTabs", remoteTabs); + return UniFFIScaffolding.callAsync( + 2, // tabs:tabs_af8e_TabsStore_set_local_tabs + FfiConverterTypeTabsStore.lower(this), + FfiConverterSequenceTypeRemoteTabRecord.lower(remoteTabs), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + registerWithSyncManager() { + const liftResult = (result) => undefined; + const liftError = null; + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 3, // tabs:tabs_af8e_TabsStore_register_with_sync_manager + FfiConverterTypeTabsStore.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + reset() { + const liftResult = (result) => undefined; + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 4, // tabs:tabs_af8e_TabsStore_reset + FfiConverterTypeTabsStore.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + sync(keyId,accessToken,syncKey,tokenserverUrl,localId) { + const liftResult = (result) => FfiConverterString.lift(result); + const liftError = (data) => FfiConverterTypeTabsError.lift(data); + const functionCall = () => { + FfiConverterString.checkType("keyId", keyId); + FfiConverterString.checkType("accessToken", accessToken); + FfiConverterString.checkType("syncKey", syncKey); + FfiConverterString.checkType("tokenserverUrl", tokenserverUrl); + FfiConverterString.checkType("localId", localId); + return UniFFIScaffolding.callAsync( + 5, // tabs:tabs_af8e_TabsStore_sync + FfiConverterTypeTabsStore.lower(this), + FfiConverterString.lower(keyId), + FfiConverterString.lower(accessToken), + FfiConverterString.lower(syncKey), + FfiConverterString.lower(tokenserverUrl), + FfiConverterString.lower(localId), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + bridgedEngine() { + const liftResult = (result) => FfiConverterTypeTabsBridgedEngine.lift(result); + const liftError = null; + const functionCall = () => { + return UniFFIScaffolding.callAsync( + 6, // tabs:tabs_af8e_TabsStore_bridged_engine + FfiConverterTypeTabsStore.lower(this), + ) + } + try { + return functionCall().then((result) => handleRustResult(result, liftResult, liftError)); + } catch (error) { + return Promise.reject(error) + }} + +} + +class FfiConverterTypeTabsStore extends FfiConverter { + static lift(value) { + const opts = {}; + opts[constructUniffiObject] = value; + return new TabsStore(opts); + } + + static lower(value) { + return value[uniffiObjectPtr]; + } + + static read(dataStream) { + return this.lift(dataStream.readPointerTabsStore()); + } + + static write(dataStream, value) { + dataStream.writePointerTabsStore(value[uniffiObjectPtr]); + } + + static computeSize(value) { + return 8; + } +} + +EXPORTED_SYMBOLS.push("TabsStore"); + +// Export the FFIConverter object to make external types work. +EXPORTED_SYMBOLS.push("FfiConverterTypeTabsStore"); + +class ClientRemoteTabs { + constructor(clientId,clientName,deviceType,remoteTabs) { + FfiConverterString.checkType("clientId", clientId); + FfiConverterString.checkType("clientName", clientName); + FfiConverterTypeTabsDeviceType.checkType("deviceType", deviceType); + FfiConverterSequenceTypeRemoteTabRecord.checkType("remoteTabs", remoteTabs); + this.clientId = clientId; + this.clientName = clientName; + this.deviceType = deviceType; + this.remoteTabs = remoteTabs; + } + equals(other) { + return ( + this.clientId == other.clientId && + this.clientName == other.clientName && + this.deviceType == other.deviceType && + this.remoteTabs == other.remoteTabs + ) + } +} + +class FfiConverterTypeClientRemoteTabs extends FfiConverter { + static lift(buf) { + return this.read(new ArrayBufferDataStream(buf)); + } + static lower(value) { + const buf = new ArrayBuffer(this.computeSize(value)); + const dataStream = new ArrayBufferDataStream(buf); + this.write(dataStream, value); + return buf; + } + static read(dataStream) { + return new ClientRemoteTabs( + FfiConverterString.read(dataStream), + FfiConverterString.read(dataStream), + FfiConverterTypeTabsDeviceType.read(dataStream), + FfiConverterSequenceTypeRemoteTabRecord.read(dataStream) + ); + } + static write(dataStream, value) { + FfiConverterString.write(dataStream, value.clientId); + FfiConverterString.write(dataStream, value.clientName); + FfiConverterTypeTabsDeviceType.write(dataStream, value.deviceType); + FfiConverterSequenceTypeRemoteTabRecord.write(dataStream, value.remoteTabs); + } + + static computeSize(value) { + let totalSize = 0; + totalSize += FfiConverterString.computeSize(value.clientId); + totalSize += FfiConverterString.computeSize(value.clientName); + totalSize += FfiConverterTypeTabsDeviceType.computeSize(value.deviceType); + totalSize += FfiConverterSequenceTypeRemoteTabRecord.computeSize(value.remoteTabs); + return totalSize + } +} + +EXPORTED_SYMBOLS.push("ClientRemoteTabs"); + +// Export the FFIConverter object to make external types work. +EXPORTED_SYMBOLS.push("FfiConverterTypeClientRemoteTabs"); + +class RemoteTabRecord { + constructor(title,urlHistory,icon,lastUsed) { + FfiConverterString.checkType("title", title); + FfiConverterSequencestring.checkType("urlHistory", urlHistory); + FfiConverterOptionalstring.checkType("icon", icon); + FfiConverterI64.checkType("lastUsed", lastUsed); + this.title = title; + this.urlHistory = urlHistory; + this.icon = icon; + this.lastUsed = lastUsed; + } + equals(other) { + return ( + this.title == other.title && + this.urlHistory == other.urlHistory && + this.icon == other.icon && + this.lastUsed == other.lastUsed + ) + } +} + +class FfiConverterTypeRemoteTabRecord extends FfiConverter { + static lift(buf) { + return this.read(new ArrayBufferDataStream(buf)); + } + static lower(value) { + const buf = new ArrayBuffer(this.computeSize(value)); *** 92490 LINES SKIPPED ***