diff options
| author | Callum Prentice <callum@lindenlab.com> | 2025-08-07 15:28:48 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2025-08-07 15:28:48 -0700 |
| commit | 356b682f617c708c08de9f87b6f25e7683e701fb (patch) | |
| tree | 85af56d748f7de5e74cbd8f2dc04ace70600f7ae /indra/media_plugins/cef | |
| parent | 819817f5c9cebad353f5b86996b5426095dd73b8 (diff) | |
First part of work for #4498. This change forces each CEF instance to have it's own cache/cookie folder underneath the parent cef_cache folder. The whole cef_cache folder structure is purged at startup (before the parent being created at the first media instance creation)
Diffstat (limited to 'indra/media_plugins/cef')
| -rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 64fc7e452b..a96187119e 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -38,6 +38,13 @@ #include "volume_catcher.h" #include "media_plugin_base.h" +// _getpid()/getpid() +#if LL_WINDOWS +#include <process.h> +#else +#include <unistd.h> +#endif + #include "dullahan.h" //////////////////////////////////////////////////////////////////////////////// @@ -729,17 +736,34 @@ void MediaPluginCEF::receiveMessage(const char* message_string) std::string user_data_path_cache = message_in.getValue("cache_path"); std::string subfolder = message_in.getValue("username"); - mRootCachePath = user_data_path_cache + "cef_cache"; - if (!subfolder.empty()) - { - std::string delim; + // media plugin doesn't have access to gDirUtilp + std::string path_separator; #if LL_WINDOWS - // media plugin doesn't have access to gDirUtilp - delim = "\\"; + path_separator = "\\"; #else - delim = "/"; + path_separator = "/"; #endif - mCachePath = mRootCachePath + delim + subfolder; + + mRootCachePath = user_data_path_cache + "cef_cache"; + + // Issue #4498 Introduce an additional sub-folder underneath the main cache + // folder so that each CEF media instance gets its own (as per the CEF API + // official position). These folders will be removed at startup by Viewer code + // so that their non-trivial size does not exhaust available disk space. This + // begs the question - why turn on the cache at all? There are 2 reasons - firstly + // some of the instances will benefit from per Viewer session caching and will + // use the injected SL cookie and secondly, it's not clear how having no cache + // interacts with the multiple simultaneous paradigm we use. + mRootCachePath += path_separator; +# if LL_WINDOWS + mRootCachePath += std::to_string(_getpid()); +# else + mRootCachePath += std::to_string(getpid()); +# endif + + if (!subfolder.empty()) + { + mCachePath = mRootCachePath + path_separator + subfolder; } else { |
