Bug 759416 - Backout API change part 2. r=dougt

This commit is contained in:
Doug Turner 2012-08-17 19:43:00 -07:00
Родитель 2c5581b199
Коммит 09b892f270
2 изменённых файлов: 2 добавлений и 73 удалений

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

@ -16,7 +16,6 @@
[ptr] native FILE(FILE);
interface nsISimpleEnumerator;
interface nsIFileUpdateListener;
/**
* This is the only correct cross-platform way to specify a file.
@ -31,7 +30,7 @@ interface nsIFileUpdateListener;
* 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
{
/**
@ -448,62 +447,6 @@ interface nsIFile : nsISupports
* 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++

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

@ -13,12 +13,12 @@
#include "nsCRT.h"
#include "nsNativeCharsetUtils.h"
#include "nsUTF8Utils.h"
#include "nsThreadUtils.h"
#ifdef XP_WIN
#include <string.h>
#endif
void NS_StartupLocalFile()
{
nsLocalFile::GlobalInit();
@ -288,17 +288,3 @@ nsLocalFile::SetRelativeDescriptor(nsIFile *fromFile, const nsACString& relative
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;
}