From 28e3190296f7d6791e6fd0297f9fcab10239648f Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 26 Mar 2010 16:19:34 -0700 Subject: Fix a couple of minor issues with the central cookie storage code. Made LLViewerMedia::clearAllCookies() delete the new per-user cookie file (userdir/plugin_cookies.txt) as well as the old one. Made LLViewerMedia::loadCookieFile() send the clear_cookies message to all loaded plugins. --- indra/newview/llviewermedia.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 8863bf187d..ab55fcff6e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1018,6 +1018,7 @@ void LLViewerMedia::clearAllCookies() // Places that cookie files can be: // /browser_profile/cookies // /first_last/browser_profile/cookies (note that there may be any number of these!) + // /first_last/plugin_cookies.txt (note that there may be any number of these!) std::string base_dir = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter(); std::string target; @@ -1050,6 +1051,16 @@ void LLViewerMedia::clearAllCookies() { LLFile::remove(target); } + + target = base_dir; + target += filename; + target += gDirUtilp->getDirDelimiter(); + target += PLUGIN_COOKIE_FILE_NAME; + lldebugs << "target = " << target << llendl; + if(LLFile::isfile(target)) + { + LLFile::remove(target); + } } @@ -1142,7 +1153,18 @@ void LLViewerMedia::loadCookieFile() file.close(); - // TODO: send the clear_cookies message to all loaded plugins + // send the clear_cookies message to all loaded plugins + impl_list::iterator iter = sViewerMediaImplList.begin(); + impl_list::iterator end = sViewerMediaImplList.end(); + for (; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; + if(pimpl->mMediaSource) + { + pimpl->mMediaSource->clear_cookies(); + } + } + } -- cgit v1.2.3