-
Notifications
You must be signed in to change notification settings - Fork 1.6k
IPC testing API is unable to reply with nullopt optional #29756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC testing API is unable to reply with nullopt optional #29756
Conversation
EWS run on previous version of this PR (hash 8ce77a9) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the commit message:
Decoding std::optional would return JSValue if the optional was
std::nullopt.
Is there a word missing?
8ce77a9
to
7a57230
Compare
EWS run on current version of this PR (hash 7a57230) |
https://bugs.webkit.org/show_bug.cgi?id=275409 rdar://129669346 Reviewed by Cameron McCormack. Decoding std::optional would return empty JSValue (JSValue()) if the optional was std::nullopt. This would be interpreted as a decoding failure. Fix this by returning the more natural value, jsUndefined value. Fix the result array construction to not use jsUndefined to signify that the value should be a array buffer containing the data. Use empty JSValue to signify this. Use exception scope to detect when JS exception would cancel the decoding as a decoding failure. Decoding failures would use the already cleared exception as the result JS object, causing a crash. Fix by first constructing the JS value, then clearing the exception from the scope. Add decoder for WebCore::ExceptionData, to be used in testing the message this problem was noted. * LayoutTests/ipc/async-with-reply-optional.html: Added. * Source/WebKit/Platform/IPC/JSIPCBinding.cpp: (IPC::jsValueForDecodedArgumentValue): (IPC::putJSValueForDecodedArgumentAtIndexOrArrayBufferIfUndefined): Deleted. * Source/WebKit/Platform/IPC/JSIPCBinding.h: (IPC::jsValueForDecodedArgumentValue): (IPC::putJSValueForDecodeArgumentInArray): * Source/WebKit/Shared/IPCTester.cpp: (WebKit::IPCTester::asyncOptionalExceptionData): * Source/WebKit/Shared/IPCTester.h: * Source/WebKit/Shared/IPCTester.messages.in: * Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp: (WebKit::IPCTestingAPI::jsSendWithAsyncReply): Canonical link: https://commits.webkit.org/279999@main
7a57230
to
8ebae84
Compare
Committed 279999@main (8ebae84): https://commits.webkit.org/279999@main Reviewed commits have been landed. Closing PR #29756 and removing active labels. |
8ebae84
7a57230
🧪 wpe-wk2🧪 wincairo-tests🧪 ios-wk2🧪 api-mac🧪 api-wpe🧪 ios-wk2-wpt🧪 mac-wk1🧪 api-ios🧪 mac-wk2🧪 mac-AS-debug-wk2🧪 gtk-wk2🧪 mac-wk2-stress🧪 api-gtk