summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-05-16 02:29:52 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-05-16 02:29:52 +0300
commitc808d849aa6aa17db95a7814e6eb6bc5162ba816 (patch)
tree28a220037e72f5b5b302afbdb22af672456e2f95 /indra/llui
parent9f540f10e687bb3889de191afbae3b52cc21f415 (diff)
adjust the flag to be untrusted block/allow/throttle
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.h8
-rw-r--r--indra/llui/lluictrl.h15
2 files changed, 15 insertions, 8 deletions
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<LLCommitCallbackInfo, SharedCommitCallbackRegistry>