Bug 759416 - Backout API change part 2. r=dougt
authorDoug Turner <dougt@dougt.org>
Fri, 17 Aug 2012 19:43:00 -0700
changeset 102703 6d5892177f44dbee1349b42bb5a3d64ff6bdcde6
parent 102702 edc8f91fd74726856fb791c9a363986bc95f17d7
child 102704 c7934a5efa2cb5e5994c86eb893a55f5f13e39dc
push id23303
push userryanvm@gmail.com
push dateSat, 18 Aug 2012 11:22:19 +0000
treeherdermozilla-central@9c48df21d744 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs759416
milestone17.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 759416 - Backout API change part 2. r=dougt
xpcom/io/nsIFile.idl
xpcom/io/nsLocalFileCommon.cpp
--- a/xpcom/io/nsIFile.idl
+++ b/xpcom/io/nsIFile.idl
@@ -11,32 +11,31 @@
 #include <stdio.h>
 %}
 
 [ptr] native PRFileDescStar(PRFileDesc);
 [ptr] native PRLibraryStar(PRLibrary);
 [ptr] native FILE(FILE);
 
 interface nsISimpleEnumerator;
-interface nsIFileUpdateListener;
 
 /**
  * This is the only correct cross-platform way to specify a file.
  * Strings are not such a way. If you grew up on windows or unix, you
  * may think they are.  Welcome to reality.
  *
  * 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(9117c043-c01b-487a-a7ad-32cb350b0971), builtinclass]
+[scriptable, uuid(272a5020-64f5-485c-a8c4-44b2882ae0a2), builtinclass]
 interface nsIFile : nsISupports
 {
     /**
      *  Create Types
      *
      *  NORMAL_FILE_TYPE - A normal file.
      *  DIRECTORY_TYPE   - A directory/folder.
      */
@@ -443,71 +442,15 @@ interface nsIFile : nsISupports
      *  a string returned by getRelativeDescriptor.
      *
      *   @param fromFile
      *       the file to which the descriptor is relative
      *   @param relative
      *       the relative descriptor obtained from getRelativeDescriptor
      */
     void setRelativeDescriptor(in nsIFile fromFile, in ACString relativeDesc);    
-
-    /**
-     *  watch
-     *
-     *  Watches this file for changes, or if this nsIFile is a
-     *  directory, watch for changes in its children recursively, not
-     *  dereferencing symlinks.  Multiple listeners can be installed
-     *  at once, and all will be called when any appropriate changes
-     *  are made.  If a child directory is created, that directory
-     *  will automatically be watched. If the file is a symlink to a
-     *  directory or another file, the target will be watched for
-     *  changes, not the link.
-     *
-     *  @param listener
-     *      The listener to call out to when the file updates.
-     *      Updated will be recieved on the main thread.
-     *
-     *  @return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST if the file
-     *          doesn't exist, NS_NOT_AVAILABLE if there is an
-     *          out-of-memory or other resource failure, NS_OK
-     *          otherwise.
-     */
-    void watch(in nsIFileUpdateListener listener);
-
-    /**
-     *
-     *  unwatch
-     *
-     *  Removes the watch using the given listener from the file.
-     *  After this function terminates, no more requests will call the
-     *  given listener.
-     *
-     *  @param listener
-     *      the listener to stop calling out to
-     *
-     *  @return NS_ERROR_ILLEGAL_VALUE if the file is not being
-     *          watched with the given listener, NS_OK otherwise.
-     */
-    void unwatch(in nsIFileUpdateListener listener);
-};
-
-[scriptable, uuid(8968aaba-0f95-436c-8baf-7092ccaa814c), function]
-interface nsIFileUpdateListener : nsISupports
-{
-    /**
-     *  update
-     *
-     *  This function will be called whenever there is an update to be
-     *  processed.
-     *
-     *  @param type
-     *      The type of update that occured (one of "created" "deleted" "modified" or "unknown").
-     *  @param file
-     *      The file which has updated
-     */
-    void update(in string type, in nsIFile file);
 };
 
 %{C++
 #ifdef MOZILLA_INTERNAL_API
 #include "nsDirectoryServiceUtils.h"
 #endif
 %}
--- a/xpcom/io/nsLocalFileCommon.cpp
+++ b/xpcom/io/nsLocalFileCommon.cpp
@@ -8,22 +8,22 @@
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsReadableUtils.h"
 #include "nsPrintfCString.h"
 #include "nsCRT.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsUTF8Utils.h"
-#include "nsThreadUtils.h"
 
 #ifdef XP_WIN
 #include <string.h>
 #endif
 
+
 void NS_StartupLocalFile()
 {
     nsLocalFile::GlobalInit();
 }
 
 void NS_ShutdownLocalFile()
 {
     nsLocalFile::GlobalShutdown();
@@ -283,22 +283,8 @@ nsLocalFile::SetRelativeDescriptor(nsIFi
       targetFile->Append(NS_ConvertUTF8toUTF16(Substring(nodeBegin, nodeEnd)));
       if (nodeEnd != strEnd) // If there's more left in the string, inc over the '/' nodeEnd is on.
         ++nodeEnd;
       nodeBegin = nodeEnd;
     }
 
     return InitWithFile(targetFile);
 }
-
-NS_IMETHODIMP
-nsLocalFile::Watch(nsIFileUpdateListener *listener)
-{
-    NS_ASSERTION(NS_IsMainThread(), "Watch must be called from main thread!");
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsLocalFile::Unwatch(nsIFileUpdateListener *listener)
-{
-    NS_ASSERTION(NS_IsMainThread(), "Unwatch must be called from main thread!");
-    return NS_ERROR_NOT_IMPLEMENTED;
-}