Skip to content

Commit

Permalink
[Win] REGRESSION(272822@main): StreamClientConnection.h(216,20): erro…
Browse files Browse the repository at this point in the history
…r: call to implicitly-deleted copy constructor of 'StreamClientConnection::SendSyncResult<PrepareForDisplay>'

https://bugs.webkit.org/show_bug.cgi?id=267294
rdar://120756511

Reviewed by Alex Christensen.

Fujii suggested this fix, and I initially thought I could do better by modifying WTF::Expected,
but after looking at it for a few hours, I'm not sure why MSVC doesn't see the move constructor.
Soon we'll have std::expected and this will hopefully not be an issue.

Also move a NO_RETURN_DUE_TO_CRASH macro to make MSVC happy.

* Source/WTF/wtf/Expected.h:
(std::experimental::fundamentals_v3::__expected_detail::constexpr_base::constexpr_base):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::terminateWebContentProcess):
* Source/WebCore/testing/Internals.h:

Canonical link: https://commits.webkit.org/272842@main
  • Loading branch information
fujii authored and achristensen07 committed Jan 10, 2024
1 parent 84f0f7a commit 3505bb0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/testing/Internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6184,7 +6184,7 @@ void Internals::whenServiceWorkerIsTerminated(ServiceWorker& worker, DOMPromiseD
});
}

NO_RETURN_DUE_TO_CRASH void Internals::terminateWebContentProcess()
void Internals::terminateWebContentProcess()
{
exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/testing/Internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ class Internals final : public RefCounted<Internals>, private ContextDestruction
void hasServiceWorkerRegistration(const String& clientURL, HasRegistrationPromise&&);
void terminateServiceWorker(ServiceWorker&, DOMPromiseDeferred<void>&&);
void whenServiceWorkerIsTerminated(ServiceWorker&, DOMPromiseDeferred<void>&&);
void terminateWebContentProcess();
NO_RETURN_DUE_TO_CRASH void terminateWebContentProcess();

#if ENABLE(APPLE_PAY)
MockPaymentCoordinator& mockPaymentCoordinator(Document&);
Expand Down
9 changes: 9 additions & 0 deletions Source/WebKit/Platform/IPC/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ template<typename T> struct ConnectionSendSyncResult {
bool succeeded() const { return value.has_value(); }
Error error() const { return value.has_value() ? Error::NoError : value.error(); }

// FIXME: Remove this when we start using c++23 and std::expected.
#if OS(WINDOWS) // Expected isn't move-constuctible
ConnectionSendSyncResult(ConnectionSendSyncResult&& other)
: value(makeUnexpected(Error::NoError))
{
value.swap(other.value);
}
#endif

typename T::ReplyArguments& reply()
{
return value.value();
Expand Down

0 comments on commit 3505bb0

Please sign in to comment.