Bug 997141 - Remove the recur parameter from nsIFile::Contains(). r=bsmedberg

This commit is contained in:
Igor Kolupaev 2014-05-07 23:03:41 +03:00
Родитель 3d81d33195
Коммит 89db128641
7 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -1633,7 +1633,7 @@ GetPluginIsFromExtension(const nsCOMPtr<nsIFile>& pluginFile,
{ {
for (uint32_t i = 0; i < extensionDirs.Length(); ++i) { for (uint32_t i = 0; i < extensionDirs.Length(); ++i) {
bool contains; bool contains;
if (NS_FAILED(extensionDirs[i]->Contains(pluginFile, true, &contains)) || !contains) { if (NS_FAILED(extensionDirs[i]->Contains(pluginFile, &contains)) || !contains) {
continue; continue;
} }

Просмотреть файл

@ -2021,14 +2021,14 @@ NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI,
bool allowed = false; bool allowed = false;
nsresult rv = sourceFile->IsDirectory(&sourceIsDir); nsresult rv = sourceFile->IsDirectory(&sourceIsDir);
if (NS_SUCCEEDED(rv) && sourceIsDir) { if (NS_SUCCEEDED(rv) && sourceIsDir) {
rv = sourceFile->Contains(targetFile, true, &allowed); rv = sourceFile->Contains(targetFile, &allowed);
} else { } else {
nsCOMPtr<nsIFile> sourceParent; nsCOMPtr<nsIFile> sourceParent;
rv = sourceFile->GetParent(getter_AddRefs(sourceParent)); rv = sourceFile->GetParent(getter_AddRefs(sourceParent));
if (NS_SUCCEEDED(rv) && sourceParent) { if (NS_SUCCEEDED(rv) && sourceParent) {
rv = sourceParent->Equals(targetFile, &allowed); rv = sourceParent->Equals(targetFile, &allowed);
if (NS_FAILED(rv) || !allowed) { if (NS_FAILED(rv) || !allowed) {
rv = sourceParent->Contains(targetFile, true, &allowed); rv = sourceParent->Contains(targetFile, &allowed);
} else { } else {
MOZ_ASSERT(aAllowDirectoryTarget, MOZ_ASSERT(aAllowDirectoryTarget,
"sourceFile->Parent == targetFile, but targetFile " "sourceFile->Parent == targetFile, but targetFile "

Просмотреть файл

@ -435,9 +435,9 @@ RemoteOpenFileChild::Equals(nsIFile *inFile, bool *_retval)
} }
NS_IMETHODIMP NS_IMETHODIMP
RemoteOpenFileChild::Contains(nsIFile *inFile, bool recur, bool *_retval) RemoteOpenFileChild::Contains(nsIFile *inFile, bool *_retval)
{ {
return mFile->Contains(inFile, recur, _retval); return mFile->Contains(inFile, _retval);
} }
NS_IMETHODIMP NS_IMETHODIMP

Просмотреть файл

@ -745,7 +745,7 @@ nsToolkitProfileService::CreateProfileInternal(nsIFile* aRootDir,
nsCOMPtr<nsIFile> localDir; nsCOMPtr<nsIFile> localDir;
bool isRelative; bool isRelative;
rv = mAppData->Contains(rootDir, true, &isRelative); rv = mAppData->Contains(rootDir, &isRelative);
if (NS_SUCCEEDED(rv) && isRelative) { if (NS_SUCCEEDED(rv) && isRelative) {
nsAutoCString path; nsAutoCString path;
rv = rootDir->GetRelativeDescriptor(mAppData, path); rv = rootDir->GetRelativeDescriptor(mAppData, path);
@ -912,7 +912,7 @@ nsToolkitProfileService::Flush()
while (cur) { while (cur) {
// if the profile dir is relative to appdir... // if the profile dir is relative to appdir...
bool isRelative; bool isRelative;
rv = mAppData->Contains(cur->mRootDir, true, &isRelative); rv = mAppData->Contains(cur->mRootDir, &isRelative);
if (NS_SUCCEEDED(rv) && isRelative) { if (NS_SUCCEEDED(rv) && isRelative) {
// we use a relative descriptor // we use a relative descriptor
rv = cur->mRootDir->GetRelativeDescriptor(mAppData, path); rv = cur->mRootDir->GetRelativeDescriptor(mAppData, path);

Просмотреть файл

@ -42,7 +42,7 @@ interface nsISimpleEnumerator;
* be safely passed to javascript via xpconnect. Therefore, the "native * be safely passed to javascript via xpconnect. Therefore, the "native
* methods" are not scriptable. * methods" are not scriptable.
*/ */
[scriptable, uuid(a99a6a06-f90d-4659-8fce-c2f87feb1167), builtinclass] [scriptable, uuid(dfb5a307-7ecf-41dd-aee2-f1d623459c44), builtinclass]
interface nsIFile : nsISupports interface nsIFile : nsISupports
{ {
/** /**
@ -311,10 +311,10 @@ interface nsIFile : nsISupports
boolean equals(in nsIFile inFile); boolean equals(in nsIFile inFile);
/** /**
* Will determine if inFile is a descendant of this file * Will determine if inFile is a descendant of this file.
* If |recur| is true, look in subdirectories too * This routine looks in subdirectories too.
*/ */
boolean contains(in nsIFile inFile, in boolean recur); boolean contains(in nsIFile inFile);
/** /**
* Parent will be null when this is at the top of the volume. * Parent will be null when this is at the top of the volume.

Просмотреть файл

@ -1597,7 +1597,7 @@ nsLocalFile::Equals(nsIFile *inFile, bool *_retval)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval) nsLocalFile::Contains(nsIFile *inFile, bool *_retval)
{ {
CHECK_mPath(); CHECK_mPath();
if (NS_WARN_IF(!inFile)) if (NS_WARN_IF(!inFile))

Просмотреть файл

@ -3024,7 +3024,7 @@ nsLocalFile::Equals(nsIFile *inFile, bool *_retval)
NS_IMETHODIMP NS_IMETHODIMP
nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval) nsLocalFile::Contains(nsIFile *inFile, bool *_retval)
{ {
// Check we are correctly initialized. // Check we are correctly initialized.
CHECK_mWorkingPath(); CHECK_mWorkingPath();