Title: [252326] branches/safari-608.4.9.0-branch
- Revision
- 252326
- Author
- [email protected]
- Date
- 2019-11-11 08:58:25 -0800 (Mon, 11 Nov 2019)
Log Message
Cherry-pick r252248. rdar://problem/57040121
[WebAuthn] Return NotAllowedError immediately for UI cancellations
https://bugs.webkit.org/show_bug.cgi?id=203937
<rdar://problem/56962420>
Reviewed by Brent Fulgham.
Source/WebKit:
NotAllowedError representing UI cancellations should be returned to sites
immediately such that sites could show appropriate error page immediately.
Covered by existing tests.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::cancelRequest):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::resetState): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
Tools:
* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog (252325 => 252326)
--- branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog 2019-11-11 16:24:49 UTC (rev 252325)
+++ branches/safari-608.4.9.0-branch/Source/WebKit/ChangeLog 2019-11-11 16:58:25 UTC (rev 252326)
@@ -1,3 +1,52 @@
+2019-11-11 Kocsen Chung <[email protected]>
+
+ Cherry-pick r252248. rdar://problem/57040121
+
+ [WebAuthn] Return NotAllowedError immediately for UI cancellations
+ https://bugs.webkit.org/show_bug.cgi?id=203937
+ <rdar://problem/56962420>
+
+ Reviewed by Brent Fulgham.
+
+ Source/WebKit:
+
+ NotAllowedError representing UI cancellations should be returned to sites
+ immediately such that sites could show appropriate error page immediately.
+
+ Covered by existing tests.
+
+ * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
+ (WebKit::AuthenticatorManager::cancelRequest):
+ (WebKit::AuthenticatorManager::clearState):
+ (WebKit::AuthenticatorManager::resetState): Deleted.
+ * UIProcess/WebAuthentication/AuthenticatorManager.h:
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+ (TestWebKitAPI::TEST):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-11-06 Jiewen Tan <[email protected]>
+
+ [WebAuthn] Return NotAllowedError immediately for UI cancellations
+ https://bugs.webkit.org/show_bug.cgi?id=203937
+ <rdar://problem/56962420>
+
+ Reviewed by Brent Fulgham.
+
+ NotAllowedError representing UI cancellations should be returned to sites
+ immediately such that sites could show appropriate error page immediately.
+
+ Covered by existing tests.
+
+ * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
+ (WebKit::AuthenticatorManager::cancelRequest):
+ (WebKit::AuthenticatorManager::clearState):
+ (WebKit::AuthenticatorManager::resetState): Deleted.
+ * UIProcess/WebAuthentication/AuthenticatorManager.h:
+
2019-11-10 Kocsen Chung <[email protected]>
Cherry-pick r252297. rdar://problem/57040122
Modified: branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp (252325 => 252326)
--- branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp 2019-11-11 16:24:49 UTC (rev 252325)
+++ branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp 2019-11-11 16:58:25 UTC (rev 252326)
@@ -188,7 +188,9 @@
RELEASE_ASSERT(RunLoop::isMain());
if (!m_pendingCompletionHandler || m_pendingRequestData.panel.get() != &panel)
return;
- resetState();
+ invokePendingCompletionHandler(ExceptionData { NotAllowedError, "This request has been cancelled by the user."_s });
+ clearState();
+ m_requestTimeOutTimer.stop();
}
void AuthenticatorManager::clearStateAsync()
@@ -204,7 +206,9 @@
{
if (m_pendingCompletionHandler)
return;
- resetState();
+ m_authenticators.clear();
+ m_services.clear();
+ m_pendingRequestData = { };
}
void AuthenticatorManager::authenticatorAdded(Ref<Authenticator>&& authenticator)
@@ -347,13 +351,6 @@
m_pendingCompletionHandler(WTFMove(respond));
}
-void AuthenticatorManager::resetState()
-{
- m_authenticators.clear();
- m_services.clear();
- m_pendingRequestData = { };
-}
-
void AuthenticatorManager::restartDiscovery()
{
for (auto& service : m_services)
Modified: branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h (252325 => 252326)
--- branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h 2019-11-11 16:24:49 UTC (rev 252325)
+++ branches/safari-608.4.9.0-branch/Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.h 2019-11-11 16:58:25 UTC (rev 252326)
@@ -91,7 +91,6 @@
void timeOutTimerFired();
void runPanel();
void startRequest();
- void resetState();
void restartDiscovery();
// Request: We only allow one request per time. A new request will cancel any pending ones.
Modified: branches/safari-608.4.9.0-branch/Tools/ChangeLog (252325 => 252326)
--- branches/safari-608.4.9.0-branch/Tools/ChangeLog 2019-11-11 16:24:49 UTC (rev 252325)
+++ branches/safari-608.4.9.0-branch/Tools/ChangeLog 2019-11-11 16:58:25 UTC (rev 252326)
@@ -1,3 +1,44 @@
+2019-11-11 Kocsen Chung <[email protected]>
+
+ Cherry-pick r252248. rdar://problem/57040121
+
+ [WebAuthn] Return NotAllowedError immediately for UI cancellations
+ https://bugs.webkit.org/show_bug.cgi?id=203937
+ <rdar://problem/56962420>
+
+ Reviewed by Brent Fulgham.
+
+ Source/WebKit:
+
+ NotAllowedError representing UI cancellations should be returned to sites
+ immediately such that sites could show appropriate error page immediately.
+
+ Covered by existing tests.
+
+ * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
+ (WebKit::AuthenticatorManager::cancelRequest):
+ (WebKit::AuthenticatorManager::clearState):
+ (WebKit::AuthenticatorManager::resetState): Deleted.
+ * UIProcess/WebAuthentication/AuthenticatorManager.h:
+
+ Tools:
+
+ * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+ (TestWebKitAPI::TEST):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-11-06 Jiewen Tan <[email protected]>
+
+ [WebAuthn] Return NotAllowedError immediately for UI cancellations
+ https://bugs.webkit.org/show_bug.cgi?id=203937
+ <rdar://problem/56962420>
+
+ Reviewed by Brent Fulgham.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
+ (TestWebKitAPI::TEST):
+
2019-11-05 Alan Coon <[email protected]>
Apply patch. rdar://problem/56903274
Modified: branches/safari-608.4.9.0-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm (252325 => 252326)
--- branches/safari-608.4.9.0-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm 2019-11-11 16:24:49 UTC (rev 252325)
+++ branches/safari-608.4.9.0-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm 2019-11-11 16:58:25 UTC (rev 252326)
@@ -510,9 +510,8 @@
[webView loadRequest:[NSURLRequest requestWithURL:testURL.get()]];
Util::run(&webAuthenticationPanelRan);
[gPanel cancel];
- [webView waitForMessage:@"Operation timed out."];
- EXPECT_FALSE(webAuthenticationPanelFailed);
- EXPECT_FALSE(webAuthenticationPanelSucceded);
+ [webView waitForMessage:@"This request has been cancelled by the user."];
+ EXPECT_TRUE(webAuthenticationPanelFailed);
}
TEST(WebAuthenticationPanel, PanelHidCtapNoCredentialsFound)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes