Bug 1375125 - Remove nsILocalFile. r=froydnj

MozReview-Commit-ID: 6oU6Ya5UXtC
This commit is contained in:
Masatoshi Kimura
2017-08-05 09:43:49 +09:00
parent 2e32b0cc41
commit 012500cff8
15 changed files with 19 additions and 49 deletions

View File

@@ -13,7 +13,7 @@
#include "mozilla/UniquePtr.h"
#include "nsClassHashtable.h"
#include "nsDataHashtable.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIObserverService.h"
#include "nsProxyRelease.h"
#include "nsTArray.h"
@@ -458,7 +458,7 @@ NativeFileWatcherIOTask::RunInternal()
nsAutoString resourceName(notificationInfo->FileName,
notificationInfo->FileNameLength / sizeof(WCHAR));
// Handle path normalisation using nsILocalFile.
// Handle path normalisation using nsIFile.
nsString resourcePath;
nsresult rv = MakeResourcePath(changedRes, resourceName, resourcePath);
if (NS_SUCCEEDED(rv)) {
@@ -1165,14 +1165,14 @@ NativeFileWatcherIOTask::RemoveCallbacksFromHashtables(
/**
* Creates a string representing the native path for the changed resource.
* It appends the resource name to the path of the changed descriptor by
* using nsILocalFile.
* using nsIFile.
* @param changedDescriptor
* The descriptor of the watched resource.
* @param resourceName
* The resource which triggered the change.
* @param nativeResourcePath
* The full path to the changed resource.
* @return NS_OK if nsILocalFile succeeded in building the path.
* @return NS_OK if nsIFile succeeded in building the path.
*/
nsresult
NativeFileWatcherIOTask::MakeResourcePath(
@@ -1180,18 +1180,18 @@ NativeFileWatcherIOTask::MakeResourcePath(
const nsAString& resourceName,
nsAString& nativeResourcePath)
{
nsCOMPtr<nsILocalFile>
nsCOMPtr<nsIFile>
localPath(do_CreateInstance("@mozilla.org/file/local;1"));
if (!localPath) {
FILEWATCHERLOG(
"NativeFileWatcherIOTask::MakeResourcePath - Failed to create a nsILocalFile instance.");
"NativeFileWatcherIOTask::MakeResourcePath - Failed to create a nsIFile instance.");
return NS_ERROR_FAILURE;
}
nsresult rv = localPath->InitWithPath(changedDescriptor->mPath);
if (NS_FAILED(rv)) {
FILEWATCHERLOG(
"NativeFileWatcherIOTask::MakeResourcePath - Failed to init nsILocalFile with %S (%x).",
"NativeFileWatcherIOTask::MakeResourcePath - Failed to init nsIFile with %S (%x).",
changedDescriptor->mPath.get(), rv);
return rv;
}
@@ -1207,7 +1207,7 @@ NativeFileWatcherIOTask::MakeResourcePath(
rv = localPath->GetPath(nativeResourcePath);
if (NS_FAILED(rv)) {
FILEWATCHERLOG(
"NativeFileWatcherIOTask::MakeResourcePath - Failed to get native path from nsILocalFile (%x).",
"NativeFileWatcherIOTask::MakeResourcePath - Failed to get native path from nsIFile (%x).",
rv);
return rv;
}