Oops - need to multiply instead of divide to get accurate representation of delay timeout in nanoseconds.

This commit is contained in:
Daniel Jalkut 2018-08-19 14:08:31 -04:00
parent 3492b59707
commit 8748e6f8cf
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ class SafariExtensionHandler: SFSafariExtensionHandler {
// Capture the uniqueValidationID to ensure it doesn't change out from under us on a future call
activePage.dispatchMessageToScript(withName: "ping", userInfo: ["validationID": uniqueValidationID])
let pongTimeoutInNanoseconds = Int(NSEC_PER_SEC / UInt64(1))
let pongTimeoutInNanoseconds = Int(NSEC_PER_SEC * UInt64(1))
let timeoutDeadline = DispatchTime.now() + DispatchTimeInterval.nanoseconds(pongTimeoutInNanoseconds)
DispatchQueue.main.asyncAfter(deadline: timeoutDeadline, execute: { [timedOutValidationID = uniqueValidationID] in
SafariExtensionHandler.callValidationHandler(forHandlerID: timedOutValidationID, withShouldValidate:false)