";
- msg << "Message: " << error_text;
- msg << "
";
- msg << "Code: " << status;
+ msg << "Error message: " << error_text;
+ msg << "
"; + msg << "Error URL: " << error_url << ""; + msg << "
";
+ msg << "Error code: " << status;
mCEFLib->showBrowserMessage(msg.str());
}
@@ -607,7 +616,12 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mCEFLib->setOnTooltipCallback(std::bind(&MediaPluginCEF::onTooltipCallback, this, std::placeholders::_1));
mCEFLib->setOnLoadStartCallback(std::bind(&MediaPluginCEF::onLoadStartCallback, this));
mCEFLib->setOnLoadEndCallback(std::bind(&MediaPluginCEF::onLoadEndCallback, this, std::placeholders::_1, std::placeholders::_2));
- mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2));
+
+ // CEF 139 seems to have introduced a loading failure at the login page (only?) I haven't seen it on
+ // any other page and it only happens about 1 in 8 times. Without this handler for the error page
+ // (red box, error message/code/url) the page load recovers after display a brief built in error.
+ // Not ideal but better than stopping altgoether. Will restore this once I discover the error.
+ //mCEFLib->setOnLoadErrorCallback(std::bind(&MediaPluginCEF::onLoadError, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
mCEFLib->setOnAddressChangeCallback(std::bind(&MediaPluginCEF::onAddressChangeCallback, this, std::placeholders::_1));
mCEFLib->setOnOpenPopupCallback(std::bind(&MediaPluginCEF::onOpenPopupCallback, this, std::placeholders::_1, std::placeholders::_2));
mCEFLib->setOnHTTPAuthCallback(std::bind(&MediaPluginCEF::onHTTPAuthCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
@@ -729,17 +743,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
{
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 28b40543e9b..f7168598dcc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -4411,6 +4411,9 @@ bool LLAppViewer::initCache()
const U32 CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS = 128;
LLVOCache::getInstance()->initCache(LL_PATH_CACHE, CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS, getObjectCacheVersion());
+ // Remove old, stale CEF cache folders
+ purgeCefStaleCaches();
+
return true;
}
@@ -4435,18 +4438,27 @@ void LLAppViewer::loadKeyBindings()
LLUrlRegistry::instance().setKeybindingHandler(&gViewerInput);
}
+// As per GHI #4498, remove old, stale CEF cache folders from previous sessions
+void LLAppViewer::purgeCefStaleCaches()
+{
+ // TODO: we really shouldn't use a hard coded name for the cache folder here...
+ const std::string browser_parent_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache");
+ if (LLFile::isdir(browser_parent_cache))
+ {
+ // This is a sledgehammer approach - nukes the cef_cache dir entirely
+ // which is then recreated the first time a CEF instance creates an
+ // individual cache folder. If we ever decide to retain some folders
+ // e.g. Search UI cache - then we will need a more granular approach.
+ gDirUtilp->deleteDirAndContents(browser_parent_cache);
+ }
+}
+
void LLAppViewer::purgeCache()
{
LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL;
LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
LLVOCache::getInstance()->removeCache(LL_PATH_CACHE);
LLViewerShaderMgr::instance()->clearShaderCache();
- std::string browser_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache");
- if (LLFile::isdir(browser_cache))
- {
- // cef does not support clear_cache and clear_cookies, so clear what we can manually.
- gDirUtilp->deleteDirAndContents(browser_cache);
- }
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*");
}
diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h
index 14e96afe94a..918300f6e59 100644
--- a/indra/newview/llappviewer.h
+++ b/indra/newview/llappviewer.h
@@ -220,6 +220,7 @@ class LLAppViewer : public LLApp
void initGeneralThread();
void purgeUserDataOnExit() { mPurgeUserDataOnExit = true; }
+ void purgeCefStaleCaches(); // Remove old, stale CEF cache folders
void purgeCache(); // Clear the local cache.
void purgeCacheImmediate(); //clear local cache immediately.
S32 updateTextureThreads(F32 max_time);
diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml
index 2e1dfa00c7a..53796f09591 100644
--- a/indra/newview/skins/default/xui/en/floater_web_content.xml
+++ b/indra/newview/skins/default/xui/en/floater_web_content.xml
@@ -178,7 +178,7 @@
width="22">