Skip to content

Commit 6c2a42c

Browse files
committed
Adjust comment
1 parent a718acc commit 6c2a42c

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

BrowserKit/Sources/WebEngine/WKWebview/Scripts/ReaderMode/WKReadabilityOperation.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ final class WKReadabilityOperation: Operation,
2424
ReaderModeNavigationDelegate,
2525
WKReaderModeDelegate {
2626
var url: URL
27-
var semaphore: DispatchSemaphore
27+
// TODO: FXIOS-11373 - The original code had a semaphore, but it's removed here since with @MainActor we
28+
// don't want to suspense the main thread. So this class needs to be retought if this project is picked back again.
29+
// var semaphore: DispatchSemaphore
2830
var result: ReadabilityOperationResult?
2931
var session: WKEngineSession?
3032
var readerModeCache: ReaderModeCache
@@ -38,7 +40,6 @@ final class WKReadabilityOperation: Operation,
3840
logger: Logger = DefaultLogger.shared
3941
) {
4042
self.url = url
41-
self.semaphore = DispatchSemaphore(value: 0)
4243
self.readerModeCache = readerModeCache
4344
self.mainQueue = mainQueue
4445
self.logger = logger
@@ -71,11 +72,6 @@ final class WKReadabilityOperation: Operation,
7172
// session?.load(browserURL: browserURL)
7273
// }
7374
//
74-
// let timeout = DispatchTime.now() + .seconds(10)
75-
// if semaphore.wait(timeout: timeout) == .timedOut {
76-
// result = ReadabilityOperationResult.timeout
77-
// }
78-
//
7975
// processResult()
8076
}
8177

@@ -109,7 +105,7 @@ final class WKReadabilityOperation: Operation,
109105

110106
func didFailWithError(error: Error) {
111107
result = ReadabilityOperationResult.error(error as NSError)
112-
semaphore.signal()
108+
// semaphore.signal()
113109
}
114110

115111
func didFinish() {
@@ -143,6 +139,6 @@ final class WKReadabilityOperation: Operation,
143139
guard session == self.session else { return }
144140

145141
result = ReadabilityOperationResult.success(readabilityResult)
146-
semaphore.signal()
142+
// semaphore.signal()
147143
}
148144
}

0 commit comments

Comments
 (0)