From c808d849aa6aa17db95a7814e6eb6bc5162ba816 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 16 May 2024 02:29:52 +0300 Subject: adjust the flag to be untrusted block/allow/throttle --- indra/llui/llmenugl.h | 8 ++++---- indra/llui/lluictrl.h | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 1dcf79d02c..a906663d0e 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -950,17 +950,17 @@ public: LLUICtrl::EnableCallbackRegistry::currentRegistrar().add(name, boost::bind(&view_listener_t::handleEvent, listener, _2)); } - static void addCommit(view_listener_t* listener, const std::string& name, bool allow_untrusted = false) + static void addCommit(view_listener_t *listener, const std::string &name, LLUICtrl::LLCommitCallbackInfo::EUntrustedCall handle_untrusted = LLUICtrl::LLCommitCallbackInfo::UNTRUSTED_BLOCK) { LLUICtrl::SharedCommitCallbackRegistry::currentRegistrar().add(name, - LLUICtrl::LLCommitCallbackInfo(boost::bind(&view_listener_t::handleEvent, listener, _2), allow_untrusted)); + LLUICtrl::LLCommitCallbackInfo(boost::bind(&view_listener_t::handleEvent, listener, _2), handle_untrusted)); } - static void addMenu(view_listener_t* listener, const std::string& name, bool allow_untrusted = true) + static void addMenu(view_listener_t *listener, const std::string &name, LLUICtrl::LLCommitCallbackInfo::EUntrustedCall handle_untrusted = LLUICtrl::LLCommitCallbackInfo::UNTRUSTED_BLOCK) { // For now, add to both click and enable registries addEnable(listener, name); - addCommit(listener, name, allow_untrusted); + addCommit(listener, name, handle_untrusted); } static void cleanup() diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 5039d3e22c..ca8b66cfca 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -285,13 +285,20 @@ public: struct LLCommitCallbackInfo { - LLCommitCallbackInfo(commit_callback_t func = NULL, bool allow_untrusted = false) - : callback_func(func), mAllowUntrusted(allow_untrusted) + enum EUntrustedCall + { + UNTRUSTED_ALLOW, + UNTRUSTED_BLOCK, + UNTRUSTED_THROTTLE + }; + + LLCommitCallbackInfo(commit_callback_t func = NULL, EUntrustedCall handle_untrusted = UNTRUSTED_ALLOW) + : callback_func(func), mHandleUntrusted(handle_untrusted) {} public: - bool mAllowUntrusted; - commit_callback_t callback_func; + EUntrustedCall mHandleUntrusted; + commit_callback_t callback_func; }; class SharedCommitCallbackRegistry : public CallbackRegistry -- cgit v1.2.3