Skip to content

Commit

Permalink
Build failure of AccessibilityNotificationHandler.cpp
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264207

Reviewed by Michael Catanzaro.

The constructor and destructor of AccessibilityNotificationHandler use methods
guarded by DEVELOPER_MODE.

* Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityNotificationHandler.cpp:
(WTR::AccessibilityNotificationHandler::AccessibilityNotificationHandler):
(WTR::AccessibilityNotificationHandler::~AccessibilityNotificationHandler):

Canonical link: https://commits.webkit.org/270333@main
  • Loading branch information
shivamidow committed Nov 7, 2023
1 parent 6880064 commit 0335988
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ AccessibilityNotificationHandler::AccessibilityNotificationHandler(JSValueRef ca
, m_element(element)
{
WKAccessibilityEnable();
#if ENABLE(DEVELOPER_MODE)
WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page());
JSContextRef jsContext = WKBundleFrameGetJavaScriptContext(mainFrame);
JSValueProtect(jsContext, m_callback);
Expand Down Expand Up @@ -89,15 +90,18 @@ AccessibilityNotificationHandler::AccessibilityNotificationHandler(JSValueRef ca
JSObjectCallAsFunction(jsContext, const_cast<JSObjectRef>(m_callback), 0, 3, arguments, 0);
}
});
#endif
}

AccessibilityNotificationHandler::~AccessibilityNotificationHandler()
{
#if ENABLE(DEVELOPER_MODE)
WebCore::AccessibilityAtspi::singleton().removeNotificationObserver(this);

WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::singleton().page()->page());
JSContextRef jsContext = WKBundleFrameGetJavaScriptContext(mainFrame);
JSValueUnprotect(jsContext, m_callback);
#endif
}

} // namespace WTR
Expand Down

0 comments on commit 0335988

Please sign in to comment.