mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Purging tabs, r+sr=darin
This commit is contained in:
parent
4ee83f7ab9
commit
06350119d4
@ -426,7 +426,7 @@ nsOnDataAvailableEvent::HandleEvent()
|
||||
mIStream, mSourceOffset, mLength);
|
||||
}
|
||||
else {
|
||||
NS_WARNING("not calling OnDataAvailable");
|
||||
NS_WARNING("not calling OnDataAvailable");
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ nsDirectoryIndexStream::Read(char* aBuf, PRUint32 aCount, PRUint32* aReadCount)
|
||||
|
||||
PRInt64 fileSize = LL_Zero();
|
||||
current->GetFileSize( &fileSize );
|
||||
|
||||
|
||||
PROffset32 fileInfoSize;
|
||||
LL_L2I( fileInfoSize,fileSize );
|
||||
|
||||
|
@ -489,7 +489,7 @@ nsIOService::SetOffline(PRBool offline)
|
||||
nsresult rv;
|
||||
if (offline) {
|
||||
NS_NAMED_LITERAL_STRING(offlineString, "offline");
|
||||
mOffline = PR_TRUE; // indicate we're trying to shutdown
|
||||
mOffline = PR_TRUE; // indicate we're trying to shutdown
|
||||
|
||||
// don't care if notification fails
|
||||
// this allows users to attempt a little cleanup before dns and socket transport are shut down.
|
||||
|
@ -2039,62 +2039,63 @@ nsStandardURL::SetFileName(const nsACString &input)
|
||||
}
|
||||
}
|
||||
else {
|
||||
nsresult rv;
|
||||
URLSegment basename, extension;
|
||||
nsresult rv;
|
||||
URLSegment basename, extension;
|
||||
|
||||
// let the parser locate the basename and extension
|
||||
rv = mParser->ParseFileName(filename, -1,
|
||||
&basename.mPos, &basename.mLen,
|
||||
&extension.mPos, &extension.mLen);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
// let the parser locate the basename and extension
|
||||
rv = mParser->ParseFileName(filename, -1,
|
||||
&basename.mPos, &basename.mLen,
|
||||
&extension.mPos, &extension.mLen);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (basename.mLen < 0) {
|
||||
// remove existing filename
|
||||
if (mBasename.mLen >= 0) {
|
||||
PRUint32 len = mBasename.mLen;
|
||||
if (mExtension.mLen >= 0)
|
||||
len += (mExtension.mLen + 1);
|
||||
mSpec.Cut(mBasename.mPos, len);
|
||||
shift = -PRInt32(len);
|
||||
mBasename.mLen = 0;
|
||||
mExtension.mLen = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nsCAutoString newFilename;
|
||||
if (basename.mLen < 0) {
|
||||
// remove existing filename
|
||||
if (mBasename.mLen >= 0) {
|
||||
PRUint32 len = mBasename.mLen;
|
||||
if (mExtension.mLen >= 0)
|
||||
len += (mExtension.mLen + 1);
|
||||
mSpec.Cut(mBasename.mPos, len);
|
||||
shift = -PRInt32(len);
|
||||
mBasename.mLen = 0;
|
||||
mExtension.mLen = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nsCAutoString newFilename;
|
||||
GET_SEGMENT_ENCODER(encoder);
|
||||
basename.mLen = encoder.EncodeSegmentCount(filename, basename,
|
||||
esc_FileBaseName |
|
||||
esc_AlwaysCopy,
|
||||
newFilename);
|
||||
if (extension.mLen >= 0) {
|
||||
newFilename.Append('.');
|
||||
if (extension.mLen >= 0) {
|
||||
newFilename.Append('.');
|
||||
extension.mLen = encoder.EncodeSegmentCount(filename, extension,
|
||||
esc_FileExtension|esc_AlwaysCopy,
|
||||
esc_FileExtension |
|
||||
esc_AlwaysCopy,
|
||||
newFilename);
|
||||
}
|
||||
}
|
||||
|
||||
if (mBasename.mLen < 0) {
|
||||
// insert new filename
|
||||
mBasename.mPos = mDirectory.mPos + mDirectory.mLen;
|
||||
mSpec.Insert(newFilename, mBasename.mPos);
|
||||
shift = newFilename.Length();
|
||||
}
|
||||
else {
|
||||
// replace existing filename
|
||||
PRUint32 oldLen = PRUint32(mBasename.mLen);
|
||||
if (mExtension.mLen >= 0)
|
||||
oldLen += (mExtension.mLen + 1);
|
||||
mSpec.Replace(mBasename.mPos, oldLen, newFilename);
|
||||
shift = newFilename.Length() - oldLen;
|
||||
}
|
||||
|
||||
mBasename.mLen = basename.mLen;
|
||||
mExtension.mLen = extension.mLen;
|
||||
if (mExtension.mLen >= 0)
|
||||
mExtension.mPos = mBasename.mPos + mBasename.mLen + 1;
|
||||
}
|
||||
}
|
||||
if (mBasename.mLen < 0) {
|
||||
// insert new filename
|
||||
mBasename.mPos = mDirectory.mPos + mDirectory.mLen;
|
||||
mSpec.Insert(newFilename, mBasename.mPos);
|
||||
shift = newFilename.Length();
|
||||
}
|
||||
else {
|
||||
// replace existing filename
|
||||
PRUint32 oldLen = PRUint32(mBasename.mLen);
|
||||
if (mExtension.mLen >= 0)
|
||||
oldLen += (mExtension.mLen + 1);
|
||||
mSpec.Replace(mBasename.mPos, oldLen, newFilename);
|
||||
shift = newFilename.Length() - oldLen;
|
||||
}
|
||||
|
||||
mBasename.mLen = basename.mLen;
|
||||
mExtension.mLen = extension.mLen;
|
||||
if (mExtension.mLen >= 0)
|
||||
mExtension.mPos = mBasename.mPos + mBasename.mLen + 1;
|
||||
}
|
||||
}
|
||||
if (shift) {
|
||||
ShiftFromParam(shift);
|
||||
mFilepath.mLen += shift;
|
||||
|
@ -117,9 +117,9 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
|
||||
|
||||
if (!directory.IsEmpty()) {
|
||||
NS_EscapeURL(directory, esc_Directory|esc_AlwaysCopy, path);
|
||||
if (path.Length() > 2 && path.CharAt(2) == '|')
|
||||
path.SetCharAt(':', 2);
|
||||
path.ReplaceChar('/', '\\');
|
||||
if (path.Length() > 2 && path.CharAt(2) == '|')
|
||||
path.SetCharAt(':', 2);
|
||||
path.ReplaceChar('/', '\\');
|
||||
}
|
||||
if (!fileBaseName.IsEmpty())
|
||||
NS_EscapeURL(fileBaseName, esc_FileBaseName|esc_AlwaysCopy, path);
|
||||
|
@ -544,7 +544,7 @@
|
||||
|
||||
#define NS_JARPROTOCOLHANDLER_CLASSNAME \
|
||||
"nsJarProtocolHandler"
|
||||
#define NS_JARPROTOCOLHANDLER_CID \
|
||||
#define NS_JARPROTOCOLHANDLER_CID \
|
||||
{ /* 0xc7e410d4-0x85f2-11d3-9f63-006008a6efe9 */ \
|
||||
0xc7e410d4, \
|
||||
0x85f2, \
|
||||
|
@ -797,12 +797,12 @@ static const nsModuleComponentInfo gNetModuleInfo[] = {
|
||||
nsBinHexDecoderConstructor
|
||||
},
|
||||
#endif
|
||||
// This is not a real stream converter, it's just
|
||||
// registering it's cid factory here.
|
||||
{ "HACK-TXTToHTMLConverter",
|
||||
MOZITXTTOHTMLCONV_CID,
|
||||
MOZ_TXTTOHTMLCONV_CONTRACTID,
|
||||
CreateNewTXTToHTMLConvFactory
|
||||
// This is not a real stream converter, it's just
|
||||
// registering its cid factory here.
|
||||
{ "HACK-TXTToHTMLConverter",
|
||||
MOZITXTTOHTMLCONV_CID,
|
||||
MOZ_TXTTOHTMLCONV_CONTRACTID,
|
||||
CreateNewTXTToHTMLConvFactory
|
||||
},
|
||||
|
||||
{ "Directory Index",
|
||||
|
14
netwerk/cache/src/nsCacheService.cpp
vendored
14
netwerk/cache/src/nsCacheService.cpp
vendored
@ -919,11 +919,11 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
|
||||
}
|
||||
|
||||
if (!entry) {
|
||||
if (! (request->AccessRequested() & nsICache::ACCESS_WRITE)) {
|
||||
// this is a READ-ONLY request
|
||||
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
|
||||
goto error;
|
||||
}
|
||||
if (! (request->AccessRequested() & nsICache::ACCESS_WRITE)) {
|
||||
// this is a READ-ONLY request
|
||||
rv = NS_ERROR_CACHE_KEY_NOT_FOUND;
|
||||
goto error;
|
||||
}
|
||||
|
||||
entry = new nsCacheEntry(request->mKey,
|
||||
request->IsStreamBased(),
|
||||
@ -1243,8 +1243,8 @@ nsCacheService::SetMemoryCacheCapacity(PRInt32 capacity)
|
||||
* If browser.cache.memory.capacity is negative or not present, we use a
|
||||
* formula that grows less than linearly with the amount of system memory.
|
||||
*
|
||||
* RAM Cache
|
||||
* --- -----
|
||||
* RAM Cache
|
||||
* --- -----
|
||||
* 32 Mb 2 Mb
|
||||
* 64 Mb 4 Mb
|
||||
* 128 Mb 8 Mb
|
||||
|
Loading…
Reference in New Issue
Block a user