Title: [286658] trunk/Source/WebKit
Revision
286658
Author
[email protected]
Date
2021-12-08 09:04:27 -0800 (Wed, 08 Dec 2021)

Log Message

Add a missing CompletionHandlerCallChecker around a UI delegate method call after r286640
https://bugs.webkit.org/show_bug.cgi?id=233890
rdar://86117718

Reviewed by Dan Bernstein.

Create and pass a `CompletionHandlerCallChecker` through the new delegate call to
`-_webView:requestCookieConsentWithMoreInfoHandler:decisionHandler:` added in r286640.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::requestCookieConsent):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (286657 => 286658)


--- trunk/Source/WebKit/ChangeLog	2021-12-08 16:55:05 UTC (rev 286657)
+++ trunk/Source/WebKit/ChangeLog	2021-12-08 17:04:27 UTC (rev 286658)
@@ -1,3 +1,17 @@
+2021-12-08  Wenson Hsieh  <[email protected]>
+
+        Add a missing CompletionHandlerCallChecker around a UI delegate method call after r286640
+        https://bugs.webkit.org/show_bug.cgi?id=233890
+        rdar://86117718
+
+        Reviewed by Dan Bernstein.
+
+        Create and pass a `CompletionHandlerCallChecker` through the new delegate call to
+        `-_webView:requestCookieConsentWithMoreInfoHandler:decisionHandler:` added in r286640.
+
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::UIClient::requestCookieConsent):
+
 2021-12-08  Youenn Fablet  <[email protected]>
 
         Same-site lax cookies not sent by fetch event handler after page reload

Modified: trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (286657 => 286658)


--- trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm	2021-12-08 16:55:05 UTC (rev 286657)
+++ trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm	2021-12-08 17:04:27 UTC (rev 286658)
@@ -655,7 +655,11 @@
         return completion(WebCore::CookieConsentDecisionResult::NotSupported);
 
     // FIXME: Add support for the 'more info' handler.
-    [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate->m_webView.get().get() requestCookieConsentWithMoreInfoHandler:nil decisionHandler:makeBlockPtr([completion = WTFMove(completion)] (BOOL decision) mutable {
+    auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:requestCookieConsentWithMoreInfoHandler:decisionHandler:));
+    [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate->m_webView.get().get() requestCookieConsentWithMoreInfoHandler:nil decisionHandler:makeBlockPtr([completion = WTFMove(completion), checker = WTFMove(checker)] (BOOL decision) mutable {
+        if (checker->completionHandlerHasBeenCalled())
+            return;
+        checker->didCallCompletionHandler();
         completion(decision ? WebCore::CookieConsentDecisionResult::Consent : WebCore::CookieConsentDecisionResult::Dissent);
     }).get()];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to