Skip to content

Commit

Permalink
Crash for uncalled completionHandler.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=274243
rdar://128176183

Reviewed by Wenson Hsieh.

Call the completion handler for all code paths.

* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::getTextIndicatorForID):
(WebKit::WebPageProxy::updateTextIndicatorStyleVisibilityForID):

Canonical link: https://commits.webkit.org/278847@main
  • Loading branch information
megangardner committed May 16, 2024
1 parent 8001ac7 commit 3aba877
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,10 @@ static bool exceedsRenderTreeSizeSizeThreshold(uint64_t thresholdSize, uint64_t

void WebPageProxy::getTextIndicatorForID(const WTF::UUID& uuid, CompletionHandler<void(std::optional<WebCore::TextIndicatorData>&&)>&& completionHandler)
{
if (!hasRunningProcess())
if (!hasRunningProcess()) {
completionHandler(std::nullopt);
return;
}

auto textIndicatorData = internals().textIndicatorDataForChunk.getOptional(uuid);

Expand All @@ -1234,8 +1236,10 @@ static bool exceedsRenderTreeSizeSizeThreshold(uint64_t thresholdSize, uint64_t

void WebPageProxy::updateTextIndicatorStyleVisibilityForID(const WTF::UUID& uuid, bool visible, CompletionHandler<void()>&& completionHandler)
{
if (!hasRunningProcess())
if (!hasRunningProcess()) {
completionHandler();
return;
}

sendWithAsyncReply(Messages::WebPage::UpdateTextIndicatorStyleVisibilityForID(uuid, visible), WTFMove(completionHandler));
}
Expand Down

0 comments on commit 3aba877

Please sign in to comment.