mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
fixes bug 243250 "reduce size of nsStandardURL" r=biesi sr=bzbarsky
This commit is contained in:
parent
9e90372ecc
commit
d4c73f8d53
@ -277,10 +277,10 @@ nsSegmentEncoder::InitUnicodeEncoder()
|
||||
nsStandardURL::nsStandardURL(PRBool aSupportsFileURL)
|
||||
: mDefaultPort(-1)
|
||||
, mPort(-1)
|
||||
, mURLType(URLTYPE_STANDARD)
|
||||
, mHostA(nsnull)
|
||||
, mHostEncoding(eEncoding_ASCII)
|
||||
, mSpecEncoding(eEncoding_Unknown)
|
||||
, mURLType(URLTYPE_STANDARD)
|
||||
, mMutable(PR_TRUE)
|
||||
, mSupportsFileURL(aSupportsFileURL)
|
||||
{
|
||||
@ -1472,7 +1472,6 @@ nsStandardURL::Clone(nsIURI **result)
|
||||
if (!clone)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// XXX a copy-on-write string would be very nice here
|
||||
clone->mSpec = mSpec;
|
||||
clone->mDefaultPort = mDefaultPort;
|
||||
clone->mPort = mPort;
|
||||
@ -2370,8 +2369,10 @@ nsStandardURL::Read(nsIObjectInputStream *stream)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = stream->Read32(&mURLType);
|
||||
PRUint32 urlType;
|
||||
rv = stream->Read32(&urlType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
mURLType = urlType;
|
||||
switch (mURLType) {
|
||||
case URLTYPE_STANDARD:
|
||||
mParser = net_GetStdURLParser();
|
||||
|
@ -229,21 +229,21 @@ private:
|
||||
URLSegment mRef;
|
||||
|
||||
nsCString mOriginCharset;
|
||||
PRUint32 mURLType;
|
||||
nsCOMPtr<nsIURLParser> mParser;
|
||||
nsCOMPtr<nsIFile> mFile; // cached result for nsIFileURL::GetFile
|
||||
char *mHostA; // cached result for nsIURI::GetHostA
|
||||
|
||||
enum nsEncodingType {
|
||||
enum {
|
||||
eEncoding_Unknown,
|
||||
eEncoding_ASCII,
|
||||
eEncoding_UTF8
|
||||
};
|
||||
nsEncodingType mHostEncoding;
|
||||
nsEncodingType mSpecEncoding;
|
||||
|
||||
PRPackedBool mMutable; // nsIStandardURL::mutable
|
||||
PRPackedBool mSupportsFileURL; // QI to nsIFileURL?
|
||||
PRUint32 mHostEncoding : 2; // eEncoding_xxx
|
||||
PRUint32 mSpecEncoding : 2; // eEncoding_xxx
|
||||
PRUint32 mURLType : 2; // nsIStandardURL::URLTYPE_xxx
|
||||
PRUint32 mMutable : 1; // nsIStandardURL::mutable
|
||||
PRUint32 mSupportsFileURL : 1; // QI to nsIFileURL?
|
||||
|
||||
// global objects. don't use COMPtr as its destructor will cause a
|
||||
// coredump if we leak it.
|
||||
|
Loading…
Reference in New Issue
Block a user