fix for performance bug #117864. implement SetQuery() on these derived classes and make it

so SetQuery() will reparse the url.  we need this because we call SetQuery()
after calling SetSpec() when quoting.  reparsing the url will set some internal state
that we use for the optimization of only quoting the body part of message,
instead of the whole message (attachments and all!)
r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2002-01-08 01:40:01 +00:00
Родитель f98251b194
Коммит 29c731c68e
4 изменённых файлов: 33 добавлений и 15 удалений

Просмотреть файл

@ -324,6 +324,14 @@ NS_IMETHODIMP nsImapUrl::SetSpec(const char * aSpec)
return rv;
}
NS_IMETHODIMP nsImapUrl::SetQuery(const char *aQuery)
{
nsresult rv = nsMsgMailNewsUrl::SetQuery(aQuery);
if (NS_SUCCEEDED(rv))
rv = ParseUrl();
return rv;
}
nsresult nsImapUrl::ParseUrl()
{
nsresult rv = NS_OK;

Просмотреть файл

@ -61,10 +61,11 @@ public:
// nsIURI override
NS_IMETHOD SetSpec(const char * aSpec);
NS_IMETHOD SetQuery(const char * aQuery);
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// we support the nsIImapUrl interface
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
NS_DECL_NSIIMAPURL
// nsIMsgMailNewsUrl overrides

Просмотреть файл

@ -425,6 +425,14 @@ NS_IMETHODIMP nsMailboxUrl::SetSpec(const char * aSpec)
return rv;
}
NS_IMETHODIMP nsMailboxUrl::SetQuery(const char *aQuery)
{
nsresult rv = nsMsgMailNewsUrl::SetQuery(aQuery);
if (NS_SUCCEEDED(rv))
rv = ParseUrl();
return rv;
}
// takes a string like ?messageID=fooo&number=MsgKey and returns a new string
// containing just the attribute value. i.e you could pass in this string with
// an attribute name of messageID and I'll return fooo. Use PR_Free to delete

Просмотреть файл

@ -51,6 +51,7 @@ class nsMailboxUrl : public nsIMailboxUrl, public nsMsgMailNewsUrl, public nsIMs
public:
// nsIURI over-ride...
NS_IMETHOD SetSpec(const char * aSpec);
NS_IMETHOD SetQuery(const char * aQuery);
// from nsIMailboxUrl:
NS_IMETHOD GetMessageHeader(nsIMsgDBHdr ** aMsgHdr);