RAPTOR ONLY CHECKIN

network/module/nsIURL.h
Added Get/Set ReloadType methods so a user can query/set the reload type for the url. The default is normal reload.

network/module/nsURL.cpp
Added support for the new nsIURL interface methods (Get/Set ReloadType).

network/module/nsNetService.cpp
OpenStream and OpenBlockingStream now query the nsIURL for it's reload type before creating the url struct. This way we can control how the url is loaded.


git-svn-id: svn://10.0.0.236/trunk@8210 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
1998-08-19 23:00:15 +00:00
parent fe7799e863
commit b4d5c7e4ce
3 changed files with 59 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ public:
virtual PRBool operator==(const nsIURL& aURL) const;
virtual nsresult Set(const char *aNewSpec);
virtual nsresult SetReloadType(const PRInt32 type);
virtual const char* GetProtocol() const;
virtual const char* GetHost() const;
@@ -57,6 +58,7 @@ public:
virtual const char* GetSpec() const;
virtual PRInt32 GetPort() const;
virtual nsISupports* GetContainer() const;
virtual PRInt32 GetReloadType() const;
virtual void ToString(nsString& aString) const;
@@ -67,6 +69,12 @@ public:
char* mRef;
char* mSearch;
nsISupports* mContainer;
// The reload type can be set to one of the following.
// 0 - normal reload (uses cache) (defined as nsReload in nsIWebShell.h)
// 1 - bypass the cache (defined as nsReloadBypassCache)
// 2 - bypass the proxy (not yet implemented) (defined as nsReloadBypassProxy)
PRInt32 mReloadType;
PRInt32 mPort;
PRBool mOK;
@@ -89,6 +97,7 @@ URLImpl::URLImpl(const nsString& aSpec)
mPort = -1;
mSpec = nsnull;
mContainer = nsnull;
mReloadType = 0;
ParseURL(nsnull, aSpec);
}
@@ -128,6 +137,7 @@ URLImpl::URLImpl(const nsIURL* aURL, const nsString& aSpec)
mPort = -1;
mSpec = nsnull;
mContainer = nsnull;
mReloadType = 0;
ParseURL(aURL, aSpec);
}
@@ -181,6 +191,14 @@ nsresult URLImpl::Set(const char *aNewSpec)
return ParseURL(nsnull, aNewSpec);
}
nsresult URLImpl::SetReloadType(const PRInt32 type)
{
if ( !((type >= 0) && (type <= 2)) )
return NS_ERROR_ILLEGAL_VALUE;
mReloadType = type;
return NS_OK;
}
PRBool URLImpl::operator==(const nsIURL& aURL) const
{
@@ -230,6 +248,11 @@ nsISupports* URLImpl::GetContainer() const
return mContainer;
}
PRInt32 URLImpl::GetReloadType() const
{
return mReloadType;
}
void URLImpl::ToString(nsString& aString) const
{
aString.SetLength(0);