Skip to content

Commit f1439e4

Browse files
author
Firefox Sync Engineering
committed
Nightly auto-update (134.0.20241113050253)
1 parent 1fc07f6 commit f1439e4

File tree

6 files changed

+200
-20
lines changed

6 files changed

+200
-20
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// swift-tools-version:5.4
22
import PackageDescription
33

4-
let checksum = "f66ce1f84d19f395b7c3d4374d739c7187b72238d3c9419d05f2918ec0cd0d33"
5-
let version = "134.0.20241109050310"
6-
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241109050310/artifacts/public/build/MozillaRustComponents.xcframework.zip"
4+
let checksum = "2a2e78cf5ae7d48ed9ccb82966a75b74a05ad2c6de93dfbc22e852d394af29ef"
5+
let version = "134.0.20241113050253"
6+
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241113050253/artifacts/public/build/MozillaRustComponents.xcframework.zip"
77

88
// Focus xcframework
9-
let focusChecksum = "76afebf1057b376b8a75e825a94c7659a5f5081b0b50290195b4b7bfea4b4b7c"
10-
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241109050310/artifacts/public/build/FocusRustComponents.xcframework.zip"
9+
let focusChecksum = "c095c6c502fe22883ac3f9fe4b5dfd5cbe0083f7ebdf429bcd0ef4576275d0fb"
10+
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.134.20241113050253/artifacts/public/build/FocusRustComponents.xcframework.zip"
1111
let package = Package(
1212
name: "MozillaRustComponentsSwift",
1313
platforms: [.iOS(.v14)],

swift-source/all/Generated/Metrics/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 11, day: 9, hour: 5, minute: 12, second: 47))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 11, day: 13, hour: 5, minute: 21, second: 16))
2727
}
2828

2929
enum NimbusEvents {

swift-source/all/Generated/places.swift

Lines changed: 140 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ public protocol PlacesConnectionProtocol : AnyObject {
789789

790790
func newInterruptHandle() -> SqlInterruptHandle
791791

792-
func noteHistoryMetadataObservation(data: HistoryMetadataObservation) throws
792+
func noteHistoryMetadataObservation(data: HistoryMetadataObservation, options: NoteHistoryMetadataObservationOptions) throws
793793

794794
func placesHistoryImportFromIos(dbPath: String, lastSyncTimestamp: Int64) throws -> HistoryMigrationResult
795795

@@ -1165,9 +1165,10 @@ open func newInterruptHandle() -> SqlInterruptHandle {
11651165
})
11661166
}
11671167

1168-
open func noteHistoryMetadataObservation(data: HistoryMetadataObservation)throws {try rustCallWithError(FfiConverterTypePlacesApiError.lift) {
1168+
open func noteHistoryMetadataObservation(data: HistoryMetadataObservation, options: NoteHistoryMetadataObservationOptions)throws {try rustCallWithError(FfiConverterTypePlacesApiError.lift) {
11691169
uniffi_places_fn_method_placesconnection_note_history_metadata_observation(self.uniffiClonePointer(),
1170-
FfiConverterTypeHistoryMetadataObservation.lower(data),$0
1170+
FfiConverterTypeHistoryMetadataObservation.lower(data),
1171+
FfiConverterTypeNoteHistoryMetadataObservationOptions.lower(options),$0
11711172
)
11721173
}
11731174
}
@@ -2843,6 +2844,67 @@ public func FfiConverterTypeInsertableBookmarkSeparator_lower(_ value: Insertabl
28432844
}
28442845

28452846

2847+
/**
2848+
* Options for recording history metadata observations.
2849+
*/
2850+
public struct NoteHistoryMetadataObservationOptions {
2851+
public var ifPageMissing: HistoryMetadataPageMissingBehavior
2852+
2853+
// Default memberwise initializers are never public by default, so we
2854+
// declare one manually.
2855+
public init(ifPageMissing: HistoryMetadataPageMissingBehavior = .ignoreObservation) {
2856+
self.ifPageMissing = ifPageMissing
2857+
}
2858+
}
2859+
2860+
2861+
2862+
extension NoteHistoryMetadataObservationOptions: Equatable, Hashable {
2863+
public static func ==(lhs: NoteHistoryMetadataObservationOptions, rhs: NoteHistoryMetadataObservationOptions) -> Bool {
2864+
if lhs.ifPageMissing != rhs.ifPageMissing {
2865+
return false
2866+
}
2867+
return true
2868+
}
2869+
2870+
public func hash(into hasher: inout Hasher) {
2871+
hasher.combine(ifPageMissing)
2872+
}
2873+
}
2874+
2875+
2876+
#if swift(>=5.8)
2877+
@_documentation(visibility: private)
2878+
#endif
2879+
public struct FfiConverterTypeNoteHistoryMetadataObservationOptions: FfiConverterRustBuffer {
2880+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NoteHistoryMetadataObservationOptions {
2881+
return
2882+
try NoteHistoryMetadataObservationOptions(
2883+
ifPageMissing: FfiConverterTypeHistoryMetadataPageMissingBehavior.read(from: &buf)
2884+
)
2885+
}
2886+
2887+
public static func write(_ value: NoteHistoryMetadataObservationOptions, into buf: inout [UInt8]) {
2888+
FfiConverterTypeHistoryMetadataPageMissingBehavior.write(value.ifPageMissing, into: &buf)
2889+
}
2890+
}
2891+
2892+
2893+
#if swift(>=5.8)
2894+
@_documentation(visibility: private)
2895+
#endif
2896+
public func FfiConverterTypeNoteHistoryMetadataObservationOptions_lift(_ buf: RustBuffer) throws -> NoteHistoryMetadataObservationOptions {
2897+
return try FfiConverterTypeNoteHistoryMetadataObservationOptions.lift(buf)
2898+
}
2899+
2900+
#if swift(>=5.8)
2901+
@_documentation(visibility: private)
2902+
#endif
2903+
public func FfiConverterTypeNoteHistoryMetadataObservationOptions_lower(_ value: NoteHistoryMetadataObservationOptions) -> RustBuffer {
2904+
return FfiConverterTypeNoteHistoryMetadataObservationOptions.lower(value)
2905+
}
2906+
2907+
28462908
public struct RunMaintenanceMetrics {
28472909
public var prunedVisits: Bool
28482910
public var dbSizeBefore: UInt32
@@ -3555,6 +3617,80 @@ extension FrecencyThresholdOption: Equatable, Hashable {}
35553617

35563618

35573619

3620+
// Note that we don't yet support `indirect` for enums.
3621+
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
3622+
/**
3623+
* The action to take when recording a history metadata observation for
3624+
* a page that doesn't have an entry in the history database.
3625+
*/
3626+
3627+
public enum HistoryMetadataPageMissingBehavior {
3628+
3629+
/**
3630+
* Insert an entry for the page into the history database.
3631+
*/
3632+
case insertPage
3633+
/**
3634+
* Ignore and discard the observation. This is the default behavior.
3635+
*/
3636+
case ignoreObservation
3637+
}
3638+
3639+
3640+
#if swift(>=5.8)
3641+
@_documentation(visibility: private)
3642+
#endif
3643+
public struct FfiConverterTypeHistoryMetadataPageMissingBehavior: FfiConverterRustBuffer {
3644+
typealias SwiftType = HistoryMetadataPageMissingBehavior
3645+
3646+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HistoryMetadataPageMissingBehavior {
3647+
let variant: Int32 = try readInt(&buf)
3648+
switch variant {
3649+
3650+
case 1: return .insertPage
3651+
3652+
case 2: return .ignoreObservation
3653+
3654+
default: throw UniffiInternalError.unexpectedEnumCase
3655+
}
3656+
}
3657+
3658+
public static func write(_ value: HistoryMetadataPageMissingBehavior, into buf: inout [UInt8]) {
3659+
switch value {
3660+
3661+
3662+
case .insertPage:
3663+
writeInt(&buf, Int32(1))
3664+
3665+
3666+
case .ignoreObservation:
3667+
writeInt(&buf, Int32(2))
3668+
3669+
}
3670+
}
3671+
}
3672+
3673+
3674+
#if swift(>=5.8)
3675+
@_documentation(visibility: private)
3676+
#endif
3677+
public func FfiConverterTypeHistoryMetadataPageMissingBehavior_lift(_ buf: RustBuffer) throws -> HistoryMetadataPageMissingBehavior {
3678+
return try FfiConverterTypeHistoryMetadataPageMissingBehavior.lift(buf)
3679+
}
3680+
3681+
#if swift(>=5.8)
3682+
@_documentation(visibility: private)
3683+
#endif
3684+
public func FfiConverterTypeHistoryMetadataPageMissingBehavior_lower(_ value: HistoryMetadataPageMissingBehavior) -> RustBuffer {
3685+
return FfiConverterTypeHistoryMetadataPageMissingBehavior.lower(value)
3686+
}
3687+
3688+
3689+
3690+
extension HistoryMetadataPageMissingBehavior: Equatable, Hashable {}
3691+
3692+
3693+
35583694
// Note that we don't yet support `indirect` for enums.
35593695
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
35603696

@@ -4792,7 +4928,7 @@ private var initializationResult: InitializationResult = {
47924928
if (uniffi_places_checksum_method_placesconnection_new_interrupt_handle() != 5418) {
47934929
return InitializationResult.apiChecksumMismatch
47944930
}
4795-
if (uniffi_places_checksum_method_placesconnection_note_history_metadata_observation() != 12555) {
4931+
if (uniffi_places_checksum_method_placesconnection_note_history_metadata_observation() != 31493) {
47964932
return InitializationResult.apiChecksumMismatch
47974933
}
47984934
if (uniffi_places_checksum_method_placesconnection_places_history_import_from_ios() != 596) {

swift-source/all/Generated/placesFFI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void*_Nonnull uniffi_places_fn_method_placesconnection_new_interrupt_handle(void
463463
#endif
464464
#ifndef UNIFFI_FFIDEF_UNIFFI_PLACES_FN_METHOD_PLACESCONNECTION_NOTE_HISTORY_METADATA_OBSERVATION
465465
#define UNIFFI_FFIDEF_UNIFFI_PLACES_FN_METHOD_PLACESCONNECTION_NOTE_HISTORY_METADATA_OBSERVATION
466-
void uniffi_places_fn_method_placesconnection_note_history_metadata_observation(void*_Nonnull ptr, RustBuffer data, RustCallStatus *_Nonnull out_status
466+
void uniffi_places_fn_method_placesconnection_note_history_metadata_observation(void*_Nonnull ptr, RustBuffer data, RustBuffer options, RustCallStatus *_Nonnull out_status
467467
);
468468
#endif
469469
#ifndef UNIFFI_FFIDEF_UNIFFI_PLACES_FN_METHOD_PLACESCONNECTION_PLACES_HISTORY_IMPORT_FROM_IOS

swift-source/all/Places/Places.swift

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,37 @@ public class PlacesReadConnection {
299299
}
300300
}
301301

302+
/**
303+
* Counts the number of bookmark items in the bookmark trees under the specified GUIDs.
304+
* Empty folders, non-existing GUIDs and non-folder guids will return zero.
305+
*
306+
* - Parameter folderGuids: The guids of folders to query.
307+
* - Returns: Count of all bookmark items (ie, not folders or separators) in all specified folders recursively.
308+
* - Throws:
309+
* - `PlacesApiError.databaseInterrupted`: If a call is made to
310+
* `interrupt()` on this object
311+
* from another thread.
312+
* - `PlacesConnectionError.connUseAfterAPIClosed`: If the PlacesAPI that returned
313+
* this connection object has
314+
* been closed. This indicates
315+
* API misuse.
316+
* - `PlacesApiError.databaseBusy`: If this query times out with a
317+
* SQLITE_BUSY error.
318+
* - `PlacesApiError.unexpected`: When an error that has not specifically
319+
* been exposed to Swift is encountered (for
320+
* example IO errors from the database code,
321+
* etc).
322+
* - `PlacesApiError.panic`: If the rust code panics while completing this
323+
* operation. (If this occurs, please let us
324+
* know).
325+
*/
326+
open func countBookmarksInTrees(folderGuids: [Guid]) throws -> Int {
327+
return try queue.sync {
328+
try self.checkApi()
329+
return try Int(self.conn.bookmarksCountBookmarksInTrees(folderGuids: folderGuids))
330+
}
331+
}
332+
302333
open func getLatestHistoryMetadataForUrl(url: Url) throws -> HistoryMetadata? {
303334
return try queue.sync {
304335
try self.checkApi()
@@ -700,44 +731,57 @@ public class PlacesWriteConnection: PlacesReadConnection {
700731
// MARK: History metadata write APIs
701732

702733
open func noteHistoryMetadataObservation(
703-
observation: HistoryMetadataObservation
734+
observation: HistoryMetadataObservation,
735+
_ options: NoteHistoryMetadataObservationOptions = NoteHistoryMetadataObservationOptions()
704736
) throws {
705737
try queue.sync {
706738
try self.checkApi()
707-
try self.conn.noteHistoryMetadataObservation(data: observation)
739+
try self.conn.noteHistoryMetadataObservation(data: observation, options: options)
708740
}
709741
}
710742

711743
// Keeping these three functions inline with what Kotlin (PlacesConnection.kt)
712744
// to make future work more symmetrical
713-
open func noteHistoryMetadataObservationViewTime(key: HistoryMetadataKey, viewTime: Int32?) throws {
745+
open func noteHistoryMetadataObservationViewTime(
746+
key: HistoryMetadataKey,
747+
viewTime: Int32?,
748+
_ options: NoteHistoryMetadataObservationOptions = NoteHistoryMetadataObservationOptions()
749+
) throws {
714750
let obs = HistoryMetadataObservation(
715751
url: key.url,
716752
referrerUrl: key.referrerUrl,
717753
searchTerm: key.searchTerm,
718754
viewTime: viewTime
719755
)
720-
try noteHistoryMetadataObservation(observation: obs)
756+
try noteHistoryMetadataObservation(observation: obs, options)
721757
}
722758

723-
open func noteHistoryMetadataObservationDocumentType(key: HistoryMetadataKey, documentType: DocumentType) throws {
759+
open func noteHistoryMetadataObservationDocumentType(
760+
key: HistoryMetadataKey,
761+
documentType: DocumentType,
762+
_ options: NoteHistoryMetadataObservationOptions = NoteHistoryMetadataObservationOptions()
763+
) throws {
724764
let obs = HistoryMetadataObservation(
725765
url: key.url,
726766
referrerUrl: key.referrerUrl,
727767
searchTerm: key.searchTerm,
728768
documentType: documentType
729769
)
730-
try noteHistoryMetadataObservation(observation: obs)
770+
try noteHistoryMetadataObservation(observation: obs, options)
731771
}
732772

733-
open func noteHistoryMetadataObservationTitle(key: HistoryMetadataKey, title: String) throws {
773+
open func noteHistoryMetadataObservationTitle(
774+
key: HistoryMetadataKey,
775+
title: String,
776+
_ options: NoteHistoryMetadataObservationOptions = NoteHistoryMetadataObservationOptions()
777+
) throws {
734778
let obs = HistoryMetadataObservation(
735779
url: key.url,
736780
referrerUrl: key.referrerUrl,
737781
searchTerm: key.searchTerm,
738782
title: title
739783
)
740-
try noteHistoryMetadataObservation(observation: obs)
784+
try noteHistoryMetadataObservation(observation: obs, options)
741785
}
742786

743787
open func deleteHistoryMetadataOlderThan(olderThan: Int64) throws {

swift-source/focus/Generated/Metrics/Metrics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 11, day: 9, hour: 5, minute: 12, second: 49))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 11, day: 13, hour: 5, minute: 21, second: 19))
2727
}
2828

2929
enum NimbusEvents {

0 commit comments

Comments
 (0)