MAINT-5775 FIX Split out cookies and cache directories into separate folders and move cache to same place as viewer cache

master
callum_linden 2015-10-22 13:24:43 -07:00
parent 8c74ed2a58
commit 16cd296e30
4 changed files with 17 additions and 15 deletions

View File

@ -827,10 +827,11 @@ void LLPluginClassMedia::paste()
sendMessage(message);
}
void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path)
void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache, const std::string &user_data_path_cookies)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path");
message.setValue("path", user_data_path);
message.setValue("cache_path", user_data_path_cache);
message.setValue("cookies_path", user_data_path_cookies);
sendMessage(message);
}

View File

@ -193,7 +193,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);
void setUserDataPath(const std::string &user_data_path_cache, const std::string &user_data_path_cookies);
void setLanguageCode(const std::string &language_code);
void setPluginsEnabled(const bool enabled);
void setJavascriptEnabled(const bool enabled);

View File

@ -432,9 +432,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
}
else if (message_name == "set_user_data_path")
{
std::string user_data_path = message_in.getValue("path"); // n.b. always has trailing platform-specific dir-delimiter
mCachePath = user_data_path + "cef_cache";
mCookiePath = user_data_path + "cef_cookies";
std::string user_data_path_cache = message_in.getValue("cache_path");
std::string user_data_path_cookies = message_in.getValue("cookies_path");
mCachePath = user_data_path_cache + "cef_cache";
mCookiePath = user_data_path_cookies + "cef_cookies";
}
else if (message_name == "size_change")
{

View File

@ -286,11 +286,7 @@ public:
const LLIOPipe::buffer_ptr_t& buffer)
{
const std::string url = getURL();
llinfos << "@@@ URL to set cookie on" << url << llendl;
// We don't care about the content of the response, only the Set-Cookie header.
llinfos << dumpResponse()
<< " [headers:" << getResponseHeaders() << "]" << llendl;
const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
// *TODO: What about bad status codes? Does this destroy previous cookies?
@ -1870,8 +1866,12 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
{
std::string launcher_name = gDirUtilp->getLLPluginLauncher();
std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
std::string user_data_path = gDirUtilp->getOSUserAppDir();
user_data_path += gDirUtilp->getDirDelimiter();
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();
// 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
@ -1882,8 +1882,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
if ( ! linden_user_dir.empty() )
{
// gDirUtilp->getLindenUserDir() is whole path, not just Linden name
user_data_path = linden_user_dir;
user_data_path += gDirUtilp->getDirDelimiter();
user_data_path_cookies = linden_user_dir;
user_data_path_cookies += gDirUtilp->getDirDelimiter();
};
// See if the plugin executable exists
@ -1900,7 +1900,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);
media_source->setUserDataPath(user_data_path_cache, user_data_path_cookies);
media_source->setLanguageCode(LLUI::getLanguage());
// collect 'cookies enabled' setting from prefs and send to embedded browser