summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-12-17 11:10:03 -0800
committerMonroe Linden <monroe@lindenlab.com>2009-12-17 11:10:03 -0800
commit1f377c6b53346b419df8874cfdf8bb4c33f7b6d5 (patch)
treea0ad729d329063101f0674ad5242de396ea9b83e /indra/newview
parent0084d969ae717bddb03bc4943e971d672b893733 (diff)
Made LLPanelLogin tell the browser plugin to clear its cache before opening the login screen.
Added clearCache() functions to LLViewerMediaImpl and LLMediaCtrl to facilitate this.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llmediactrl.cpp25
-rw-r--r--indra/newview/llmediactrl.h4
-rw-r--r--indra/newview/llpanellogin.cpp3
-rw-r--r--indra/newview/llviewermedia.cpp20
-rw-r--r--indra/newview/llviewermedia.h2
5 files changed, 52 insertions, 2 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index f32866b1fe..199bd966ef 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -95,7 +95,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mHidingInitialLoad (false),
mDecoupleTextureSize ( false ),
mTextureWidth ( 1024 ),
- mTextureHeight ( 1024 )
+ mTextureHeight ( 1024 ),
+ mClearCache(false)
{
{
LLColor4 color = p.caret_color().get();
@@ -491,6 +492,21 @@ void LLMediaCtrl::clr404RedirectUrl()
////////////////////////////////////////////////////////////////////////////////
//
+void LLMediaCtrl::clearCache()
+{
+ if(mMediaSource)
+ {
+ mMediaSource->clearCache();
+ }
+ else
+ {
+ mClearCache = true;
+ }
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type)
{
// don't browse to anything that starts with secondlife:// or sl://
@@ -617,7 +633,12 @@ bool LLMediaCtrl::ensureMediaSourceExists()
mMediaSource->setHomeURL(mHomePageUrl);
mMediaSource->setVisible( getVisible() );
mMediaSource->addObserver( this );
-
+ if(mClearCache)
+ {
+ mMediaSource->clearCache();
+ mClearCache = false;
+ }
+
if(mHideLoading)
{
mHidingInitialLoad = true;
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index f07513a3fd..8f9e6e7179 100644
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -117,6 +117,9 @@ public:
// set/clear URL to visit when a 404 page is reached
void set404RedirectUrl( std::string redirect_url );
void clr404RedirectUrl();
+
+ // Clear the browser cache when the instance gets loaded
+ void clearCache();
// accessor/mutator for flag that indicates if frequent updates to texture happen
bool getFrequentUpdates() { return mFrequentUpdates; };
@@ -192,6 +195,7 @@ public:
bool mDecoupleTextureSize;
S32 mTextureWidth;
S32 mTextureHeight;
+ bool mClearCache;
};
#endif // LL_LLMediaCtrl_H
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index a9c604b72a..dbe962ed59 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -272,6 +272,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// get the web browser control
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
+
+ // Clear the browser's cache to avoid any potential for the cache messing up the login screen.
+ web_browser->clearCache();
// Need to handle login secondlife:///app/ URLs
web_browser->setTrusted( true );
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 103a70e032..7bcc601705 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -929,6 +929,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mMimeTypeProbe(NULL),
mMediaAutoPlay(false),
mInNearbyMediaList(false),
+ mClearCache(false),
mIsUpdated(false)
{
@@ -1139,6 +1140,12 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
media_source->focus(mHasFocus);
+ if(mClearCache)
+ {
+ mClearCache = false;
+ media_source->clear_cache();
+ }
+
mMediaSource = media_source;
updateVolume();
@@ -1352,6 +1359,19 @@ std::string LLViewerMediaImpl::getCurrentMediaURL()
}
//////////////////////////////////////////////////////////////////////////////////////////
+void LLViewerMediaImpl::clearCache()
+{
+ if(mMediaSource)
+ {
+ mMediaSource->clear_cache();
+ }
+ else
+ {
+ mClearCache = true;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button)
{
scaleMouse(&x, &y);
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 7151186089..28fb379960 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -188,6 +188,7 @@ public:
std::string getCurrentMediaURL();
std::string getHomeURL() { return mHomeURL; }
void setHomeURL(const std::string& home_url) { mHomeURL = home_url; };
+ void clearCache();
std::string getMimeType() { return mMimeType; }
void scaleMouse(S32 *mouse_x, S32 *mouse_y);
void scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y);
@@ -355,6 +356,7 @@ public:
bool mMediaAutoPlay;
std::string mMediaEntryURL;
bool mInNearbyMediaList; // used by LLFloaterNearbyMedia::refreshList() for performance reasons
+ bool mClearCache;
private:
BOOL mIsUpdated ;