Bug 997141 - Remove the recur parameter from nsIFile::Contains(). r=bsmedberg
authorIgor Kolupaev <ikolupaev@gmail.com>
Wed, 07 May 2014 23:03:41 +0300
changeset 182267 07b29d7938d33eaa6a86be843833cff40cb3158b
parent 182266 4486d2c281db4e662518a380f560bac7d85d3c55
child 182268 9c041bdfb8decf57e4b15ce6877b93eae18a657d
push id26755
push usercbook@mozilla.com
push dateFri, 09 May 2014 11:54:47 +0000
treeherdermozilla-central@5700a88f895f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs997141
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997141 - Remove the recur parameter from nsIFile::Contains(). r=bsmedberg
dom/plugins/base/nsPluginHost.cpp
netwerk/base/public/nsNetUtil.h
netwerk/ipc/RemoteOpenFileChild.cpp
toolkit/profile/nsToolkitProfileService.cpp
xpcom/io/nsIFile.idl
xpcom/io/nsLocalFileUnix.cpp
xpcom/io/nsLocalFileWin.cpp
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -1628,17 +1628,17 @@ int64_t GetPluginLastModifiedTime(const 
 }
 
 bool
 GetPluginIsFromExtension(const nsCOMPtr<nsIFile>& pluginFile,
                          const nsCOMArray<nsIFile>& extensionDirs)
 {
   for (uint32_t i = 0; i < extensionDirs.Length(); ++i) {
     bool contains;
-    if (NS_FAILED(extensionDirs[i]->Contains(pluginFile, true, &contains)) || !contains) {
+    if (NS_FAILED(extensionDirs[i]->Contains(pluginFile, &contains)) || !contains) {
       continue;
     }
 
     return true;
   }
 
   return false;
 }
--- a/netwerk/base/public/nsNetUtil.h
+++ b/netwerk/base/public/nsNetUtil.h
@@ -2016,24 +2016,24 @@ NS_RelaxStrictFileOriginPolicy(nsIURI *a
   // If the file to be loaded is in a subdirectory of the source
   // (or same-dir if source is not a directory) then it will
   // inherit its source principal and be scriptable by that source.
   //
   bool sourceIsDir;
   bool allowed = false;
   nsresult rv = sourceFile->IsDirectory(&sourceIsDir);
   if (NS_SUCCEEDED(rv) && sourceIsDir) {
-    rv = sourceFile->Contains(targetFile, true, &allowed);
+    rv = sourceFile->Contains(targetFile, &allowed);
   } else {
     nsCOMPtr<nsIFile> sourceParent;
     rv = sourceFile->GetParent(getter_AddRefs(sourceParent));
     if (NS_SUCCEEDED(rv) && sourceParent) {
       rv = sourceParent->Equals(targetFile, &allowed);
       if (NS_FAILED(rv) || !allowed) {
-        rv = sourceParent->Contains(targetFile, true, &allowed);
+        rv = sourceParent->Contains(targetFile, &allowed);
       } else {
         MOZ_ASSERT(aAllowDirectoryTarget,
                    "sourceFile->Parent == targetFile, but targetFile "
                    "should've been disallowed if it is a directory");
       }
     }
   }
 
--- a/netwerk/ipc/RemoteOpenFileChild.cpp
+++ b/netwerk/ipc/RemoteOpenFileChild.cpp
@@ -430,19 +430,19 @@ RemoteOpenFileChild::GetNativePath(nsACS
 
 NS_IMETHODIMP
 RemoteOpenFileChild::Equals(nsIFile *inFile, bool *_retval)
 {
   return mFile->Equals(inFile, _retval);
 }
 
 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
 RemoteOpenFileChild::GetParent(nsIFile **aParent)
 {
   return mFile->GetParent(aParent);
 }
 
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -740,17 +740,17 @@ nsToolkitProfileService::CreateProfileIn
         } else {
             rootDir->Append(NS_ConvertUTF8toUTF16(dirName));
         }
     }
 
     nsCOMPtr<nsIFile> localDir;
 
     bool isRelative;
-    rv = mAppData->Contains(rootDir, true, &isRelative);
+    rv = mAppData->Contains(rootDir, &isRelative);
     if (NS_SUCCEEDED(rv) && isRelative) {
         nsAutoCString path;
         rv = rootDir->GetRelativeDescriptor(mAppData, path);
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = NS_NewNativeLocalFile(EmptyCString(), true,
                                    getter_AddRefs(localDir));
         NS_ENSURE_SUCCESS(rv, rv);
@@ -907,17 +907,17 @@ nsToolkitProfileService::Flush()
 
     nsAutoCString path;
     cur = mFirst;
     pCount = 0;
 
     while (cur) {
         // if the profile dir is relative to appdir...
         bool isRelative;
-        rv = mAppData->Contains(cur->mRootDir, true, &isRelative);
+        rv = mAppData->Contains(cur->mRootDir, &isRelative);
         if (NS_SUCCEEDED(rv) && isRelative) {
             // we use a relative descriptor
             rv = cur->mRootDir->GetRelativeDescriptor(mAppData, path);
         } else {
             // otherwise, a persistent descriptor
             rv = cur->mRootDir->GetPersistentDescriptor(path);
             NS_ENSURE_SUCCESS(rv, rv);
         }
--- a/xpcom/io/nsIFile.idl
+++ b/xpcom/io/nsIFile.idl
@@ -37,17 +37,17 @@ interface nsISimpleEnumerator;
  * All methods with string parameters have two forms.  The preferred
  * form operates on UCS-2 encoded characters strings.  An alternate
  * form operates on characters strings encoded in the "native" charset.
  *
  * A string containing characters encoded in the native charset cannot
  * be safely passed to javascript via xpconnect.  Therefore, the "native
  * methods" are not scriptable.
  */
-[scriptable, uuid(a99a6a06-f90d-4659-8fce-c2f87feb1167), builtinclass]
+[scriptable, uuid(dfb5a307-7ecf-41dd-aee2-f1d623459c44), builtinclass]
 interface nsIFile : nsISupports
 {
     /**
      *  Create Types
      *
      *  NORMAL_FILE_TYPE - A normal file.
      *  DIRECTORY_TYPE   - A directory/folder.
      */
@@ -306,20 +306,20 @@ interface nsIFile : nsISupports
     nsIFile clone();
 
     /**
      *  Will determine if the inFile equals this.
      */
     boolean equals(in nsIFile inFile);
 
     /**
-     *  Will determine if inFile is a descendant of this file
-     *  If |recur| is true, look in subdirectories too
+     *  Will determine if inFile is a descendant of this file.
+     *  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.
      */
     readonly attribute nsIFile parent;
     
     /**
      *  Returns an enumeration of the elements in a directory. Each
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1592,17 +1592,17 @@ nsLocalFile::Equals(nsIFile *inFile, boo
 
   // We don't need to worry about "/foo/" vs. "/foo" here
   // because trailing slashes are stripped on init.
   *_retval = !strcmp(inPath.get(), mPath.get());
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval)
+nsLocalFile::Contains(nsIFile *inFile, bool *_retval)
 {
   CHECK_mPath();
   if (NS_WARN_IF(!inFile))
     return NS_ERROR_INVALID_ARG;
   if (NS_WARN_IF(!_retval))
     return NS_ERROR_INVALID_ARG;
 
   nsAutoCString inPath;
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -3019,17 +3019,17 @@ nsLocalFile::Equals(nsIFile *inFile, boo
   // Ok : Win9x
   *_retval = _wcsicmp(mShortWorkingPath.get(), inFilePath.get()) == 0;
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsLocalFile::Contains(nsIFile *inFile, bool recur, bool *_retval)
+nsLocalFile::Contains(nsIFile *inFile, bool *_retval)
 {
   // Check we are correctly initialized.
   CHECK_mWorkingPath();
 
   *_retval = false;
 
   nsAutoString myFilePath;
   if (NS_FAILED(GetTarget(myFilePath)))