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

@@ -7,7 +7,7 @@
#include "nsCOMPtr.h"
#include "mozilla/dom/File.h"
#include "mozilla/UniquePtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "Layers.h"
#include "ImageContainer.h"
#include "ImageTypes.h"

View File

@@ -8,7 +8,7 @@
#include "nsXULAppAPI.h"
#include "nsPrefBranch.h"
#include "nsILocalFile.h" // nsILocalFile used for backwards compatibility
#include "nsIFile.h"
#include "nsIObserverService.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
@@ -350,8 +350,7 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID &
return rv;
}
// also check nsILocalFile, for backwards compatibility
if (aType.Equals(NS_GET_IID(nsIFile)) || aType.Equals(NS_GET_IID(nsILocalFile))) {
if (aType.Equals(NS_GET_IID(nsIFile))) {
if (GetContentChild()) {
NS_ERROR("cannot get nsIFile pref from content process");
return NS_ERROR_NOT_AVAILABLE;
@@ -500,8 +499,7 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID &
nsresult rv = NS_NOINTERFACE;
// also check nsILocalFile, for backwards compatibility
if (aType.Equals(NS_GET_IID(nsIFile)) || aType.Equals(NS_GET_IID(nsILocalFile))) {
if (aType.Equals(NS_GET_IID(nsIFile))) {
nsCOMPtr<nsIFile> file = do_QueryInterface(aValue);
if (!file)
return NS_NOINTERFACE;

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;
}

View File

@@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsILocalFile.h"
#include "nsCRT.h"
#include "nsIFile.h"
#include "nsISupportsImpl.h"

View File

@@ -6,7 +6,6 @@
#ifndef nsCheckSummedOutputStream_h__
#define nsCheckSummedOutputStream_h__
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIOutputStream.h"
#include "nsICryptoHash.h"

View File

@@ -27,7 +27,6 @@ DECL_CLASS(nsIComponentManager);
DECL_CLASS(nsIComponentRegistrar);
DECL_CLASS(nsIServiceManager);
DECL_CLASS(nsIFile);
DECL_CLASS(nsILocalFile);
DECL_CLASS(nsIDirectoryServiceProvider);
DECL_CLASS(nsIMemory);
DECL_CLASS(nsIDebug2);

View File

@@ -19,7 +19,6 @@ XPIDL_SOURCES += [
'nsIInputStreamTee.idl',
'nsIIOUtil.idl',
'nsILineInputStream.idl',
'nsILocalFile.idl',
'nsILocalFileWin.idl',
'nsIMultiplexInputStream.idl',
'nsIObjectInputStream.idl',

View File

@@ -1,17 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIFile.idl"
/**
* An empty interface to provide backwards compatibility for existing code.
*
* @see nsIFile
*/
[scriptable, builtinclass, uuid(7ba8c6ba-2ce2-48b1-bd60-4c32aac35f9c)]
interface nsILocalFile : nsIFile
{
};

View File

@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsILocalFile.idl"
#include "nsIFile.idl"
%{C++
#include <Carbon/Carbon.h>
@@ -17,7 +17,7 @@
native CFURLRef(CFURLRef);
[scriptable, builtinclass, uuid(623eca5b-c25d-4e27-be5a-789a66c4b2f7)]
interface nsILocalFileMac : nsILocalFile
interface nsILocalFileMac : nsIFile
{
/**
* initWithCFURL

View File

@@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "nsILocalFile.idl"
#include "nsIFile.idl"
%{C++
struct PRFileDesc;
@@ -13,7 +13,7 @@ struct PRFileDesc;
[ptr] native PRFileDescStar(PRFileDesc);
[scriptable, builtinclass, uuid(e7a3a954-384b-4aeb-a5f7-55626b0de9be)]
interface nsILocalFileWin : nsILocalFile
interface nsILocalFileWin : nsIFile
{
/**
* initWithCommandLine

View File

@@ -36,7 +36,7 @@
// on this.
#include <errno.h>
#include "nsILocalFile.h"
#include "nsIFile.h"
#ifdef XP_WIN
#include "nsLocalFileWin.h"

View File

@@ -239,12 +239,10 @@ nsLocalFile::nsLocalFile(const nsLocalFile& aOther)
#ifdef MOZ_WIDGET_COCOA
NS_IMPL_ISUPPORTS(nsLocalFile,
nsILocalFileMac,
nsILocalFile,
nsIFile,
nsIHashable)
#else
NS_IMPL_ISUPPORTS(nsLocalFile,
nsILocalFile,
nsIFile,
nsIHashable)
#endif

View File

@@ -83,7 +83,7 @@ class nsLocalFile final
#ifdef MOZ_WIDGET_COCOA
: public nsILocalFileMac
#else
: public nsILocalFile
: public nsIFile
#endif
, public nsIHashable
{
@@ -98,7 +98,6 @@ public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIFILE
NS_DECL_NSILOCALFILE
#ifdef MOZ_WIDGET_COCOA
NS_DECL_NSILOCALFILEMAC
#endif

View File

@@ -963,7 +963,6 @@ nsLocalFile::nsLocalFileConstructor(nsISupports* aOuter, const nsIID& aIID,
//-----------------------------------------------------------------------------
NS_IMPL_ISUPPORTS(nsLocalFile,
nsILocalFile,
nsIFile,
nsILocalFileWin,
nsIHashable)
@@ -1115,7 +1114,7 @@ nsLocalFile::Resolve()
}
//-----------------------------------------------------------------------------
// nsLocalFile::nsIFile,nsILocalFile
// nsLocalFile::nsIFile
//-----------------------------------------------------------------------------
NS_IMETHODIMP

View File

@@ -44,9 +44,6 @@ public:
// nsIFile interface
NS_DECL_NSIFILE
// nsILocalFile interface
NS_DECL_NSILOCALFILE
// nsILocalFileWin interface
NS_DECL_NSILOCALFILEWIN