Skip to content

Commit f7f4188

Browse files
authored
Refactor FXIOS-12796 [Swift 6 Migration] Fix SiteImageModel warnings (#30376)
* Fix some current build warnings related to strict concurrency. * Lower warning threshold.
1 parent 0a5439f commit f7f4188

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

BrowserKit/Sources/SiteImageView/Entities/SiteImageModel.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import UIKit
66

77
/// Stores information related to an image request inside SiteImageView.
8-
public struct SiteImageModel {
8+
public struct SiteImageModel: Sendable {
99
// A unique ID to tie the request to a certain image view
1010
let id: UUID
1111

@@ -18,8 +18,9 @@ public struct SiteImageModel {
1818
// Used to cache any resources related to this request
1919
let cacheKey: String
2020

21-
// The bundled resource or remote URL (e.g. faviconURL, preferrably high resolution) for this image.
22-
var siteResource: SiteResource?
21+
// The bundled resource or remote URL (e.g. faviconURL, preferably high resolution) for this image.
22+
// FIXME: FXIOS-14017 This property prevents SiteImageModel from being truly Sendable
23+
nonisolated(unsafe) var siteResource: SiteResource?
2324

2425
public init(id: UUID,
2526
imageType: SiteImageType,

BrowserKit/Sources/SiteImageView/SiteImageHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import UIKit
66

7-
public protocol SiteImageHandler {
7+
public protocol SiteImageHandler: Sendable {
88
func getImage(model: SiteImageModel) async -> UIImage
99
func cacheFaviconURL(siteURL: URL, faviconURL: URL)
1010
func clearAllCaches()

test-fixtures/generate-metrics.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -e
44

55
BUILD_LOG_FILE="$1"
66
TYPE_LOG_FILE="$2"
7-
THRESHOLD_UNIT_TEST=15
8-
THRESHOLD_XCUITEST=15
7+
THRESHOLD_UNIT_TEST=11
8+
THRESHOLD_XCUITEST=11
99

1010
WARNINGS=$(grep -E -v 'SourcePackages/checkouts' "$BUILD_LOG_FILE" \
1111
| grep -E '^[^ ]+:[0-9]+:[0-9]+: warning:' \

0 commit comments

Comments
 (0)