Bug 239643
Summary: | Add a smart pointer to hold JSValueProtect() objects | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kimmo Kinnunen <kkinnunen> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=239495 |
Kimmo Kinnunen
Add a smart pointer to hold JSValueProtect() objects
From bug 239495
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kimmo Kinnunen
Bugs like
void setWheelEventMonitorTestCallbackAndStartMonitoring(bool expectWheelEndOrCancel, bool expectMomentumEnd, WebCore::Frame& frame, JSContextRef context, JSObjectRef jsCallbackFunction)
{
Page* page = frame.page();
if (!page || !page->isMonitoringWheelEvents())
return;
JSValueProtect(context, jsCallbackFunction);
if (auto wheelEventTestMonitor = page->wheelEventTestMonitor()) {
wheelEventTestMonitor->setTestCallbackAndStartMonitoring(expectWheelEndOrCancel, expectMomentumEnd, [=](void) {
JSObjectCallAsFunction(context, jsCallbackFunction, nullptr, 0, nullptr, nullptr);
JSValueUnprotect(context, jsCallbackFunction);
});
}
}
Radar WebKit Bug Importer
<rdar://problem/92513529>