mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
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:
parent
f98251b194
commit
29c731c68e
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user