diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-07-16 18:50:20 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-07-17 19:00:58 +0300 |
commit | 383352c61c5e20bdd7fe4be31bc227cfb62c4bc6 (patch) | |
tree | c896c5a0d0ec1399e9504ee2f09ec7e98c48f526 | |
parent | 117dfd9855428150258b56074d24f5ad386fbbef (diff) |
SL-13567 Users should have separate CEF contexts
-rw-r--r-- | autobuild.xml | 14 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmedia.cpp | 6 | ||||
-rw-r--r-- | indra/llplugin/llpluginclassmedia.h | 2 | ||||
-rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 17 |
5 files changed, 34 insertions, 29 deletions
diff --git a/autobuild.xml b/autobuild.xml index 0f71472d1f..d1bb617982 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ <key>archive</key> <map> <key>hash</key> - <string>350866eec6be17ffc265904b91dcfe6b</string> + <string>a6af5d12440c2ec4d15d268dae5c017a</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60900/572290/dullahan-1.7.0.202005311125_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-543086.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/63772/599587/dullahan-1.7.0.202007170815_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-545143.tar.bz2</string> </map> <key>name</key> <string>darwin64</string> @@ -592,9 +592,9 @@ <key>archive</key> <map> <key>hash</key> - <string>aa4faf9ef9057362d63f8d57092506b3</string> + <string>1f1c8b2850da982dfa876cb9b55707d7</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60902/572301/dullahan-1.7.0.202005311828_81.3.10_gb223419_chromium-81.0.4044.138-windows-543086.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/63774/599578/dullahan-1.7.0.202007171514_81.3.10_gb223419_chromium-81.0.4044.138-windows-545143.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -604,16 +604,16 @@ <key>archive</key> <map> <key>hash</key> - <string>6e29ea2ccdad80dcf1b5dc974932c1f6</string> + <string>73bce404b3a8c4f252eeca4400c4bc19</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60901/572302/dullahan-1.7.0.202005311828_81.3.10_gb223419_chromium-81.0.4044.138-windows64-543086.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/63773/599579/dullahan-1.7.0.202007171514_81.3.10_gb223419_chromium-81.0.4044.138-windows64-545143.tar.bz2</string> </map> <key>name</key> <string>windows64</string> </map> </map> <key>version</key> - <string>1.7.0.202005311828_81.3.10_gb223419_chromium-81.0.4044.138</string> + <string>1.7.0.202007171514_81.3.10_gb223419_chromium-81.0.4044.138</string> </map> <key>elfio</key> <map> diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 58069afdf9..6d51adc685 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -857,12 +857,12 @@ void LLPluginClassMedia::paste() } void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, - const std::string &user_data_path_cookies, + const std::string &username, const std::string &user_data_path_cef_log) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path"); - message.setValue("cache_path", user_data_path_cache); - message.setValue("cookies_path", user_data_path_cookies); + message.setValue("cache_path", user_data_path_cache); + message.setValue("username", username); // cef shares cache between users but creates user-based contexts message.setValue("cef_log_file", user_data_path_cef_log); bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 9d11ee0421..382f891e0c 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -195,7 +195,7 @@ public: bool canPaste() const { return mCanPaste; }; // These can be called before init(), and they will be queued and sent before the media init message. - void setUserDataPath(const std::string &user_data_path_cache, const std::string &user_data_path_cookies, const std::string &user_data_path_cef_log); + void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log); void setLanguageCode(const std::string &language_code); void setPluginsEnabled(const bool enabled); void setJavascriptEnabled(const bool enabled); diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index bc967c9bca..9cddf5b481 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -98,7 +98,9 @@ private: bool mCanCut; bool mCanCopy; bool mCanPaste; + std::string mRootCachePath; std::string mCachePath; + std::string mContextCachePath; std::string mCefLogFile; bool mCefLogVerbose; std::vector<std::string> mPickedFiles; @@ -527,7 +529,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.accept_language_list = mHostLanguage; settings.background_color = 0xffffffff; settings.cache_enabled = true; + settings.root_cache_path = mRootCachePath; settings.cache_path = mCachePath; + settings.context_cache_path = mContextCachePath; settings.cookies_enabled = mCookiesEnabled; settings.disable_gpu = mDisableGPU; #if LL_DARWIN @@ -583,9 +587,25 @@ void MediaPluginCEF::receiveMessage(const char* message_string) else if (message_name == "set_user_data_path") { std::string user_data_path_cache = message_in.getValue("cache_path"); - std::string user_data_path_cookies = message_in.getValue("cookies_path"); + std::string subfolder = message_in.getValue("username"); - mCachePath = user_data_path_cache + "cef_cache"; + mRootCachePath = user_data_path_cache + "cef_cache"; + if (!subfolder.empty()) + { + std::string delim; +#if LL_WINDOWS + // media plugin doesn't have access to gDirUtilp + delim = "\\"; +#else + delim = "/"; +#endif + mCachePath = mRootCachePath + delim + subfolder; + } + else + { + mCachePath = mRootCachePath; + } + mContextCachePath = ""; // disabled by "" mCefLogFile = message_in.getValue("cef_log_file"); mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log"); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ed5dff1600..df7460aae2 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1719,23 +1719,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ std::string user_data_path_cache = gDirUtilp->getCacheDir(false); user_data_path_cache += gDirUtilp->getDirDelimiter(); - std::string user_data_path_cookies = gDirUtilp->getOSUserAppDir(); - user_data_path_cookies += gDirUtilp->getDirDelimiter(); - std::string user_data_path_cef_log = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "cef_log.txt"); - // Fix for EXT-5960 - make browser profile specific to user (cache, cookies etc.) - // If the linden username returned is blank, that can only mean we are - // at the login page displaying login Web page or Web browser test via Develop menu. - // In this case we just use whatever gDirUtilp->getOSUserAppDir() gives us (this - // is what we always used before this change) - std::string linden_user_dir = gDirUtilp->getLindenUserDir(); - if ( ! linden_user_dir.empty() ) - { - user_data_path_cookies = linden_user_dir; - user_data_path_cookies += gDirUtilp->getDirDelimiter(); - }; - // See if the plugin executable exists llstat s; if(LLFile::stat(launcher_name, &s)) @@ -1752,7 +1737,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ { media_source = new LLPluginClassMedia(owner); media_source->setSize(default_width, default_height); - media_source->setUserDataPath(user_data_path_cache, user_data_path_cookies, user_data_path_cef_log); + media_source->setUserDataPath(user_data_path_cache, gDirUtilp->getUserName(), user_data_path_cef_log); media_source->setLanguageCode(LLUI::getLanguage()); media_source->setZoomFactor(zoom_factor); |