diff options
author | Cosmic Linden <cosmic@lindenlab.com> | 2022-05-23 16:29:39 -0700 |
---|---|---|
committer | Cosmic Linden <cosmic@lindenlab.com> | 2022-06-22 13:28:25 -0700 |
commit | b7ff4d316d646ffbcdfda3c8539d45433c55c5c9 (patch) | |
tree | b13a5e7bfed7f016a13ee3102b335ee504f99e63 /indra | |
parent | 1167ea994c44a2c45f68109325ae1862b0ca09c3 (diff) |
SL-17329: Add advanced developer menu button to purge the disk cache
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 30 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 12 |
2 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5b300e96c6..78783de6ac 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -53,6 +53,7 @@ #include "llcompilequeue.h" #include "llconsole.h" #include "lldebugview.h" +#include "lldiskcache.h" #include "llenvironment.h" #include "llfilepicker.h" #include "llfirstuse.h" @@ -2088,6 +2089,32 @@ class LLAdvancedDropPacket : public view_listener_t } }; +////////////////////// +// PURGE DISK CACHE // +////////////////////// + + +class LLAdvancedPurgeDiskCache : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop"); + LL::WorkQueue::ptr_t general_queue = LL::WorkQueue::getInstance("General"); + llassert_always(main_queue); + llassert_always(general_queue); + main_queue->postTo( + general_queue, + []() // Work done on general queue + { + LLDiskCache::getInstance()->purge(); + // Nothing needed to return + }, + [](){}); // Callback to main thread is empty as there is nothing left to do + + return true; + } +}; + //////////////////// // EVENT Recorder // @@ -9350,6 +9377,9 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedDisableMessageLog(), "Advanced.DisableMessageLog"); view_listener_t::addMenu(new LLAdvancedDropPacket(), "Advanced.DropPacket"); + // Advanced > Cache + view_listener_t::addMenu(new LLAdvancedPurgeDiskCache(), "Advanced.PurgeDiskCache"); + // Advanced > Recorder view_listener_t::addMenu(new LLAdvancedAgentPilot(), "Advanced.AgentPilot"); view_listener_t::addMenu(new LLAdvancedToggleAgentPilotLoop(), "Advanced.ToggleAgentPilotLoop"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 8d7cfe1116..cb3bbcfba0 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3326,6 +3326,18 @@ function="World.EnvPreset" function="Advanced.DropPacket" /> </menu_item_call> </menu> + <menu + create_jump_keys="true" + label="Cache" + name="Cache" + tear_off="true"> + <menu_item_call + label="Purge Disk Cache" + name="Purge Disk Cache"> + <menu_item_call.on_click + function="Advanced.PurgeDiskCache" /> + </menu_item_call> + </menu> <menu_item_call label="Dump Scripted Camera" name="Dump Scripted Camera"> |