@@ -24,7 +24,9 @@ final class WKReadabilityOperation: Operation,
24
24
ReaderModeNavigationDelegate ,
25
25
WKReaderModeDelegate {
26
26
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
28
30
var result : ReadabilityOperationResult ?
29
31
var session : WKEngineSession ?
30
32
var readerModeCache : ReaderModeCache
@@ -38,7 +40,6 @@ final class WKReadabilityOperation: Operation,
38
40
logger: Logger = DefaultLogger . shared
39
41
) {
40
42
self . url = url
41
- self . semaphore = DispatchSemaphore ( value: 0 )
42
43
self . readerModeCache = readerModeCache
43
44
self . mainQueue = mainQueue
44
45
self . logger = logger
@@ -71,11 +72,6 @@ final class WKReadabilityOperation: Operation,
71
72
// session?.load(browserURL: browserURL)
72
73
// }
73
74
//
74
- // let timeout = DispatchTime.now() + .seconds(10)
75
- // if semaphore.wait(timeout: timeout) == .timedOut {
76
- // result = ReadabilityOperationResult.timeout
77
- // }
78
- //
79
75
// processResult()
80
76
}
81
77
@@ -109,7 +105,7 @@ final class WKReadabilityOperation: Operation,
109
105
110
106
func didFailWithError( error: Error ) {
111
107
result = ReadabilityOperationResult . error ( error as NSError )
112
- semaphore. signal ( )
108
+ // semaphore.signal()
113
109
}
114
110
115
111
func didFinish( ) {
@@ -143,6 +139,6 @@ final class WKReadabilityOperation: Operation,
143
139
guard session == self . session else { return }
144
140
145
141
result = ReadabilityOperationResult . success ( readabilityResult)
146
- semaphore. signal ( )
142
+ // semaphore.signal()
147
143
}
148
144
}
0 commit comments