Make nsSharable[C]String writable by overriding appropriate methods. Ensure that it doesn't store null buffer handle pointer internally, and override get() on nsXPIDL[C]String for backwards-compatibility. Collapse nsSharedBufferHandle and nsFlexBufferHandle into nsSharedBufferHandle which knows its length but can't have a storage start distinct from its data start. Convert string users who were working around broken nsSharableString::Assign back to using it. b=104663, 100751, 74726 r=jag sr=scc

git-svn-id: svn://10.0.0.236/trunk@109114 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2001-11-28 05:22:57 +00:00
parent 4ae66f30c3
commit c0b306795b
35 changed files with 1368 additions and 425 deletions

View File

@@ -265,8 +265,7 @@ nsLocalFile::InitWithPath(const char *filePath)
ssize_t len = strlen(filePath);
while (filePath[len-1] == '/' && len > 1)
--len;
// XXXldb change to |Assign| rather than |Adopt(ToNewCString|
mPath.Adopt(ToNewCString(Substring(filePath, filePath+len)));
mPath.Assign(Substring(filePath, filePath+len));
InvalidateCache();
return NS_OK;
@@ -439,8 +438,8 @@ nsLocalFile::AppendRelativePath(const char *fragment)
if (*fragment == '/')
return NS_ERROR_FILE_UNRECOGNIZED_PATH;
mPath.Adopt(ToNewCString(mPath + NS_LITERAL_CSTRING("/") +
nsDependentCString(fragment)));
mPath.Assign(mPath + NS_LITERAL_CSTRING("/") +
nsDependentCString(fragment));
if (!mPath.get())
return NS_ERROR_OUT_OF_MEMORY;