mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 14:46:02 +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
@ -318,10 +318,18 @@ NS_IMETHODIMP nsImapUrl::SetImapMiscellaneousSink(nsIImapMiscellaneousSink *
|
||||
|
||||
NS_IMETHODIMP nsImapUrl::SetSpec(const char * aSpec)
|
||||
{
|
||||
nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = ParseUrl();
|
||||
return rv;
|
||||
nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = ParseUrl();
|
||||
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()
|
||||
|
@ -57,18 +57,19 @@ class nsImapUrl : public nsIImapUrl, public nsMsgMailNewsUrl, public nsIMsgMessa
|
||||
{
|
||||
public:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIURI override
|
||||
NS_IMETHOD SetSpec(const char * aSpec);
|
||||
// nsIURI override
|
||||
NS_IMETHOD SetSpec(const char * aSpec);
|
||||
NS_IMETHOD SetQuery(const char * aQuery);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// we support the nsIImapUrl interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// we support the nsIImapUrl interface
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
NS_DECL_NSIIMAPURL
|
||||
|
||||
// nsIMsgMailNewsUrl overrides
|
||||
NS_IMETHOD IsUrlType(PRUint32 type, PRBool *isType);
|
||||
NS_IMETHOD IsUrlType(PRUint32 type, PRBool *isType);
|
||||
NS_IMETHOD SetMsgWindow(nsIMsgWindow *aMsgWindow);
|
||||
|
||||
// nsIMsgMessageUrl
|
||||
|
@ -419,10 +419,18 @@ nsresult nsMailboxUrl::ParseUrl()
|
||||
|
||||
NS_IMETHODIMP nsMailboxUrl::SetSpec(const char * aSpec)
|
||||
{
|
||||
nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = ParseUrl();
|
||||
return rv;
|
||||
nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = ParseUrl();
|
||||
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
|
||||
|
@ -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