зеркало из https://github.com/mozilla/gecko-dev.git
Bug 49813 "threadsafe" nsDirectoryIndexStream uses nsDirEnumeratorUnix triggering "not thread-safe" assertion
r=darin sr=darin
This commit is contained in:
Родитель
04585b8515
Коммит
4b3b30a355
|
@ -165,12 +165,10 @@ nsDirectoryIndexStream::Init(nsIFile* aDir)
|
|||
}
|
||||
#endif
|
||||
|
||||
mDir = aDir;
|
||||
|
||||
// Sigh. We have to allocate on the heap because there are no
|
||||
// assignment operators defined.
|
||||
nsCOMPtr<nsISimpleEnumerator> iter;
|
||||
rv = mDir->GetDirectoryEntries(getter_AddRefs(iter));
|
||||
rv = aDir->GetDirectoryEntries(getter_AddRefs(iter));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Now lets sort, because clients expect it that way
|
||||
|
@ -215,7 +213,7 @@ nsDirectoryIndexStream::Init(nsIFile* aDir)
|
|||
|
||||
mBuf.Append("300: ");
|
||||
nsCAutoString url;
|
||||
rv = net_GetURLSpecFromFile(mDir, url);
|
||||
rv = net_GetURLSpecFromFile(aDir, url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
mBuf.Append(url);
|
||||
mBuf.Append('\n');
|
||||
|
|
|
@ -51,7 +51,6 @@ protected:
|
|||
nsCAutoString mBuf;
|
||||
PRInt32 mOffset;
|
||||
|
||||
nsCOMPtr<nsIFile> mDir;
|
||||
PRInt32 mPos;
|
||||
nsVoidArray mArray;
|
||||
|
||||
|
@ -61,10 +60,16 @@ protected:
|
|||
nsCOMPtr<nsITextToSubURI> mTextToSubURI;
|
||||
|
||||
nsDirectoryIndexStream();
|
||||
/**
|
||||
* aDir will only be used on the calling thread.
|
||||
*/
|
||||
nsresult Init(nsIFile* aDir);
|
||||
virtual ~nsDirectoryIndexStream();
|
||||
|
||||
public:
|
||||
/**
|
||||
* aDir will only be used on the calling thread.
|
||||
*/
|
||||
static nsresult
|
||||
Create(nsIFile* aDir, nsIInputStream** aStreamResult);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче