This commit is contained in:
Geoff Lankow 2012-06-06 15:13:51 +12:00
Родитель aa5bee168f 5ee192b3ff
Коммит 2f85a7eea6
297 изменённых файлов: 1280 добавлений и 1406 удалений

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

@ -18,7 +18,7 @@
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsStringGlue.h"
#ifdef XP_WIN
@ -102,7 +102,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
static int do_main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsCOMPtr<nsIFile> appini;
nsresult rv;
// Allow firefox.exe to launch XULRunner apps via -app <application.ini>

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

@ -22,7 +22,7 @@
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsStringGlue.h"
#ifdef XP_WIN
@ -106,7 +106,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
static int do_main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsCOMPtr<nsIFile> appini;
nsresult rv;
// Allow firefox.exe to launch XULRunner apps via -app <application.ini>

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

@ -54,7 +54,7 @@ DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
nsCString path;
rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
if (NS_SUCCEEDED(rv)) {
NS_NewNativeLocalFile(path, true, (nsILocalFile**)(nsIFile**) getter_AddRefs(file));
NS_NewNativeLocalFile(path, true, getter_AddRefs(file));
}
}
}

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

@ -6,7 +6,7 @@
#include "nsISupports.idl"
interface nsIDOMElement;
interface nsILocalFile;
interface nsIFile;
[scriptable, uuid(bb477da4-dddf-4106-a562-f06c85c7f9a8)]
interface nsIShellService : nsISupports
@ -99,10 +99,10 @@ interface nsIShellService : nsISupports
* @param uri
* The uri to be loaded by the application
*/
void openApplicationWithURI(in nsILocalFile aApplication, in ACString aURI);
void openApplicationWithURI(in nsIFile aApplication, in ACString aURI);
/**
* The default system handler for web feeds
*/
readonly attribute nsILocalFile defaultFeedReader;
readonly attribute nsIFile defaultFeedReader;
};

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

@ -9,7 +9,7 @@
#include "nsGNOMEShellService.h"
#include "nsShellService.h"
#include "nsIServiceManager.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIProperties.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIPrefService.h"
@ -107,8 +107,8 @@ nsGNOMEShellService::Init()
(do_GetService("@mozilla.org/file/directory_service;1"));
NS_ENSURE_TRUE(dirSvc, NS_ERROR_NOT_AVAILABLE);
nsCOMPtr<nsILocalFile> appPath;
rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsILocalFile),
nsCOMPtr<nsIFile> appPath;
rv = dirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
getter_AddRefs(appPath));
NS_ENSURE_SUCCESS(rv, rv);
@ -641,7 +641,7 @@ nsGNOMEShellService::OpenApplication(PRInt32 aApplication)
}
NS_IMETHODIMP
nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
nsGNOMEShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI)
{
nsresult rv;
nsCOMPtr<nsIProcess> process =
@ -659,7 +659,7 @@ nsGNOMEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const ns
}
NS_IMETHODIMP
nsGNOMEShellService::GetDefaultFeedReader(nsILocalFile** _retval)
nsGNOMEShellService::GetDefaultFeedReader(nsIFile** _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

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

@ -167,7 +167,7 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement,
NS_ENSURE_SUCCESS(rv, rv);
// Get the current user's "Pictures" folder (That's ~/Pictures):
fileLocator->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsILocalFile),
fileLocator->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsIFile),
getter_AddRefs(mBackgroundFile));
if (!mBackgroundFile)
return NS_ERROR_OUT_OF_MEMORY;
@ -329,7 +329,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
break;
case nsIMacShellService::APPLICATION_NETWORK:
{
nsCOMPtr<nsILocalFile> lf;
nsCOMPtr<nsIFile> lf;
rv = NS_NewNativeLocalFile(NETWORK_PREFPANE, true, getter_AddRefs(lf));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
@ -341,7 +341,7 @@ nsMacShellService::OpenApplication(PRInt32 aApplication)
break;
case nsIMacShellService::APPLICATION_DESKTOP:
{
nsCOMPtr<nsILocalFile> lf;
nsCOMPtr<nsIFile> lf;
rv = NS_NewNativeLocalFile(DESKTOP_PREFPANE, true, getter_AddRefs(lf));
NS_ENSURE_SUCCESS(rv, rv);
bool exists;
@ -382,7 +382,7 @@ nsMacShellService::SetDesktopBackgroundColor(PRUint32 aColor)
}
NS_IMETHODIMP
nsMacShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
nsMacShellService::OpenApplicationWithURI(nsIFile* aApplication, const nsACString& aURI)
{
nsCOMPtr<nsILocalFileMac> lfm(do_QueryInterface(aApplication));
CFURLRef appURL;
@ -419,7 +419,7 @@ nsMacShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsAC
}
NS_IMETHODIMP
nsMacShellService::GetDefaultFeedReader(nsILocalFile** _retval)
nsMacShellService::GetDefaultFeedReader(nsIFile** _retval)
{
nsresult rv = NS_ERROR_FAILURE;
*_retval = nsnull;

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

@ -8,7 +8,7 @@
#include "nsIMacShellService.h"
#include "nsIWebProgressListener.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsCOMPtr.h"
class nsMacShellService : public nsIMacShellService,
@ -26,7 +26,7 @@ public:
protected:
private:
nsCOMPtr<nsILocalFile> mBackgroundFile;
nsCOMPtr<nsIFile> mBackgroundFile;
bool mCheckedThisSession;
};

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

@ -213,9 +213,9 @@ GetHelperPath(nsAutoString& aPath)
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILocalFile> appHelper;
nsCOMPtr<nsIFile> appHelper;
rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
NS_GET_IID(nsILocalFile),
NS_GET_IID(nsIFile),
getter_AddRefs(appHelper));
NS_ENSURE_SUCCESS(rv, rv);
@ -1042,7 +1042,7 @@ nsWindowsShellService::LaunchPrefetchClearCommand(nsITimer *aTimer, void*)
#endif
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,
const nsACString& aURI)
{
nsresult rv;
@ -1061,7 +1061,7 @@ nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
}
NS_IMETHODIMP
nsWindowsShellService::GetDefaultFeedReader(nsILocalFile** _retval)
nsWindowsShellService::GetDefaultFeedReader(nsIFile** _retval)
{
*_retval = nsnull;
@ -1090,7 +1090,7 @@ nsWindowsShellService::GetDefaultFeedReader(nsILocalFile** _retval)
path = Substring(path, 0, path.FindChar(' '));
}
nsCOMPtr<nsILocalFile> defaultReader =
nsCOMPtr<nsIFile> defaultReader =
do_CreateInstance("@mozilla.org/file/local;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -3,7 +3,9 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.
import automationutils
import threading
import os
import Queue
import re
import socket
import shutil
@ -13,6 +15,21 @@ import time
from automation import Automation
from devicemanager import DeviceManager, NetworkTools
from mozprocess import ProcessHandlerMixin
class LogcatProc(ProcessHandlerMixin):
"""Process handler for logcat which puts all output in a Queue.
"""
def __init__(self, cmd, queue, **kwargs):
self.queue = queue
kwargs.setdefault('processOutputLine', []).append(self.handle_output)
ProcessHandlerMixin.__init__(self, cmd, **kwargs)
def handle_output(self, line):
self.queue.put_nowait(line)
class B2GRemoteAutomation(Automation):
_devicemanager = None
@ -24,11 +41,15 @@ class B2GRemoteAutomation(Automation):
self._remoteProfile = None
self._remoteLog = remoteLog
self.marionette = marionette
self._is_emulator = False
# Default our product to b2g
self._product = "b2g"
Automation.__init__(self)
def setEmulator(self, is_emulator):
self._is_emulator = is_emulator
def setDeviceManager(self, deviceManager):
self._devicemanager = deviceManager
@ -51,6 +72,8 @@ class B2GRemoteAutomation(Automation):
if env is None:
env = {}
# We always hide the results table in B2G; it's much slower if we don't.
env['MOZ_HIDE_RESULTS_TABLE'] = '1'
return env
def checkForCrashes(self, directory, symbolsPath):
@ -119,6 +142,14 @@ class B2GRemoteAutomation(Automation):
return (serial, status)
def restartB2G(self):
self._devicemanager.checkCmd(['shell', 'stop', 'b2g'])
# Wait for a bit to make sure B2G has completely shut down.
time.sleep(5)
self._devicemanager.checkCmd(['shell', 'start', 'b2g'])
if self._is_emulator:
self.marionette.emulator.wait_for_port()
def rebootDevice(self):
# find device's current status and serial number
serial, status = self.getDeviceStatus()
@ -153,7 +184,10 @@ class B2GRemoteAutomation(Automation):
# XXX: We could potentially use 'stop b2g' + 'start b2g' to achieve
# a similar effect; will see which is more stable while attempting
# to bring up the continuous integration.
self.rebootDevice()
if self._is_emulator:
self.restartB2G()
else:
self.rebootDevice()
# Infrequently, gecko comes up before networking does, so wait a little
# bit to give the network time to become available.
@ -162,9 +196,10 @@ class B2GRemoteAutomation(Automation):
# Set up port forwarding again for Marionette, since any that
# existed previously got wiped out by the reboot.
self._devicemanager.checkCmd(['forward',
'tcp:%s' % self.marionette.port,
'tcp:%s' % self.marionette.port])
if not self._is_emulator:
self._devicemanager.checkCmd(['forward',
'tcp:%s' % self.marionette.port,
'tcp:%s' % self.marionette.port])
# start a marionette session
session = self.marionette.start_session()
@ -185,7 +220,26 @@ class B2GRemoteAutomation(Automation):
def __init__(self, dm):
self.dm = dm
self.lastloglines = []
self.logcat_proc = None
self.queue = Queue.Queue()
# Launch logcat in a separate thread, and dump all output lines
# into a queue. The lines in this queue are
# retrieved and returned by accessing the stdout property of
# this class.
cmd = [self.dm.adbPath]
if self.dm.deviceSerial:
cmd.extend(['-s', self.dm.deviceSerial])
cmd.append('logcat')
proc = threading.Thread(target=self._save_logcat_proc, args=(cmd, self.queue))
proc.daemon = True
proc.start()
def _save_logcat_proc(self, cmd, queue):
self.logcat_proc = LogcatProc(cmd, queue)
self.logcat_proc.run()
self.logcat_proc.waitForFinish()
self.logcat_proc = None
@property
def pid(self):
@ -194,33 +248,15 @@ class B2GRemoteAutomation(Automation):
@property
def stdout(self):
# Return any part of logcat output that wasn't returned
# previously. This is done by fetching about the last 50
# lines of the log (logcat -t 50 generally fetches 50-58 lines),
# and comparing against the previous set to find new lines.
t = self.dm.runCmd(['logcat', '-t', '50']).stdout.read()
if t == None: return ''
t = t.strip('\n').strip()
loglines = t.split('\n')
line_index = 0
# If there are more than 50 lines, we skip the first 20; this
# is because the number of lines returned
# by logcat -t 50 varies (usually between 50 and 58).
log_index = 20 if len(loglines) > 50 else 0
for index, line in enumerate(loglines[log_index:]):
line_index = index + log_index + 1
# Return any lines in the queue used by the
# logcat process handler.
lines = []
while True:
try:
self.lastloglines.index(line)
except ValueError:
lines.append(self.queue.get_nowait())
except Queue.Empty:
break
newoutput = '\n'.join(loglines[line_index:])
self.lastloglines = loglines
return newoutput
return '\n'.join(lines)
def wait(self, timeout = None):
# this should never happen

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

@ -32,7 +32,7 @@
#include "nsICommandLine.h"
#include "nsILocaleService.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIObserverService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"

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

@ -167,7 +167,7 @@ nsContentAreaDragDropDataProvider::SaveURIToFile(nsAString& inSourceURIString,
// that in AddStringsToDataTransfer.
//
// 2. Someone put a kFilePromiseDirectoryMime flavor into the
// transferable with an nsILocalFile for the directory we are to
// transferable with an nsIFile for the directory we are to
// save in. That has to be done by platform-specific code (in
// widget), which gets the destination directory from
// OS-specific drag information.
@ -218,7 +218,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
dataSize = 0;
aTransferable->GetTransferData(kFilePromiseDirectoryMime,
getter_AddRefs(dirPrimitive), &dataSize);
nsCOMPtr<nsILocalFile> destDirectory = do_QueryInterface(dirPrimitive);
nsCOMPtr<nsIFile> destDirectory = do_QueryInterface(dirPrimitive);
if (!destDirectory)
return NS_ERROR_FAILURE;
@ -229,7 +229,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
file->Append(targetFilename);
rv = SaveURIToFile(sourceURLString, file);
// send back an nsILocalFile
// send back an nsIFile
if (NS_SUCCEEDED(rv)) {
CallQueryInterface(file, aData);
*aDataLen = sizeof(nsIFile*);

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

@ -599,12 +599,8 @@ nsDOMFileFile::Initialize(nsISupports* aOwner,
return NS_ERROR_XPC_BAD_CONVERT_JS;
}
nsCOMPtr<nsILocalFile> localFile;
rv = NS_NewLocalFile(xpcomStr, false, getter_AddRefs(localFile));
rv = NS_NewLocalFile(xpcomStr, false, getter_AddRefs(file));
NS_ENSURE_SUCCESS(rv, rv);
file = do_QueryInterface(localFile);
NS_ASSERTION(file, "This should never happen");
}
bool exists;

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

@ -17,7 +17,6 @@
#include "nsAutoPtr.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsDOMFile.h"
class nsITransferable;

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

@ -66,7 +66,7 @@
#include "nsIRadioGroupContainer.h"
// input type=file
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include "nsDOMFile.h"
#include "nsIFilePicker.h"
@ -297,17 +297,14 @@ AsyncClickHandler::Run()
oldFiles[0]->GetMozFullPathInternal(path);
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = NS_NewLocalFile(path, false, getter_AddRefs(localFile));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIFile> parentFile;
rv = localFile->GetParent(getter_AddRefs(parentFile));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsILocalFile> parentLocalFile = do_QueryInterface(parentFile, &rv);
if (parentLocalFile) {
filePicker->SetDisplayDirectory(parentLocalFile);
}
filePicker->SetDisplayDirectory(parentFile);
}
}
@ -323,7 +320,7 @@ AsyncClickHandler::Run()
}
} else {
// Attempt to retrieve the last used directory from the content pref service
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
nsHTMLInputElement::gUploadLastDir->FetchLastUsedDirectory(doc->GetDocumentURI(),
getter_AddRefs(localFile));
if (!localFile) {
@ -358,7 +355,7 @@ AsyncClickHandler::Run()
bool loop = true;
while (NS_SUCCEEDED(iter->HasMoreElements(&loop)) && loop) {
iter->GetNext(getter_AddRefs(tmp));
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(tmp);
nsCOMPtr<nsIFile> localFile = do_QueryInterface(tmp);
if (localFile) {
nsString unicodePath;
rv = localFile->GetPath(unicodePath);
@ -377,7 +374,7 @@ AsyncClickHandler::Run()
}
}
else {
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = filePicker->GetFile(getter_AddRefs(localFile));
if (localFile) {
nsString unicodePath;
@ -430,7 +427,7 @@ nsHTMLInputElement::DestroyUploadLastDir() {
}
nsresult
UploadLastDir::FetchLastUsedDirectory(nsIURI* aURI, nsILocalFile** aFile)
UploadLastDir::FetchLastUsedDirectory(nsIURI* aURI, nsIFile** aFile)
{
NS_PRECONDITION(aURI, "aURI is null");
NS_PRECONDITION(aFile, "aFile is null");
@ -452,7 +449,7 @@ UploadLastDir::FetchLastUsedDirectory(nsIURI* aURI, nsILocalFile** aFile)
nsString prefStr;
pref->GetAsAString(prefStr);
nsCOMPtr<nsILocalFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
nsCOMPtr<nsIFile> localFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
if (!localFile)
return NS_ERROR_OUT_OF_MEMORY;
localFile->InitWithPath(prefStr);
@ -462,7 +459,7 @@ UploadLastDir::FetchLastUsedDirectory(nsIURI* aURI, nsILocalFile** aFile)
}
nsresult
UploadLastDir::StoreLastUsedDirectory(nsIURI* aURI, nsILocalFile* aFile)
UploadLastDir::StoreLastUsedDirectory(nsIURI* aURI, nsIFile* aFile)
{
NS_PRECONDITION(aURI, "aURI is null");
NS_PRECONDITION(aFile, "aFile is null");
@ -471,7 +468,6 @@ UploadLastDir::StoreLastUsedDirectory(nsIURI* aURI, nsILocalFile* aFile)
if (!parentFile) {
return NS_OK;
}
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(parentFile);
// Attempt to get the CPS, if it's not present we'll just return
nsCOMPtr<nsIContentPrefService> contentPrefService =
@ -1065,10 +1061,8 @@ nsHTMLInputElement::MozSetFileNameArray(const PRUnichar **aFileNames, PRUint32 a
if (!file) {
// this is no "file://", try as local file
nsCOMPtr<nsILocalFile> localFile;
NS_NewLocalFile(nsDependentString(aFileNames[i]),
false, getter_AddRefs(localFile));
file = do_QueryInterface(localFile);
false, getter_AddRefs(file));
}
if (file) {

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

@ -36,7 +36,7 @@ public:
* @param aURI URI of the current page
* @param aFile path to the last used directory
*/
nsresult FetchLastUsedDirectory(nsIURI* aURI, nsILocalFile** aFile);
nsresult FetchLastUsedDirectory(nsIURI* aURI, nsIFile** aFile);
/**
* Store the last used directory for this location using the
@ -45,7 +45,7 @@ public:
* @param aFile file chosen by the user - the path to the parent of this
* file will be stored
*/
nsresult StoreLastUsedDirectory(nsIURI* aURI, nsILocalFile* aFile);
nsresult StoreLastUsedDirectory(nsIURI* aURI, nsIFile* aFile);
};
class nsHTMLInputElement : public nsGenericHTMLFormElement,

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

@ -523,15 +523,12 @@ nsMediaCache::Init()
// In multi-process Gecko, there is no profile dir, so just store it in the
// system temp directory instead.
nsresult rv;
nsCOMPtr<nsIFile> tmp;
nsCOMPtr<nsIFile> tmpFile;
const char* dir = (XRE_GetProcessType() == GeckoProcessType_Content) ?
NS_OS_TEMP_DIR : NS_APP_USER_PROFILE_LOCAL_50_DIR;
rv = NS_GetSpecialDirectory(dir, getter_AddRefs(tmp));
rv = NS_GetSpecialDirectory(dir, getter_AddRefs(tmpFile));
NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsILocalFile> tmpFile = do_QueryInterface(tmp);
NS_ENSURE_TRUE(tmpFile != nsnull, NS_ERROR_FAILURE);
// We put the media cache file in
// ${TempDir}/mozilla-media-cache/media_cache
rv = tmpFile->AppendNative(nsDependentCString("mozilla-media-cache"));
@ -560,7 +557,7 @@ nsMediaCache::Init()
NS_ENSURE_SUCCESS(rv,rv);
PRFileDesc* fileDesc = nsnull;
rv = tmpFile->OpenNSPRFileDesc(PR_RDWR | nsILocalFile::DELETE_ON_CLOSE,
rv = tmpFile->OpenNSPRFileDesc(PR_RDWR | nsIFile::DELETE_ON_CLOSE,
PR_IRWXU, &fileDesc);
NS_ENSURE_SUCCESS(rv,rv);

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

@ -11,7 +11,7 @@
#include "nsCRT.h"
#include "nsIPlatformCharset.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#ifdef MOZ_TOOLKIT_SEARCH
#include "nsIBrowserSearchService.h"
@ -574,7 +574,7 @@ nsresult nsDefaultURIFixup::ConvertFileToStringURI(const nsACString& aIn,
// rejects bad file paths when using this code on a new
// platform.
nsCOMPtr<nsILocalFile> filePath;
nsCOMPtr<nsIFile> filePath;
nsresult rv;
// this is not the real fix but a temporary fix

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

@ -2222,16 +2222,6 @@ nsGlobalWindow::DetachFromDocShell()
nsGlobalWindow *currentInner = GetCurrentInnerWindowInternal();
if (currentInner) {
JSObject* obj = currentInner->FastGetGlobalJSObject();
if (obj) {
JSContext* cx = nsContentUtils::ThreadJSContextStack()->GetSafeJSContext();
JSAutoRequest ar(cx);
js::NukeChromeCrossCompartmentWrappersForGlobal(cx, obj,
js::NukeForGlobalObject);
}
NS_ASSERTION(mDoc, "Must have doc!");
// Remember the document's principal.

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

@ -5,7 +5,7 @@
#include "nsDeviceStorage.h"
#include "DOMRequest.h"
#include "nsServiceManagerUtils.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIDirectoryEnumerator.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIDOMFile.h"
@ -133,7 +133,7 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
{
PRInt32 typeResult = DEVICE_STORAGE_TYPE_DEFAULT;
nsCOMPtr<nsILocalFile> f;
nsCOMPtr<nsIFile> f;
nsCOMPtr<nsIProperties> dirService = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
NS_ASSERTION(dirService, "Must have directory service");
@ -149,11 +149,11 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {
dirService->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_OSX_PICTURE_DOCUMENTS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#elif defined (XP_UNIX)
if (aIndex == 0) {
dirService->Get(NS_UNIX_XDG_PICTURES_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_UNIX_XDG_PICTURES_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#endif
}
@ -170,11 +170,11 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {
dirService->Get(NS_OSX_MOVIE_DOCUMENTS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_OSX_MOVIE_DOCUMENTS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#elif defined (XP_UNIX)
if (aIndex == 0) {
dirService->Get(NS_UNIX_XDG_VIDEOS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_UNIX_XDG_VIDEOS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#endif
}
@ -191,11 +191,11 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
}
#elif defined (MOZ_WIDGET_COCOA)
if (aIndex == 0) {
dirService->Get(NS_OSX_MUSIC_DOCUMENTS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_OSX_MUSIC_DOCUMENTS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#elif defined (XP_UNIX)
if (aIndex == 0) {
dirService->Get(NS_UNIX_XDG_MUSIC_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_UNIX_XDG_MUSIC_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
#endif
}
@ -205,12 +205,12 @@ nsDOMDeviceStorage::SetRootFileForType(const nsAString& aType, const PRInt32 aIn
// Temp directory
if (aType.Equals(NS_LITERAL_STRING("temp")) && aIndex == 0) {
dirService->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
// Profile directory
else if (aType.Equals(NS_LITERAL_STRING("profile")) && aIndex == 0) {
dirService->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(f));
dirService->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile), getter_AddRefs(f));
}
}

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

@ -194,7 +194,7 @@ FileManager::Invalidate()
already_AddRefed<nsIFile>
FileManager::GetDirectory()
{
nsCOMPtr<nsILocalFile> directory =
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
NS_ENSURE_TRUE(directory, nsnull);

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

@ -9,7 +9,6 @@
#include "IndexedDatabase.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsIDOMFile.h"
#include "nsDataHashtable.h"

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

@ -8,7 +8,7 @@
#include "IDBFactory.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIPrincipal.h"
#include "nsIScriptContext.h"
@ -164,7 +164,7 @@ IDBFactory::GetConnection(const nsAString& aDatabaseFilePath)
NS_ASSERTION(StringEndsWith(aDatabaseFilePath, NS_LITERAL_STRING(".sqlite")),
"Bad file path!");
nsCOMPtr<nsILocalFile> dbFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
nsCOMPtr<nsIFile> dbFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
NS_ENSURE_TRUE(dbFile, nsnull);
nsresult rv = dbFile->InitWithPath(aDatabaseFilePath);

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

@ -10,7 +10,6 @@
#include "nsIDOMScriptObjectFactory.h"
#include "nsIFile.h"
#include "nsIFileStorage.h"
#include "nsILocalFile.h"
#include "nsIObserverService.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScriptSecurityManager.h"
@ -278,7 +277,7 @@ IndexedDatabaseManager::GetDirectoryForOrigin(const nsACString& aASCIIOrigin,
nsIFile** aDirectory) const
{
nsresult rv;
nsCOMPtr<nsILocalFile> directory =
nsCOMPtr<nsIFile> directory =
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
@ -291,7 +290,7 @@ IndexedDatabaseManager::GetDirectoryForOrigin(const nsACString& aASCIIOrigin,
rv = directory->Append(originSanitized);
NS_ENSURE_SUCCESS(rv, rv);
directory.forget(reinterpret_cast<nsILocalFile**>(aDirectory));
directory.forget(aDirectory);
return NS_OK;
}

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

@ -1014,7 +1014,7 @@ ContentParent::RecvShowFilePicker(const PRInt16& mode,
nsCOMPtr<nsISimpleEnumerator> fileIter;
*result = filePicker->GetFiles(getter_AddRefs(fileIter));
nsCOMPtr<nsILocalFile> singleFile;
nsCOMPtr<nsIFile> singleFile;
bool loop = true;
while (NS_SUCCEEDED(fileIter->HasMoreElements(&loop)) && loop) {
fileIter->GetNext(getter_AddRefs(singleFile));
@ -1026,7 +1026,7 @@ ContentParent::RecvShowFilePicker(const PRInt16& mode,
}
return true;
}
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
filePicker->GetFile(getter_AddRefs(file));
// even with NS_OK file can be null if nothing was selected

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

@ -6,7 +6,7 @@
#include "mozilla/dom/PCrashReporterParent.h"
#include "mozilla/dom/TabMessageUtils.h"
#include "nsXULAppAPI.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
@ -115,8 +115,8 @@ CrashReporterParent::GeneratePairedMinidump(Toplevel* t)
#else
child = t->OtherProcess();
#endif
nsCOMPtr<nsILocalFile> childDump;
nsCOMPtr<nsILocalFile> parentDump;
nsCOMPtr<nsIFile> childDump;
nsCOMPtr<nsIFile> parentDump;
if (CrashReporter::CreatePairedMinidumps(child,
mMainThread,
&mHangID,
@ -134,7 +134,7 @@ inline bool
CrashReporterParent::GenerateCrashReport(Toplevel* t,
const AnnotationTable* processNotes)
{
nsCOMPtr<nsILocalFile> crashDump;
nsCOMPtr<nsIFile> crashDump;
if (t->TakeMinidump(getter_AddRefs(crashDump)) &&
CrashReporter::GetIDFromMinidump(crashDump, mChildDumpID)) {
return GenerateChildData(processNotes);

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

@ -8,7 +8,7 @@
#include "prmem.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include "nsPluginHost.h"
#include "nsNPAPIPlugin.h"

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

@ -54,7 +54,7 @@ public:
protected:
char* mTarget;
nsCString mFileURL;
nsCOMPtr<nsILocalFile> mTempFile;
nsCOMPtr<nsIFile> mTempFile;
nsCOMPtr<nsIOutputStream> mOutputStream;
nsIPluginInstanceOwner* mOwner;
};

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

@ -6,7 +6,7 @@
#include "nsPluginDirServiceProvider.h"
#include "nsCRT.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsDependentString.h"
#include "prmem.h"
#include "nsArrayEnumerator.h"
@ -189,7 +189,7 @@ NS_IMETHODIMP
nsPluginDirServiceProvider::GetFile(const char *charProp, bool *persistant,
nsIFile **_retval)
{
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
nsresult rv = NS_ERROR_FAILURE;
NS_ENSURE_ARG(charProp);
@ -451,7 +451,7 @@ nsPluginDirServiceProvider::GetPLIDDirectories(nsISimpleEnumerator **aEnumerator
NS_ENSURE_ARG_POINTER(aEnumerator);
*aEnumerator = nsnull;
nsCOMArray<nsILocalFile> dirs;
nsCOMArray<nsIFile> dirs;
GetPLIDDirectoriesWithRootKey(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER, dirs);
GetPLIDDirectoriesWithRootKey(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE, dirs);
@ -460,7 +460,7 @@ nsPluginDirServiceProvider::GetPLIDDirectories(nsISimpleEnumerator **aEnumerator
}
nsresult
nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey(PRUint32 aKey, nsCOMArray<nsILocalFile> &aDirs)
nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey(PRUint32 aKey, nsCOMArray<nsIFile> &aDirs)
{
nsCOMPtr<nsIWindowsRegKey> regKey =
do_CreateInstance("@mozilla.org/windows-registry-key;1");
@ -485,7 +485,7 @@ nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey(PRUint32 aKey, nsCOMAr
nsAutoString path;
rv = childKey->ReadStringValue(NS_LITERAL_STRING("Path"), path);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
if (NS_SUCCEEDED(NS_NewLocalFile(path, true,
getter_AddRefs(localFile))) &&
localFile) {
@ -496,7 +496,7 @@ nsPluginDirServiceProvider::GetPLIDDirectoriesWithRootKey(PRUint32 aKey, nsCOMAr
nsCOMPtr<nsIFile> temp;
localFile->GetParent(getter_AddRefs(temp));
if (temp)
localFile = do_QueryInterface(temp);
localFile = temp;
}
// Now we check to make sure it's actually on disk and

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

@ -37,7 +37,7 @@ public:
static nsresult GetPLIDDirectories(nsISimpleEnumerator **aEnumerator);
private:
static nsresult GetPLIDDirectoriesWithRootKey(PRUint32 aKey,
nsCOMArray<nsILocalFile> &aDirs);
nsCOMArray<nsIFile> &aDirs);
#endif
protected:

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

@ -86,7 +86,6 @@
#include "nsIMIMEService.h"
#include "nsCExternalHandlerService.h"
#include "nsILocalFile.h"
#include "nsIFileChannel.h"
#include "nsPluginSafety.h"
@ -98,7 +97,6 @@
#include "nsDirectoryServiceDefs.h"
#include "nsXULAppAPI.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsPluginDirServiceProvider.h"
#include "nsPluginError.h"
@ -1548,7 +1546,7 @@ static nsresult CreateNPAPIPlugin(nsPluginTag *aPluginTag,
if (!nsNPAPIPlugin::RunPluginOOP(aPluginTag)) {
if (aPluginTag->mFullPath.IsEmpty())
return NS_ERROR_FAILURE;
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1");
nsCOMPtr<nsIFile> file = do_CreateInstance("@mozilla.org/file/local;1");
file->InitWithPath(NS_ConvertUTF8toUTF16(aPluginTag->mFullPath));
nsPluginFile pluginFile(file);
PRLibrary* pluginLibrary = NULL;
@ -1898,7 +1896,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
if (NS_FAILED(rv))
return rv;
nsAutoTArray<nsCOMPtr<nsILocalFile>, 6> pluginFiles;
nsAutoTArray<nsCOMPtr<nsIFile>, 6> pluginFiles;
bool hasMore;
while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) {
@ -1906,7 +1904,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
rv = iter->GetNext(getter_AddRefs(supports));
if (NS_FAILED(rv))
continue;
nsCOMPtr<nsILocalFile> dirEntry(do_QueryInterface(supports, &rv));
nsCOMPtr<nsIFile> dirEntry(do_QueryInterface(supports, &rv));
if (NS_FAILED(rv))
continue;
@ -1922,7 +1920,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir,
bool warnOutdated = false;
for (PRUint32 i = 0; i < pluginFiles.Length(); i++) {
nsCOMPtr<nsILocalFile>& localfile = pluginFiles[i];
nsCOMPtr<nsIFile>& localfile = pluginFiles[i];
nsString utf16FilePath;
rv = localfile->GetPath(utf16FilePath);
@ -2447,11 +2445,7 @@ nsPluginHost::WritePluginInfo()
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(pluginReg, &rv);
if (NS_FAILED(rv))
return rv;
rv = localFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0600, &fd);
rv = pluginReg->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0600, &fd);
if (NS_FAILED(rv))
return rv;
@ -2557,9 +2551,9 @@ nsPluginHost::WritePluginInfo()
PR_Close(fd);
nsCOMPtr<nsIFile> parent;
rv = localFile->GetParent(getter_AddRefs(parent));
rv = pluginReg->GetParent(getter_AddRefs(parent));
NS_ENSURE_SUCCESS(rv, rv);
rv = localFile->MoveToNative(parent, kPluginRegistryFilename);
rv = pluginReg->MoveToNative(parent, kPluginRegistryFilename);
return rv;
}
@ -2599,12 +2593,8 @@ nsPluginHost::ReadPluginInfo()
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(pluginReg, &rv);
if (NS_FAILED(rv))
return rv;
PRInt64 fileSize;
rv = localFile->GetFileSize(&fileSize);
rv = pluginReg->GetFileSize(&fileSize);
if (NS_FAILED(rv))
return rv;
@ -2619,7 +2609,7 @@ nsPluginHost::ReadPluginInfo()
if (!registry)
return NS_ERROR_OUT_OF_MEMORY;
rv = localFile->OpenNSPRFileDesc(PR_RDONLY, 0444, &fd);
rv = pluginReg->OpenNSPRFileDesc(PR_RDONLY, 0444, &fd);
if (NS_FAILED(rv))
return rv;
@ -2722,7 +2712,7 @@ nsPluginHost::ReadPluginInfo()
return rv;
// try to derive a file name from the full path
if (fullpath) {
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1");
nsCOMPtr<nsIFile> file = do_CreateInstance("@mozilla.org/file/local;1");
file->InitWithNativePath(nsDependentCString(fullpath));
file->GetNativeLeafName(derivedFileName);
filename = derivedFileName.get();
@ -3534,7 +3524,7 @@ nsPluginHost::CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile)
rv = NS_GetFileFromURLSpec(nsDependentCString(aPostDataURL),
getter_AddRefs(inFile));
if (NS_FAILED(rv)) {
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = NS_NewNativeLocalFile(nsDependentCString(aPostDataURL), false,
getter_AddRefs(localFile));
if (NS_FAILED(rv)) return rv;

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

@ -13,7 +13,7 @@
#include "prerror.h"
#include <sys/stat.h>
#include "nsString.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"

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

@ -23,7 +23,7 @@
#include "winbase.h"
#include "nsString.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsUnicharUtils.h"
using namespace mozilla;
@ -239,15 +239,13 @@ nsPluginFile::~nsPluginFile()
*/
nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
{
nsCOMPtr<nsILocalFile> plugin = do_QueryInterface(mPlugin);
if (!plugin)
if (!mPlugin)
return NS_ERROR_NULL_POINTER;
bool protectCurrentDirectory = true;
nsAutoString pluginFolderPath;
plugin->GetPath(pluginFolderPath);
mPlugin->GetPath(pluginFolderPath);
PRInt32 idx = pluginFolderPath.RFindChar('\\');
if (kNotFound == idx)
@ -273,7 +271,7 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
SetDllDirectory(NULL);
}
nsresult rv = plugin->Load(outLibrary);
nsresult rv = mPlugin->Load(outLibrary);
if (NS_FAILED(rv))
*outLibrary = NULL;

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

@ -21,7 +21,7 @@
#include <gtk/gtk.h>
#endif
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "pratom.h"
#include "nsDebug.h"
@ -152,7 +152,7 @@ PluginModuleChild::Init(const std::string& aPluginFilename,
return false;
mPluginFilename = aPluginFilename.c_str();
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
NS_NewLocalFile(NS_ConvertUTF8toUTF16(mPluginFilename),
true,
getter_AddRefs(localFile));

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

@ -31,7 +31,7 @@
#include "mozilla/dom/CrashReporterParent.h"
#endif
#include "nsNPAPIPlugin.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#ifdef XP_WIN
#include "mozilla/widget/AudioSession.h"

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

@ -10,7 +10,7 @@ interface nsIURI;
interface nsIInputStream;
interface nsIDOMDocument;
interface nsIWebProgressListener;
interface nsILocalFile;
interface nsIFile;
interface nsIChannel;
/**
@ -127,11 +127,11 @@ interface nsIWebBrowserPersist : nsICancelable
* <CODE>nsnull</CODE>.
* @param aExtraHeaders Additional headers to supply with an HTTP request
* or <CODE>nsnull</CODE>.
* @param aFile Target file. This may be a nsILocalFile object or an
* @param aFile Target file. This may be a nsIFile object or an
* nsIURI object with a file scheme or a scheme that
* supports uploading (e.g. ftp).
*
* @see nsILocalFile
* @see nsIFile
* @see nsIURI
* @see nsIInputStream
*
@ -227,12 +227,12 @@ interface nsIWebBrowserPersist : nsICancelable
* @param aDocument Document to save to file. Some implementations of
* this interface may also support <CODE>nsnull</CODE>
* to imply the currently loaded document.
* @param aFile Target local file. This may be a nsILocalFile object or an
* @param aFile Target local file. This may be a nsIFile object or an
* nsIURI object with a file scheme or a scheme that
* supports uploading (e.g. ftp).
* @param aDataPath Path to directory where URIs linked to the document
* are saved or nsnull if no linked URIs should be saved.
* This may be a nsILocalFile object or an nsIURI object
* This may be a nsIFile object or an nsIURI object
* with a file scheme.
* @param aOutputContentType The desired MIME type format to save the
* document and all subdocuments into or nsnull to use
@ -242,7 +242,7 @@ interface nsIWebBrowserPersist : nsICancelable
* wrap text at. Parameter is ignored if wrapping is not
* specified by the encoding flags.
*
* @see nsILocalFile
* @see nsIFile
* @see nsIURI
*
* @return NS_OK Operation has been started.

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

@ -168,7 +168,7 @@ struct UploadData
struct CleanupData
{
nsCOMPtr<nsILocalFile> mFile;
nsCOMPtr<nsIFile> mFile;
// Snapshot of what the file actually is at the time of creation so that if
// it transmutes into something else later on it can be ignored. For example,
// catch files that turn into dirs or vice versa.
@ -698,7 +698,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStopRequest(
// delete 'data'; this will close the stream and let
// us tag the file it created with its source URI
nsCOMPtr<nsIURI> uriSource = data->mOriginalLocation;
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
GetLocalFileFromURI(data->mFile, getter_AddRefs(localFile));
delete data;
mOutputMap.Remove(&key);
@ -1035,7 +1035,7 @@ nsresult nsWebBrowserPersist::SendErrorStatusChange(
}
// Get the file path or spec from the supplied URI
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
GetLocalFileFromURI(aURI, getter_AddRefs(file));
nsAutoString path;
if (file)
@ -1125,7 +1125,7 @@ nsresult nsWebBrowserPersist::GetValidURIFromObject(nsISupports *aObject, nsIURI
return NS_ERROR_FAILURE;
}
nsresult nsWebBrowserPersist::GetLocalFileFromURI(nsIURI *aURI, nsILocalFile **aLocalFile) const
nsresult nsWebBrowserPersist::GetLocalFileFromURI(nsIURI *aURI, nsIFile **aLocalFile) const
{
nsresult rv;
@ -1485,10 +1485,10 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal(
NS_ENSURE_ARG_POINTER(aFile);
// See if we can get the local file representation of this URI
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
nsresult rv = GetLocalFileFromURI(aFile, getter_AddRefs(localFile));
nsCOMPtr<nsILocalFile> localDataPath;
nsCOMPtr<nsIFile> localDataPath;
if (NS_SUCCEEDED(rv) && aDataPath)
{
// See if we can get the local file representation of this URI
@ -1634,7 +1634,7 @@ nsresult nsWebBrowserPersist::SaveDocumentInternal(
}
if (!haveDir)
{
rv = localDataPath->Create(nsILocalFile::DIRECTORY_TYPE, 0755);
rv = localDataPath->Create(nsIFile::DIRECTORY_TYPE, 0755);
if (NS_SUCCEEDED(rv))
haveDir = true;
else
@ -1819,7 +1819,7 @@ void nsWebBrowserPersist::CleanupLocalFiles()
for (i = 0; i < mCleanupList.Length(); i++)
{
CleanupData *cleanupData = mCleanupList.ElementAt(i);
nsCOMPtr<nsILocalFile> file = cleanupData->mFile;
nsCOMPtr<nsIFile> file = cleanupData->mFile;
// Test if the dir / file exists (something in an earlier loop
// may have already removed it)
@ -1880,7 +1880,7 @@ void nsWebBrowserPersist::CleanupLocalFiles()
NS_ASSERTION(child, "No child element, but hasMoreElements says otherwise");
if (!child)
continue;
nsCOMPtr<nsILocalFile> childAsFile = do_QueryInterface(child);
nsCOMPtr<nsIFile> childAsFile = do_QueryInterface(child);
NS_ASSERTION(childAsFile, "This should be a file but isn't");
bool childIsSymlink = false;
@ -2051,7 +2051,7 @@ nsWebBrowserPersist::CalculateUniqueFilename(nsIURI *aURI)
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
GetLocalFileFromURI(aURI, getter_AddRefs(localFile));
if (localFile)
@ -2114,7 +2114,7 @@ nsWebBrowserPersist::MakeFilenameFromURI(nsIURI *aURI, nsString &aFilename)
// There is no point going any further since it will be
// truncated in CalculateUniqueFilename anyway.
// More importantly, certain implementations of
// nsILocalFile (e.g. the Mac impl) might truncate
// nsIFile (e.g. the Mac impl) might truncate
// names in undesirable ways, such as truncating from
// the middle, inserting ellipsis and so on.
break;
@ -2170,7 +2170,7 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne
mMIMEService->GetFromTypeAndExtension(
contentType, EmptyCString(), getter_AddRefs(mimeInfo));
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
GetLocalFileFromURI(aURI, getter_AddRefs(localFile));
if (mimeInfo)
@ -2247,7 +2247,7 @@ nsWebBrowserPersist::MakeOutputStream(
{
nsresult rv;
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
GetLocalFileFromURI(aURI, getter_AddRefs(localFile));
if (localFile)
rv = MakeOutputStreamFromFile(localFile, aOutputStream);
@ -2259,7 +2259,7 @@ nsWebBrowserPersist::MakeOutputStream(
nsresult
nsWebBrowserPersist::MakeOutputStreamFromFile(
nsILocalFile *aFile, nsIOutputStream **aOutputStream)
nsIFile *aFile, nsIOutputStream **aOutputStream)
{
nsresult rv = NS_OK;
@ -3691,7 +3691,7 @@ nsWebBrowserPersist::SaveDocumentWithFixup(
NS_ENSURE_ARG_POINTER(aFile);
nsresult rv = NS_OK;
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
GetLocalFileFromURI(aFile, getter_AddRefs(localFile));
if (localFile)
{

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

@ -20,7 +20,7 @@
#include "nsIDocumentEncoder.h"
#include "nsITransport.h"
#include "nsIProgressEventSink.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIWebProgressListener2.h"
#include "nsHashtable.h"
@ -81,14 +81,14 @@ private:
void Cleanup();
void CleanupLocalFiles();
nsresult GetValidURIFromObject(nsISupports *aObject, nsIURI **aURI) const;
nsresult GetLocalFileFromURI(nsIURI *aURI, nsILocalFile **aLocalFile) const;
nsresult GetLocalFileFromURI(nsIURI *aURI, nsIFile **aLocalFile) const;
nsresult AppendPathToURI(nsIURI *aURI, const nsAString & aPath) const;
nsresult MakeAndStoreLocalFilenameInURIMap(
nsIURI *aURI, bool aNeedsPersisting, URIData **aData);
nsresult MakeOutputStream(
nsIURI *aFile, nsIOutputStream **aOutputStream);
nsresult MakeOutputStreamFromFile(
nsILocalFile *aFile, nsIOutputStream **aOutputStream);
nsIFile *aFile, nsIOutputStream **aOutputStream);
nsresult MakeOutputStreamFromURI(nsIURI *aURI, nsIOutputStream **aOutStream);
nsresult CreateChannelFromURI(nsIURI *aURI, nsIChannel **aChannel);
nsresult StartUpload(nsIStorageStream *aOutStream, nsIURI *aDestinationURI,

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

@ -202,7 +202,7 @@ int main(int argc, char *argv[])
{
strcpy(lastslash, "\\xulrunner");
nsCOMPtr<nsILocalFile> xuldir;
nsCOMPtr<nsIFile> xuldir;
rv = NS_NewNativeLocalFile(nsCString(path), false,
getter_AddRefs(xuldir));
if (NS_FAILED(rv))
@ -210,7 +210,7 @@ int main(int argc, char *argv[])
*lastslash = '\0';
nsCOMPtr<nsILocalFile> appdir;
nsCOMPtr<nsIFile> appdir;
rv = NS_NewNativeLocalFile(nsCString(path), false,
getter_AddRefs(appdir));
if (NS_FAILED(rv))
@ -746,7 +746,6 @@ nsresult StartupProfile()
return rv;
appDataDir->AppendNative(nsCString("winembed"));
nsCOMPtr<nsILocalFile> localAppDataDir(do_QueryInterface(appDataDir));
nsCOMPtr<nsProfileDirServiceProvider> locProvider;
NS_NewProfileDirServiceProvider(true, getter_AddRefs(locProvider));
@ -757,7 +756,7 @@ nsresult StartupProfile()
if (NS_FAILED(rv))
return rv;
return locProvider->SetProfileDir(localAppDataDir);
return locProvider->SetProfileDir(appDataDir);
}

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

@ -188,7 +188,7 @@ NS_IMETHODIMP mozHunspell::SetDictionary(const PRUnichar *aDictionary)
// XXX This isn't really good. nsIFile->NativePath isn't safe for all
// character sets on Windows.
// A better way would be to QI to nsILocalFile, and get a filehandle
// A better way would be to QI to nsIFile, and get a filehandle
// from there. Only problem is that hunspell wants a path
nsresult rv = affFile->GetNativePath(affFileName);

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

@ -41,7 +41,7 @@
#elif defined(XP_WIN)
#include "nsILocalFile.h"
#include "nsIFile.h"
#define GLES2_LIB "libGLESv2.dll"

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

@ -12,7 +12,7 @@
#include "GLContext.h"
#include "GLLibraryLoader.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
typedef int EGLint;
typedef unsigned int EGLBoolean;

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

@ -17,7 +17,7 @@
#include "nsTArray.h"
#include "nsIWindowsRegKey.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "plbase64.h"
#include "nsIXULRuntime.h"

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

@ -210,14 +210,12 @@ nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool nonBlocki
nsresult rv = ExtractIconInfoFromUrl(getter_AddRefs(fileloc), &desiredImageSize, contentType, fileExt);
NS_ENSURE_SUCCESS(rv, rv);
// ensure that we DO NOT resolve aliases, very important for file views
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(fileloc);
if (localFile)
localFile->SetFollowLinks(false);
bool fileExists = false;
if (fileloc)
localFile->Exists(&fileExists);
if (fileloc) {
// ensure that we DO NOT resolve aliases, very important for file views
fileloc->SetFollowLinks(false);
fileloc->Exists(&fileExists);
}
NSImage* iconImage = nil;

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

@ -11,7 +11,7 @@
#include "nsReadableUtils.h"
#include "nsMemory.h"
#include "nsNetUtil.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIFileURL.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIRwsService.h"

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

@ -27,7 +27,6 @@
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "mozilla/ipc/BrowserProcessSubThread.h"
#include "mozilla/Omnijar.h"

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

@ -8,7 +8,6 @@
#include "base/string_util.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsCOMPtr.h"
#include "nsServiceManagerUtils.h"
@ -41,7 +40,7 @@ ScopedXREEmbed::Start()
# error Sorry
#endif
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
nsresult rv = XRE_GetBinaryPath(path.c_str(), getter_AddRefs(localFile));
if (NS_FAILED(rv))
return;

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

@ -3040,7 +3040,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
dumpvar = ExprVar('aDump')
getdump = MethodDefn(MethodDecl(
'TakeMinidump',
params=[ Decl(Type('nsILocalFile', ptrptr=1), dumpvar.name) ],
params=[ Decl(Type('nsIFile', ptrptr=1), dumpvar.name) ],
ret=Type.BOOL,
const=1))
getdump.addstmts([

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

@ -84,7 +84,7 @@ public:
void ClearGREDir() { mGREDir = nsnull; }
private:
nsCOMPtr<nsILocalFile> mGREDir;
nsCOMPtr<nsIFile> mGREDir;
};
inline XPCShellEnvironment*

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

@ -22,7 +22,7 @@
#include "nsICategoryManager.h"
#include "nsIComponentManager.h"
#include "mozilla/Module.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIServiceManager.h"
#include "nsISupports.h"
#include "mozJSComponentLoader.h"
@ -442,7 +442,7 @@ mozJSComponentLoader::ReallyInit()
const mozilla::Module*
mozJSComponentLoader::LoadModule(FileLocation &aFile)
{
nsCOMPtr<nsILocalFile> file = aFile.GetBaseFile();
nsCOMPtr<nsIFile> file = aFile.GetBaseFile();
nsCString spec;
aFile.GetURIString(spec);
@ -608,7 +608,7 @@ class ANSIFileAutoCloser
#endif
nsresult
mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile,
nsIURI *aURI,
JSObject **aGlobal,
char **aLocation,
@ -666,7 +666,7 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
nsCOMPtr<nsIXPConnectJSObjectHolder> locationHolder;
rv = xpc->WrapNative(cx, global, aComponentFile,
NS_GET_IID(nsILocalFile),
NS_GET_IID(nsIFile),
getter_AddRefs(locationHolder));
NS_ENSURE_SUCCESS(rv, rv);
@ -1092,7 +1092,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation,
rv = baseFileURL->GetFile(getter_AddRefs(sourceFile));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILocalFile> sourceLocalFile;
nsCOMPtr<nsIFile> sourceLocalFile;
sourceLocalFile = do_QueryInterface(sourceFile, &rv);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -54,7 +54,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader,
nsresult ReallyInit();
void UnloadModules();
nsresult GlobalForLocation(nsILocalFile* aComponentFile,
nsresult GlobalForLocation(nsIFile* aComponentFile,
nsIURI *aComponent,
JSObject **aGlobal,
char **location,

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

@ -27,10 +27,9 @@
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsStringAPI.h"
#include "nsIDirectoryService.h"
#include "nsILocalFile.h"
#include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nscore.h"
@ -91,12 +90,12 @@ public:
bool SetGREDir(const char *dir);
void ClearGREDir() { mGREDir = nsnull; }
void SetAppFile(nsILocalFile *appFile);
void SetAppFile(nsIFile *appFile);
void ClearAppFile() { mAppFile = nsnull; }
private:
nsCOMPtr<nsILocalFile> mGREDir;
nsCOMPtr<nsILocalFile> mAppFile;
nsCOMPtr<nsIFile> mGREDir;
nsCOMPtr<nsIFile> mAppFile;
};
/***************************************************************************/
@ -171,7 +170,7 @@ GetLocationProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp)
NS_ConvertUTF8toUTF16 filenameString(filename);
#endif
nsCOMPtr<nsILocalFile> location;
nsCOMPtr<nsIFile> location;
if (NS_SUCCEEDED(rv)) {
rv = NS_NewLocalFile(filenameString,
false, getter_AddRefs(location));
@ -197,7 +196,7 @@ GetLocationProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, jsval *vp)
!symlink)
location->Normalize();
rv = xpc->WrapNative(cx, obj, location,
NS_GET_IID(nsILocalFile),
NS_GET_IID(nsIFile),
getter_AddRefs(locationHolder));
if (NS_SUCCEEDED(rv) &&
@ -1705,7 +1704,7 @@ main(int argc, char **argv, char **envp)
NS_LogInit();
nsCOMPtr<nsILocalFile> appFile;
nsCOMPtr<nsIFile> appFile;
rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appFile));
if (NS_FAILED(rv)) {
printf("Couldn't find application file.\n");
@ -1738,7 +1737,7 @@ main(int argc, char **argv, char **envp)
if (argc < 3)
return usage();
nsCOMPtr<nsILocalFile> dir;
nsCOMPtr<nsIFile> dir;
rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(dir));
if (NS_SUCCEEDED(rv)) {
appDir = do_QueryInterface(dir, &rv);
@ -1755,7 +1754,7 @@ main(int argc, char **argv, char **envp)
if (argc < 3)
return usage();
nsCOMPtr<nsILocalFile> lf;
nsCOMPtr<nsIFile> lf;
rv = XRE_GetFileFromPath(argv[2], getter_AddRefs(lf));
if (NS_FAILED(rv)) {
printf("Couldn't get manifest file.\n");
@ -1769,8 +1768,8 @@ main(int argc, char **argv, char **envp)
{
if (argc > 1 && !strcmp(argv[1], "--greomni")) {
nsCOMPtr<nsILocalFile> greOmni;
nsCOMPtr<nsILocalFile> appOmni;
nsCOMPtr<nsIFile> greOmni;
nsCOMPtr<nsIFile> appOmni;
XRE_GetFileFromPath(argv[2], getter_AddRefs(greOmni));
if (argc > 3 && !strcmp(argv[3], "--appomni")) {
XRE_GetFileFromPath(argv[4], getter_AddRefs(appOmni));
@ -2008,7 +2007,7 @@ XPCShellDirProvider::SetGREDir(const char *dir)
}
void
XPCShellDirProvider::SetAppFile(nsILocalFile* appFile)
XPCShellDirProvider::SetAppFile(nsIFile* appFile)
{
mAppFile = appFile;
}
@ -2068,7 +2067,7 @@ XPCShellDirProvider::GetFile(const char *prop, bool *persistent,
#endif
nsAutoString pathName;
pathName.AssignASCII(path);
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
nsresult rv = NS_NewLocalFile(pathName, true, getter_AddRefs(localFile));
if (NS_FAILED(rv)) {
return rv;

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

@ -8036,7 +8036,7 @@ DumpToPNG(nsIPresShell* shell, nsAString& name) {
imgIEncoder::INPUT_FORMAT_HOSTARGB, EmptyString());
// XXX not sure if this is the right way to write to a file
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1");
nsCOMPtr<nsIFile> file = do_CreateInstance("@mozilla.org/file/local;1");
NS_ENSURE_TRUE(file, NS_ERROR_FAILURE);
rv = file->InitWithPath(name);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -28,7 +28,7 @@
#include "nsIDOMMouseEvent.h"
#include "nsINodeInfo.h"
#include "nsIDOMEventTarget.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsHTMLInputElement.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"

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

@ -15,7 +15,6 @@
#include "nsError.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsIStreamListener.h"
#include "nsNetUtil.h"
#include "nsIChannelEventSink.h"

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

@ -15,7 +15,7 @@
#include "nsXPCOM.h"
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include "nsContentCID.h"
@ -25,7 +25,7 @@
static already_AddRefed<nsIURI>
FileToURI(const char *aFilename, nsresult *aRv = 0)
{
nsCOMPtr<nsILocalFile> lf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, aRv));
nsCOMPtr<nsIFile> lf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, aRv));
NS_ENSURE_TRUE(lf, nsnull);
// XXX Handle relative paths somehow.
lf->InitWithNativePath(nsDependentCString(aFilename));

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

@ -6,7 +6,7 @@
#include "nsISupports.idl"
interface nsIDOMWindow;
interface nsILocalFile;
interface nsIFile;
[scriptable, uuid(B249B2C0-EE11-11DA-8AD9-0800200C9A66)]
interface nsILayoutRegressionTester : nsISupports
@ -28,7 +28,7 @@ interface nsILayoutRegressionTester : nsISupports
const long DUMP_RESULT_LOADING = 1; // still loading
const long DUMP_RESULT_ERROR = 2; // an error occurred
long dumpFrameModel(in nsIDOMWindow aWindowToDump, in nsILocalFile aFile, in unsigned long aFlagsMask);
long dumpFrameModel(in nsIDOMWindow aWindowToDump, in nsIFile aFile, in unsigned long aFlagsMask);
/**
* Compares the contents of frame model files
@ -39,6 +39,6 @@ interface nsILayoutRegressionTester : nsISupports
*/
const short COMPARE_FLAGS_VERBOSE = 0;
const short COMPARE_FLAGS_BRIEF = 1;
long compareFrameModels(in nsILocalFile aBaseFile, in nsILocalFile aVerFile, in unsigned long aFlags);
long compareFrameModels(in nsIFile aBaseFile, in nsIFile aVerFile, in unsigned long aFlags);
};

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

@ -28,7 +28,7 @@
#include "nsIFrameUtil.h"
#include "nsLayoutCID.h"
#include "nsNetUtil.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIViewManager.h"
#include "nsIView.h"
@ -49,7 +49,7 @@ NS_IMPL_ISUPPORTS1(nsRegressionTester, nsILayoutRegressionTester)
NS_IMETHODIMP
nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump,
nsILocalFile *aDestFile,
nsIFile *aDestFile,
PRUint32 aFlagsMask, PRInt32 *aResult)
{
NS_ENSURE_ARG(aWindowToDump);
@ -110,7 +110,7 @@ nsRegressionTester::DumpFrameModel(nsIDOMWindow *aWindowToDump,
}
NS_IMETHODIMP
nsRegressionTester::CompareFrameModels(nsILocalFile *aBaseFile, nsILocalFile *aVerFile, PRUint32 aFlags, PRInt32 *aResult)
nsRegressionTester::CompareFrameModels(nsIFile *aBaseFile, nsIFile *aVerFile, PRUint32 aFlags, PRInt32 *aResult)
{
NS_ENSURE_ARG(aBaseFile);
NS_ENSURE_ARG(aVerFile);

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

@ -37,7 +37,6 @@ INCLUDES += \
-I$(ANDROID_SOURCE)/frameworks/base/include/binder/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/utils/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright/openmax \
-I$(ANDROID_SOURCE)/frameworks/base/media/libstagefright/include \
$(NULL)

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

@ -6,14 +6,14 @@
#include <unistd.h>
#include <fcntl.h>
#include <DataSource.h>
#include <MediaErrors.h>
#include <MediaExtractor.h>
#include <MediaSource.h>
#include <MetaData.h>
#include <OMXCodec.h>
#include <stagefright/DataSource.h>
#include <stagefright/MediaErrors.h>
#include <stagefright/MediaExtractor.h>
#include <stagefright/MediaSource.h>
#include <stagefright/MetaData.h>
#include <stagefright/OMXCodec.h>
#include <stagefright/HardwareAPI.h>
#include <OMX.h>
#include <HardwareAPI.h>
#include <ui/GraphicBuffer.h>
#include <ui/Rect.h>
#include <ui/Region.h>

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

@ -8,8 +8,6 @@ package org.mozilla.gecko;
import java.lang.Math;
import java.util.Date;
import android.util.Log;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -18,11 +16,12 @@ import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Build;
import android.os.SystemClock;
import android.util.Log;
public class GeckoBatteryManager
extends BroadcastReceiver
{
private static final String LOGTAG = "GeckoBatteryManager";
private static final String LOGTAG = "GeckoBatteryManager";
// Those constants should be keep in sync with the ones in:
// dom/battery/Constants.h
@ -44,7 +43,7 @@ public class GeckoBatteryManager
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
// registerReciever can return null if registering fails
// registerReceiver can return null if registering fails
isRegistered = activity.registerReceiver(this, filter) != null;
if (!isRegistered)
Log.e(LOGTAG, "Registering receiver failed");
@ -53,7 +52,11 @@ public class GeckoBatteryManager
public void unregisterFor(Activity activity) {
if (isRegistered) {
activity.unregisterReceiver(this);
try {
activity.unregisterReceiver(this);
} catch (IllegalArgumentException iae) {
Log.e(LOGTAG, "Unregistering receiver failed", iae);
}
isRegistered = false;
}
}

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

@ -5,8 +5,6 @@
package org.mozilla.gecko;
import android.util.Log;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
@ -14,6 +12,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
public class GeckoConnectivityReceiver extends BroadcastReceiver {
/*
@ -24,7 +23,7 @@ public class GeckoConnectivityReceiver extends BroadcastReceiver {
private static final String LINK_DATA_DOWN = "down";
private static final String LINK_DATA_UNKNOWN = "unknown";
private static final String LOGTAG = "GeckoConnectivityReciever";
private static final String LOGTAG = "GeckoConnectivityReceiver";
private IntentFilter mFilter;
@ -54,7 +53,7 @@ public class GeckoConnectivityReceiver extends BroadcastReceiver {
public void registerFor(Activity activity) {
if (!isRegistered) {
// registerReciever will return null if registering throws a RemoteException
// registerReciever will return null if registering fails
isRegistered = activity.registerReceiver(this, mFilter) != null;
if (!isRegistered)
Log.e(LOGTAG, "Registering receiver failed");
@ -63,7 +62,11 @@ public class GeckoConnectivityReceiver extends BroadcastReceiver {
public void unregisterFor(Activity activity) {
if (isRegistered) {
activity.unregisterReceiver(this);
try {
activity.unregisterReceiver(this);
} catch (IllegalArgumentException iae) {
Log.e(LOGTAG, "Unregistering receiver failed", iae);
}
isRegistered = false;
}
}

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

@ -18,7 +18,7 @@
#include <stdarg.h>
#include "nsCOMPtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsStringGlue.h"
#ifdef XP_WIN
@ -109,7 +109,7 @@ static const nsDynamicFunctionLoad kXULFuncs[] = {
static int do_main(int argc, char* argv[])
{
nsCOMPtr<nsILocalFile> appini;
nsCOMPtr<nsIFile> appini;
nsresult rv;
// Allow firefox.exe to launch XULRunner apps via -app <application.ini>

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

@ -5,7 +5,7 @@
#include <string.h>
#include "nsJARInputStream.h"
#include "nsJAR.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIConsoleService.h"
#include "nsICryptoHash.h"
#include "prprf.h"
@ -216,10 +216,6 @@ nsJAR::Extract(const nsACString &aEntryName, nsIFile* outFile)
// we need to use a lock to prevent bug #51267
MutexAutoLock lock(mLock);
nsresult rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(outFile, &rv);
if (NS_FAILED(rv)) return rv;
nsZipItem *item = mZip->GetItem(PromiseFlatCString(aEntryName).get());
NS_ENSURE_TRUE(item, NS_ERROR_FILE_TARGET_DOES_NOT_EXIST);
@ -232,22 +228,22 @@ nsJAR::Extract(const nsACString &aEntryName, nsIFile* outFile)
//XXX is always FILE_DIR_NOT_EMPTY, we can remove
//XXX |rv == NS_ERROR_FAILURE| - bug 322183 needs to be completely
//XXX fixed before that can happen
rv = localFile->Remove(false);
nsresult rv = outFile->Remove(false);
if (rv == NS_ERROR_FILE_DIR_NOT_EMPTY ||
rv == NS_ERROR_FAILURE)
return rv;
if (item->IsDirectory())
{
rv = localFile->Create(nsIFile::DIRECTORY_TYPE, item->Mode());
rv = outFile->Create(nsIFile::DIRECTORY_TYPE, item->Mode());
//XXX Do this in nsZipArchive? It would be nice to keep extraction
//XXX code completely there, but that would require a way to get a
//XXX PRDir from localFile.
//XXX PRDir from outFile.
}
else
{
PRFileDesc* fd;
rv = localFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE, item->Mode(), &fd);
rv = outFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE, item->Mode(), &fd);
if (NS_FAILED(rv)) return rv;
// ExtractFile also closes the fd handle and resolves the symlink if needed

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

@ -98,7 +98,7 @@ nsZipHandle::nsZipHandle()
NS_IMPL_THREADSAFE_ADDREF(nsZipHandle)
NS_IMPL_THREADSAFE_RELEASE(nsZipHandle)
nsresult nsZipHandle::Init(nsILocalFile *file, nsZipHandle **ret)
nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret)
{
mozilla::AutoFDClose fd;
nsresult rv = file->OpenNSPRFileDesc(PR_RDONLY, 0000, &fd.rwget());
@ -192,7 +192,7 @@ nsresult nsZipArchive::OpenArchive(nsZipHandle *aZipHandle)
nsresult rv = BuildFileList();
char *env = PR_GetEnv("MOZ_JAR_LOG_DIR");
if (env && NS_SUCCEEDED(rv) && aZipHandle->mFile) {
nsCOMPtr<nsILocalFile> logFile;
nsCOMPtr<nsIFile> logFile;
nsresult rv2 = NS_NewLocalFile(NS_ConvertUTF8toUTF16(env), false, getter_AddRefs(logFile));
if (!NS_SUCCEEDED(rv2))
@ -202,7 +202,7 @@ nsresult nsZipArchive::OpenArchive(nsZipHandle *aZipHandle)
logFile->Create(nsIFile::DIRECTORY_TYPE, 0700);
nsAutoString name;
nsCOMPtr<nsILocalFile> file = aZipHandle->mFile.GetBaseFile();
nsCOMPtr<nsIFile> file = aZipHandle->mFile.GetBaseFile();
file->GetLeafName(name);
name.Append(NS_LITERAL_STRING(".log"));
logFile->Append(name);
@ -217,12 +217,8 @@ nsresult nsZipArchive::OpenArchive(nsZipHandle *aZipHandle)
nsresult nsZipArchive::OpenArchive(nsIFile *aFile)
{
nsresult rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(aFile, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<nsZipHandle> handle;
rv = nsZipHandle::Init(localFile, getter_AddRefs(handle));
nsresult rv = nsZipHandle::Init(aFile, getter_AddRefs(handle));
if (NS_FAILED(rv))
return rv;

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

@ -19,7 +19,7 @@
#include "zlib.h"
#include "zipstruct.h"
#include "nsAutoPtr.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "mozilla/FileUtils.h"
#include "mozilla/FileLocation.h"
@ -375,7 +375,7 @@ class nsZipHandle {
friend class nsZipArchive;
friend class mozilla::FileLocation;
public:
static nsresult Init(nsILocalFile *file, nsZipHandle **ret NS_OUTPARAM);
static nsresult Init(nsIFile *file, nsZipHandle **ret NS_OUTPARAM);
static nsresult Init(nsZipArchive *zip, const char *entry,
nsZipHandle **ret NS_OUTPARAM);

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

@ -133,7 +133,7 @@ interface nsIPrefBranch : nsISupports
* @param aPrefName The complex preference to get the value of.
* @param aType The XPCOM interface that this complex preference
* represents. Interfaces currently supported are:
* - nsILocalFile
* - nsIFile
* - nsISupportsString (UniChar)
* - nsIPrefLocalizedString (Localized UniChar)
* @param aValue The XPCOM object into which to the complex preference
@ -155,7 +155,7 @@ interface nsIPrefBranch : nsISupports
* @param aPrefName The complex preference to set the value of.
* @param aType The XPCOM interface that this complex preference
* represents. Interfaces currently supported are:
* - nsILocalFile
* - nsIFile
* - nsISupportsString (UniChar)
* - nsIPrefLocalizedString (Localized UniChar)
* @param aValue The XPCOM object from which to set the complex preference

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

@ -17,7 +17,6 @@ struct nsTArrayInfallibleAllocator;
[ptr] native nsPreferencePtrConst(const PrefTuple);
interface nsIFile;
interface nsILocalFile;
/**
* The nsIPrefService interface is the main entry point into the back end

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

@ -4,10 +4,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsILocalFile;
interface nsIFile;
/**
* The nsIRelativeFilePref interface is a wrapper for an nsILocalFile and
* The nsIRelativeFilePref interface is a wrapper for an nsIFile and
* and a directory service key. When used as a pref value, it stores a
* relative path to the file from the location pointed to by the directory
* service key. The path has the same syntax across all platforms.
@ -25,7 +25,7 @@ interface nsIRelativeFilePref : nsISupports
*
* The file whose location is stored or retrieved.
*/
attribute nsILocalFile file;
attribute nsIFile file;
/**
* relativeToKey
@ -53,7 +53,7 @@ interface nsIRelativeFilePref : nsISupports
#include "nsComponentManagerUtils.h"
inline nsresult
NS_NewRelativeFilePref(nsILocalFile* aFile, const nsACString& relativeToKey, nsIRelativeFilePref** result)
NS_NewRelativeFilePref(nsIFile* aFile, const nsACString& relativeToKey, nsIRelativeFilePref** result)
{
nsresult rv;
nsCOMPtr<nsIRelativeFilePref> local(do_CreateInstance(NS_RELATIVEFILEPREF_CONTRACTID, &rv));

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

@ -18,7 +18,6 @@
#include "nsNetUtil.h"
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsILocalFile.h"
#include "nsIObserverService.h"
#include "nsIStringEnumerator.h"
#include "nsIZipReader.h"

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

@ -7,7 +7,7 @@
#include "nsXULAppAPI.h"
#include "nsPrefBranch.h"
#include "nsILocalFile.h"
#include "nsILocalFile.h" // nsILocalFile used for backwards compatibility
#include "nsIObserverService.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
@ -232,18 +232,19 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID &
return rv;
}
if (aType.Equals(NS_GET_IID(nsILocalFile))) {
// also check nsILocalFile, for backwards compatibility
if (aType.Equals(NS_GET_IID(nsIFile)) || aType.Equals(NS_GET_IID(nsILocalFile))) {
if (GetContentChild()) {
NS_ERROR("cannot get nsILocalFile pref from content process");
NS_ERROR("cannot get nsIFile pref from content process");
return NS_ERROR_NOT_AVAILABLE;
}
nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
nsCOMPtr<nsIFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv)) {
rv = file->SetPersistentDescriptor(utf8String);
if (NS_SUCCEEDED(rv)) {
file.forget(reinterpret_cast<nsILocalFile**>(_retval));
file.forget(reinterpret_cast<nsIFile**>(_retval));
return NS_OK;
}
}
@ -268,15 +269,15 @@ NS_IMETHODIMP nsPrefBranch::GetComplexValue(const char *aPrefName, const nsIID &
return NS_ERROR_FAILURE;
nsCAutoString key(Substring(keyBegin, keyEnd));
nsCOMPtr<nsILocalFile> fromFile;
nsCOMPtr<nsIFile> fromFile;
nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;
rv = directoryService->Get(key.get(), NS_GET_IID(nsILocalFile), getter_AddRefs(fromFile));
rv = directoryService->Get(key.get(), NS_GET_IID(nsIFile), getter_AddRefs(fromFile));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsILocalFile> theFile;
nsCOMPtr<nsIFile> theFile;
rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(theFile));
if (NS_FAILED(rv))
return rv;
@ -317,8 +318,9 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID &
nsresult rv = NS_NOINTERFACE;
if (aType.Equals(NS_GET_IID(nsILocalFile))) {
nsCOMPtr<nsILocalFile> file = do_QueryInterface(aValue);
// also check nsILocalFile, for backwards compatibility
if (aType.Equals(NS_GET_IID(nsIFile)) || aType.Equals(NS_GET_IID(nsILocalFile))) {
nsCOMPtr<nsIFile> file = do_QueryInterface(aValue);
if (!file)
return NS_NOINTERFACE;
nsCAutoString descriptorString;
@ -335,18 +337,18 @@ NS_IMETHODIMP nsPrefBranch::SetComplexValue(const char *aPrefName, const nsIID &
if (!relFilePref)
return NS_NOINTERFACE;
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
relFilePref->GetFile(getter_AddRefs(file));
if (!file)
return NS_NOINTERFACE;
nsCAutoString relativeToKey;
(void) relFilePref->GetRelativeToKey(relativeToKey);
nsCOMPtr<nsILocalFile> relativeToFile;
nsCOMPtr<nsIFile> relativeToFile;
nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;
rv = directoryService->Get(relativeToKey.get(), NS_GET_IID(nsILocalFile), getter_AddRefs(relativeToFile));
rv = directoryService->Get(relativeToKey.get(), NS_GET_IID(nsIFile), getter_AddRefs(relativeToFile));
if (NS_FAILED(rv))
return rv;
@ -802,7 +804,7 @@ nsRelativeFilePref::~nsRelativeFilePref()
{
}
NS_IMETHODIMP nsRelativeFilePref::GetFile(nsILocalFile **aFile)
NS_IMETHODIMP nsRelativeFilePref::GetFile(nsIFile **aFile)
{
NS_ENSURE_ARG_POINTER(aFile);
*aFile = mFile;
@ -810,7 +812,7 @@ NS_IMETHODIMP nsRelativeFilePref::GetFile(nsILocalFile **aFile)
return NS_OK;
}
NS_IMETHODIMP nsRelativeFilePref::SetFile(nsILocalFile *aFile)
NS_IMETHODIMP nsRelativeFilePref::SetFile(nsIFile *aFile)
{
mFile = aFile;
return NS_OK;

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

@ -11,7 +11,7 @@
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIRelativeFilePref.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsString.h"
#include "nsVoidArray.h"
#include "nsTArray.h"
@ -243,6 +243,6 @@ public:
virtual ~nsRelativeFilePref();
private:
nsCOMPtr<nsILocalFile> mFile;
nsCOMPtr<nsIFile> mFile;
nsCString mRelativeToKey;
};

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

@ -7,7 +7,7 @@
#include "nsISupports.idl"
interface nsIArray;
interface nsILocalFile;
interface nsIFile;
/**
* Application caches can store a set of namespace entries that affect
@ -195,5 +195,5 @@ interface nsIApplicationCache : nsISupports
* If set, this offline cache is placed in a different directory
* than the current application profile.
*/
readonly attribute nsILocalFile cacheDirectory;
readonly attribute nsIFile cacheDirectory;
};

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

@ -7,7 +7,7 @@
#include "nsISupports.idl"
interface nsIApplicationCache;
interface nsILocalFile;
interface nsIFile;
/**
* The application cache service manages the set of application cache
@ -35,7 +35,7 @@ interface nsIApplicationCacheService : nsISupports
* Optional override of the default quota.
*/
nsIApplicationCache createCustomApplicationCache(in ACString group,
in nsILocalFile profileDir,
in nsIFile profileDir,
in PRInt32 quota);
/**

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

@ -6,7 +6,6 @@
#include "nsICacheInfoChannel.idl"
interface nsIFile;
interface nsILocalFile;
/**
* A channel may optionally implement this interface to allow clients
@ -92,7 +91,7 @@ interface nsICachingChannel : nsICacheInfoChannel
* Override base (profile) directory to work with when accessing the cache.
* When not specified, the current process' profile directory will be used.
*/
attribute nsILocalFile profileDirectory;
attribute nsIFile profileDirectory;
/**
* Get the "file" where the cached data can be found. This is valid for

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

@ -15,7 +15,7 @@ interface nsIFile;
interface nsIFileInputStream : nsIInputStream
{
/**
* @param file file to read from (must QI to nsILocalFile)
* @param file file to read from
* @param ioFlags file open flags listed in prio.h (see
* PR_Open documentation) or -1 to open the
* file in default mode (PR_RDONLY).
@ -81,7 +81,7 @@ interface nsIFileInputStream : nsIInputStream
interface nsIFileOutputStream : nsIOutputStream
{
/**
* @param file file to write to (must QI to nsILocalFile)
* @param file file to write to
* @param ioFlags file open flags listed in prio.h (see
* PR_Open documentation) or -1 to open the
* file in default mode (PR_WRONLY |
@ -125,7 +125,7 @@ interface nsIPartialFileInputStream : nsISupports
* You must initialize the stream, and only initialize it once, before it
* can be used.
*
* @param file file to read from (must QI to nsILocalFile)
* @param file file to read from
* @param start start offset of slice to read. Must be smaller
* than the size of the file.
* @param length length of slice to read. Must be small enough that
@ -150,8 +150,7 @@ interface nsIPartialFileInputStream : nsISupports
interface nsIFileStream : nsISupports
{
/**
* @param file file to read from or stream to (must QI to
* nsILocalFile)
* @param file file to read from or stream to
* @param ioFlags file open flags listed in prio.h (see
* PR_Open documentation) or -1 to open the
* file in default mode (PR_RDWR).

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

@ -44,7 +44,7 @@
#include "nsIProtocolHandler.h"
#include "nsIFileProtocolHandler.h"
#include "nsIStringStream.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIFileStreams.h"
#include "nsIFileURL.h"
#include "nsIProtocolProxyService.h"
@ -1119,7 +1119,7 @@ NS_NewPostDataStream(nsIInputStream **result,
nsresult rv;
if (isFile) {
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
nsCOMPtr<nsIInputStream> fileStream;
rv = NS_NewNativeLocalFile(data, false, getter_AddRefs(file));

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

@ -19,7 +19,6 @@
#include "private/pprio.h"
#include "nsFileStreams.h"
#include "nsILocalFile.h"
#include "nsXPIDLString.h"
#include "prerror.h"
#include "nsCRT.h"
@ -251,7 +250,7 @@ nsFileStreamBase::WriteSegments(nsReadSegmentFun reader, void * closure, PRUint3
}
nsresult
nsFileStreamBase::MaybeOpen(nsILocalFile* aFile, PRInt32 aIoFlags,
nsFileStreamBase::MaybeOpen(nsIFile* aFile, PRInt32 aIoFlags,
PRInt32 aPerm, bool aDeferred)
{
mOpenParams.ioFlags = aIoFlags;
@ -356,14 +355,12 @@ nsFileInputStream::Open(nsIFile* aFile, PRInt32 aIOFlags, PRInt32 aPerm)
}
// Open the file
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(aFile, &rv);
if (NS_FAILED(rv)) return rv;
if (aIOFlags == -1)
aIOFlags = PR_RDONLY;
if (aPerm == -1)
aPerm = 0;
rv = MaybeOpen(localFile, aIOFlags, aPerm,
rv = MaybeOpen(aFile, aIOFlags, aPerm,
mBehaviorFlags & nsIFileInputStream::DEFER_OPEN);
if (NS_FAILED(rv)) return rv;
@ -478,7 +475,7 @@ nsFileInputStream::Read(const IPC::Message *aMsg, void **aIter)
!ReadParam(aMsg, aIter, &flags))
return false;
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
nsresult rv = NS_NewNativeLocalFile(path, followLinks, getter_AddRefs(file));
if (NS_FAILED(rv))
return false;
@ -500,9 +497,8 @@ nsFileInputStream::Write(IPC::Message *aMsg)
nsCString path;
mFile->GetNativePath(path);
WriteParam(aMsg, path);
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(mFile);
bool followLinks;
localFile->GetFollowLinks(&followLinks);
mFile->GetFollowLinks(&followLinks);
WriteParam(aMsg, followLinks);
WriteParam(aMsg, mBehaviorFlags);
}
@ -647,15 +643,12 @@ nsFileOutputStream::Init(nsIFile* file, PRInt32 ioFlags, PRInt32 perm,
mBehaviorFlags = behaviorFlags;
nsresult rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
if (NS_FAILED(rv)) return rv;
if (ioFlags == -1)
ioFlags = PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE;
if (perm <= 0)
perm = 0664;
return MaybeOpen(localFile, ioFlags, perm,
return MaybeOpen(file, ioFlags, perm,
mBehaviorFlags & nsIFileOutputStream::DEFER_OPEN);
}
@ -680,7 +673,7 @@ nsSafeFileOutputStream::DoOpen()
{
// Make sure mOpenParams.localFile will be empty if we bail somewhere in
// this function
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
file.swap(mOpenParams.localFile);
nsresult rv = file->Exists(&mTargetFileExists);
@ -696,9 +689,7 @@ nsSafeFileOutputStream::DoOpen()
nsCOMPtr<nsIFile> tempResult;
rv = file->Clone(getter_AddRefs(tempResult));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsILocalFile> tempLocal = do_QueryInterface(tempResult);
if (tempLocal)
tempLocal->SetFollowLinks(true);
tempResult->SetFollowLinks(true);
// XP_UNIX ignores SetFollowLinks(), so we have to normalize.
tempResult->Normalize();
@ -717,9 +708,7 @@ nsSafeFileOutputStream::DoOpen()
if (NS_SUCCEEDED(rv)) {
// nsFileOutputStream::DoOpen will work on the temporary file, so we
// prepare it and place it in mOpenParams.localFile.
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(tempResult, &rv);
NS_ENSURE_SUCCESS(rv, rv);
mOpenParams.localFile = localFile;
mOpenParams.localFile = tempResult;
mTempFile = tempResult;
mTargetFile = file;
rv = nsFileOutputStream::DoOpen();
@ -826,14 +815,13 @@ nsFileStream::Init(nsIFile* file, PRInt32 ioFlags, PRInt32 perm,
mBehaviorFlags = behaviorFlags;
nsresult rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
if (NS_FAILED(rv)) return rv;
if (ioFlags == -1)
ioFlags = PR_RDWR;
if (perm <= 0)
perm = 0;
return MaybeOpen(localFile, ioFlags, perm,
return MaybeOpen(file, ioFlags, perm,
mBehaviorFlags & nsIFileStream::DEFER_OPEN);
}

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

@ -59,7 +59,7 @@ protected:
bool mDeferredOpen;
struct OpenParams {
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
PRInt32 ioFlags;
PRInt32 perm;
};
@ -74,7 +74,7 @@ protected:
* by calling DoOpen(), or leaves it to be opened later by a call to
* DoPendingOpen().
*/
nsresult MaybeOpen(nsILocalFile* aFile, PRInt32 aIoFlags, PRInt32 aPerm,
nsresult MaybeOpen(nsIFile* aFile, PRInt32 aIoFlags, PRInt32 aPerm,
bool aDeferred);
/**

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

@ -16,7 +16,7 @@
#include "nsIObserver.h"
#include "nsIPropertyBag2.h"
#include "nsIServiceManager.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsITimer.h"
#include "nsNetUtil.h"
#include "nsAutoPtr.h"
@ -47,7 +47,7 @@
//-----------------------------------------------------------------------------
static nsresult
WriteToFile(nsILocalFile *lf, const char *data, PRUint32 len, PRInt32 flags)
WriteToFile(nsIFile *lf, const char *data, PRUint32 len, PRInt32 flags)
{
PRFileDesc *fd;
nsresult rv = lf->OpenNSPRFileDesc(flags, 0600, &fd);
@ -62,7 +62,7 @@ WriteToFile(nsILocalFile *lf, const char *data, PRUint32 len, PRInt32 flags)
}
static nsresult
AppendToFile(nsILocalFile *lf, const char *data, PRUint32 len)
AppendToFile(nsIFile *lf, const char *data, PRUint32 len)
{
PRInt32 flags = PR_WRONLY | PR_CREATE_FILE | PR_APPEND;
return WriteToFile(lf, data, len, flags);
@ -128,7 +128,7 @@ private:
nsCOMPtr<nsIProgressEventSink> mProgressSink;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mFinalURI;
nsCOMPtr<nsILocalFile> mDest;
nsCOMPtr<nsIFile> mDest;
nsCOMPtr<nsIChannel> mChannel;
nsCOMPtr<nsITimer> mTimer;
nsAutoArrayPtr<char> mChunk;

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

@ -11,7 +11,7 @@
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "nsEscape.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsICharsetConverterManager.h"

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

@ -10,7 +10,7 @@
#include "nsReadableUtils.h"
#include "nsIServiceManager.h"
#include "nsIIOService.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIURLParser.h"
#include "nsIURI.h"
#include "nsMemory.h"

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

@ -10,7 +10,7 @@
#include <os2.h>
#include "nsURLHelper.h"
#include "nsEscape.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
nsresult
net_GetURLSpecFromActualFile(nsIFile *aFile, nsACString &result)
@ -49,10 +49,10 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
{
nsresult rv;
nsCOMPtr<nsILocalFile> localFile(
nsCOMPtr<nsIFile> localFile(
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
NS_ERROR("Only nsILocalFile supported right now");
NS_ERROR("Only nsIFile supported right now");
return rv;
}

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

@ -7,7 +7,7 @@
/* Mac OS X-specific local file uri parsing */
#include "nsURLHelper.h"
#include "nsEscape.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsTArray.h"
#include "nsReadableUtils.h"
#include <Carbon/Carbon.h>
@ -148,7 +148,7 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
nsresult rv;
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(localFile));
if (NS_FAILED(rv))
return rv;

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

@ -7,7 +7,7 @@
/* Unix-specific local file uri parsing */
#include "nsURLHelper.h"
#include "nsEscape.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsNativeCharsetUtils.h"
nsresult
@ -55,7 +55,7 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
nsresult rv;
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(localFile));
if (NS_FAILED(rv))
return rv;

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

@ -7,7 +7,7 @@
/* Windows-specific local file uri parsing */
#include "nsURLHelper.h"
#include "nsEscape.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include <windows.h>
nsresult
@ -51,10 +51,10 @@ net_GetFileFromURLSpec(const nsACString &aURL, nsIFile **result)
{
nsresult rv;
nsCOMPtr<nsILocalFile> localFile(
nsCOMPtr<nsIFile> localFile(
do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
NS_ERROR("Only nsILocalFile supported right now");
NS_ERROR("Only nsIFile supported right now");
return rv;
}

2
netwerk/cache/nsApplicationCacheService.cpp поставляемый
Просмотреть файл

@ -36,7 +36,7 @@ nsApplicationCacheService::CreateApplicationCache(const nsACString &group,
NS_IMETHODIMP
nsApplicationCacheService::CreateCustomApplicationCache(const nsACString & group,
nsILocalFile *profileDir,
nsIFile *profileDir,
PRInt32 quota,
nsIApplicationCache **out)
{

2
netwerk/cache/nsCacheRequest.h поставляемый
Просмотреть файл

@ -153,7 +153,7 @@ private:
nsCOMPtr<nsIThread> mThread;
Mutex mLock;
CondVar mCondVar;
nsCOMPtr<nsILocalFile> mProfileDir;
nsCOMPtr<nsIFile> mProfileDir;
};
#endif // _nsCacheRequest_h_

22
netwerk/cache/nsCacheService.cpp поставляемый
Просмотреть файл

@ -23,7 +23,7 @@
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIOService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
@ -140,12 +140,12 @@ public:
PRInt32 DiskCacheCapacity() { return mDiskCacheCapacity; }
void SetDiskCacheCapacity(PRInt32);
PRInt32 DiskCacheMaxEntrySize() { return mDiskCacheMaxEntrySize; }
nsILocalFile * DiskCacheParentDirectory() { return mDiskCacheParentDirectory; }
nsIFile * DiskCacheParentDirectory() { return mDiskCacheParentDirectory; }
bool SmartSizeEnabled() { return mSmartSizeEnabled; }
bool OfflineCacheEnabled();
PRInt32 OfflineCacheCapacity() { return mOfflineCacheCapacity; }
nsILocalFile * OfflineCacheParentDirectory() { return mOfflineCacheParentDirectory; }
nsIFile * OfflineCacheParentDirectory() { return mOfflineCacheParentDirectory; }
bool MemoryCacheEnabled();
PRInt32 MemoryCacheCapacity();
@ -165,12 +165,12 @@ private:
bool mDiskCacheEnabled;
PRInt32 mDiskCacheCapacity; // in kilobytes
PRInt32 mDiskCacheMaxEntrySize; // in kilobytes
nsCOMPtr<nsILocalFile> mDiskCacheParentDirectory;
nsCOMPtr<nsIFile> mDiskCacheParentDirectory;
bool mSmartSizeEnabled;
bool mOfflineCacheEnabled;
PRInt32 mOfflineCacheCapacity; // in kilobytes
nsCOMPtr<nsILocalFile> mOfflineCacheParentDirectory;
nsCOMPtr<nsIFile> mOfflineCacheParentDirectory;
bool mMemoryCacheEnabled;
PRInt32 mMemoryCacheCapacity; // in kilobytes
@ -584,7 +584,7 @@ nsCacheProfilePrefObserver::GetSmartCacheSize(const nsAString& cachePath,
{
// Check for free space on device where cache directory lives
nsresult rv;
nsCOMPtr<nsILocalFile>
nsCOMPtr<nsIFile>
cacheDirectory (do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
if (NS_FAILED(rv) || !cacheDirectory)
return DEFAULT_CACHE_SIZE;
@ -656,7 +656,7 @@ nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch* branch)
mDiskCacheMaxEntrySize = NS_MAX(-1, mDiskCacheMaxEntrySize);
(void) branch->GetComplexValue(DISK_CACHE_DIR_PREF, // ignore error
NS_GET_IID(nsILocalFile),
NS_GET_IID(nsIFile),
getter_AddRefs(mDiskCacheParentDirectory));
if (!mDiskCacheParentDirectory) {
@ -733,7 +733,7 @@ nsCacheProfilePrefObserver::ReadPrefs(nsIPrefBranch* branch)
mOfflineCacheCapacity = NS_MAX(0, mOfflineCacheCapacity);
(void) branch->GetComplexValue(OFFLINE_CACHE_DIR_PREF, // ignore error
NS_GET_IID(nsILocalFile),
NS_GET_IID(nsIFile),
getter_AddRefs(mOfflineCacheParentDirectory));
if (!mOfflineCacheParentDirectory) {
@ -1161,7 +1161,7 @@ nsCacheService::Shutdown()
Telemetry::AutoTimer<Telemetry::NETWORK_DISK_CACHE_SHUTDOWN> totalTimer;
bool shouldSanitize = false;
nsCOMPtr<nsILocalFile> parentDir;
nsCOMPtr<nsIFile> parentDir;
{
nsCacheServiceAutoLock lock;
@ -1545,7 +1545,7 @@ nsCacheService::GetOfflineDevice(nsOfflineCacheDevice **aDevice)
}
nsresult
nsCacheService::GetCustomOfflineDevice(nsILocalFile *aProfileDir,
nsCacheService::GetCustomOfflineDevice(nsIFile *aProfileDir,
PRInt32 aQuota,
nsOfflineCacheDevice **aDevice)
{
@ -1583,7 +1583,7 @@ nsCacheService::CreateOfflineDevice()
}
nsresult
nsCacheService::CreateCustomOfflineDevice(nsILocalFile *aProfileDir,
nsCacheService::CreateCustomOfflineDevice(nsIFile *aProfileDir,
PRInt32 aQuota,
nsOfflineCacheDevice **aDevice)
{

4
netwerk/cache/nsCacheService.h поставляемый
Просмотреть файл

@ -118,7 +118,7 @@ public:
* A tool to preload offline cache for profiles different from the current
* application's profile directory.
*/
nsresult GetCustomOfflineDevice(nsILocalFile *aProfileDir,
nsresult GetCustomOfflineDevice(nsIFile *aProfileDir,
PRInt32 aQuota,
nsOfflineCacheDevice **aDevice);
@ -193,7 +193,7 @@ private:
nsresult CreateDiskDevice();
nsresult CreateOfflineDevice();
nsresult CreateCustomOfflineDevice(nsILocalFile *aProfileDir,
nsresult CreateCustomOfflineDevice(nsIFile *aProfileDir,
PRInt32 aQuota,
nsOfflineCacheDevice **aDevice);
nsresult CreateMemoryDevice();

4
netwerk/cache/nsCacheSession.cpp поставляемый
Просмотреть файл

@ -41,7 +41,7 @@ NS_IMETHODIMP nsCacheSession::GetDoomEntriesIfExpired(bool *result)
}
NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsILocalFile *profileDir)
NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsIFile *profileDir)
{
if (StoragePolicy() != nsICache::STORE_OFFLINE && profileDir) {
// Profile directory override is currently implemented only for
@ -55,7 +55,7 @@ NS_IMETHODIMP nsCacheSession::SetProfileDirectory(nsILocalFile *profileDir)
return NS_OK;
}
NS_IMETHODIMP nsCacheSession::GetProfileDirectory(nsILocalFile **profileDir)
NS_IMETHODIMP nsCacheSession::GetProfileDirectory(nsIFile **profileDir)
{
if (mProfileDir)
NS_ADDREF(*profileDir = mProfileDir);

6
netwerk/cache/nsCacheSession.h поставляемый
Просмотреть файл

@ -11,7 +11,7 @@
#include "nsError.h"
#include "nsCOMPtr.h"
#include "nsICacheSession.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsString.h"
class nsCacheSession : public nsICacheSession
@ -55,12 +55,12 @@ public:
mInfo |= policy;
}
nsILocalFile* ProfileDir() { return mProfileDir; }
nsIFile* ProfileDir() { return mProfileDir; }
private:
nsCString mClientID;
PRUint32 mInfo;
nsCOMPtr<nsILocalFile> mProfileDir;
nsCOMPtr<nsIFile> mProfileDir;
};
#endif // _nsCacheSession_h_

6
netwerk/cache/nsDiskCacheBlockFile.cpp поставляемый
Просмотреть файл

@ -19,9 +19,9 @@ using namespace mozilla;
* Open
*****************************************************************************/
nsresult
nsDiskCacheBlockFile::Open(nsILocalFile * blockFile,
PRUint32 blockSize,
PRUint32 bitMapSize)
nsDiskCacheBlockFile::Open(nsIFile * blockFile,
PRUint32 blockSize,
PRUint32 bitMapSize)
{
if (bitMapSize % 32)
return NS_ERROR_INVALID_ARG;

4
netwerk/cache/nsDiskCacheBlockFile.h поставляемый
Просмотреть файл

@ -7,7 +7,7 @@
#ifndef _nsDiskCacheBlockFile_h_
#define _nsDiskCacheBlockFile_h_
#include "nsILocalFile.h"
#include "nsIFile.h"
/******************************************************************************
* nsDiskCacheBlockFile
@ -29,7 +29,7 @@ public:
{}
~nsDiskCacheBlockFile() { (void) Close(true); }
nsresult Open( nsILocalFile * blockFile, PRUint32 blockSize,
nsresult Open( nsIFile * blockFile, PRUint32 blockSize,
PRUint32 bitMapSize);
nsresult Close(bool flush);

8
netwerk/cache/nsDiskCacheDevice.cpp поставляемый
Просмотреть файл

@ -213,8 +213,8 @@ NS_IMETHODIMP nsDiskCacheDeviceInfo::GetUsageReport(char ** usageReport)
buffer.AssignLiteral(" <tr>\n"
" <th>Cache Directory:</th>\n"
" <td>");
nsCOMPtr<nsILocalFile> cacheDir;
nsAutoString path;
nsCOMPtr<nsIFile> cacheDir;
nsAutoString path;
mDevice->getCacheDirectory(getter_AddRefs(cacheDir));
nsresult rv = cacheDir->GetPath(path);
if (NS_SUCCEEDED(rv)) {
@ -1068,7 +1068,7 @@ nsDiskCacheDevice::EvictDiskCacheEntries(PRUint32 targetCapacity)
*/
void
nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir)
nsDiskCacheDevice::SetCacheParentDirectory(nsIFile * parentDir)
{
nsresult rv;
bool exists;
@ -1102,7 +1102,7 @@ nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir)
void
nsDiskCacheDevice::getCacheDirectory(nsILocalFile ** result)
nsDiskCacheDevice::getCacheDirectory(nsIFile ** result)
{
*result = mCacheDirectory;
NS_IF_ADDREF(*result);

8
netwerk/cache/nsDiskCacheDevice.h поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
#include "nsDiskCacheBlockFile.h"
#include "nsDiskCacheEntry.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsIObserver.h"
#include "nsCOMArray.h"
@ -57,13 +57,13 @@ public:
/**
* Preference accessors
*/
void SetCacheParentDirectory(nsILocalFile * parentDir);
void SetCacheParentDirectory(nsIFile * parentDir);
void SetCapacity(PRUint32 capacity);
void SetMaxEntrySize(PRInt32 maxSizeInKilobytes);
/* private: */
void getCacheDirectory(nsILocalFile ** result);
void getCacheDirectory(nsIFile ** result);
PRUint32 getCacheCapacity();
PRUint32 getCacheSize();
PRUint32 getEntryCount();
@ -99,7 +99,7 @@ private:
/**
* Member variables
*/
nsCOMPtr<nsILocalFile> mCacheDirectory;
nsCOMPtr<nsIFile> mCacheDirectory;
nsDiskCacheBindery mBindery;
PRUint32 mCacheCapacity; // Unit is KiB's
PRInt32 mMaxEntrySize; // Unit is bytes internally

6
netwerk/cache/nsDiskCacheDeviceSQL.cpp поставляемый
Просмотреть файл

@ -253,7 +253,7 @@ nsOfflineCacheDeviceInfo::GetUsageReport(char ** usageReport)
buffer.AssignLiteral(" <tr>\n"
" <th>Cache Directory:</th>\n"
" <td>");
nsILocalFile *cacheDir = mDevice->CacheDirectory();
nsIFile *cacheDir = mDevice->CacheDirectory();
if (!cacheDir)
return NS_OK;
@ -630,7 +630,7 @@ nsApplicationCache::GetClientID(nsACString &out)
}
NS_IMETHODIMP
nsApplicationCache::GetCacheDirectory(nsILocalFile **out)
nsApplicationCache::GetCacheDirectory(nsIFile **out)
{
if (mDevice->BaseDirectory())
NS_ADDREF(*out = mDevice->BaseDirectory());
@ -2350,7 +2350,7 @@ nsOfflineCacheDevice::GetGroupForCache(const nsACString &clientID,
*/
void
nsOfflineCacheDevice::SetCacheParentDirectory(nsILocalFile *parentDir)
nsOfflineCacheDevice::SetCacheParentDirectory(nsIFile *parentDir)
{
if (Initialized())
{

11
netwerk/cache/nsDiskCacheDeviceSQL.h поставляемый
Просмотреть файл

@ -9,7 +9,6 @@
#include "nsCacheDevice.h"
#include "nsIApplicationCache.h"
#include "nsIApplicationCacheService.h"
#include "nsILocalFile.h"
#include "nsIObserver.h"
#include "mozIStorageConnection.h"
#include "mozIStorageFunction.h"
@ -165,11 +164,11 @@ public:
* Preference accessors
*/
void SetCacheParentDirectory(nsILocalFile * parentDir);
void SetCacheParentDirectory(nsIFile * parentDir);
void SetCapacity(PRUint32 capacity);
nsILocalFile * BaseDirectory() { return mBaseDirectory; }
nsILocalFile * CacheDirectory() { return mCacheDirectory; }
nsIFile * BaseDirectory() { return mBaseDirectory; }
nsIFile * CacheDirectory() { return mCacheDirectory; }
PRUint32 CacheCapacity() { return mCacheCapacity; }
PRUint32 CacheSize();
PRUint32 EntryCount();
@ -253,8 +252,8 @@ private:
nsCOMPtr<mozIStorageStatement> mStatement_EnumerateGroups;
nsCOMPtr<mozIStorageStatement> mStatement_EnumerateGroupsTimeOrder;
nsCOMPtr<nsILocalFile> mBaseDirectory;
nsCOMPtr<nsILocalFile> mCacheDirectory;
nsCOMPtr<nsIFile> mBaseDirectory;
nsCOMPtr<nsIFile> mCacheDirectory;
PRUint32 mCacheCapacity; // in bytes
PRInt32 mDeltaCounter;

38
netwerk/cache/nsDiskCacheMap.cpp поставляемый
Просмотреть файл

@ -27,24 +27,22 @@
*/
nsresult
nsDiskCacheMap::Open(nsILocalFile * cacheDirectory)
nsDiskCacheMap::Open(nsIFile * cacheDirectory)
{
NS_ENSURE_ARG_POINTER(cacheDirectory);
if (mMapFD) return NS_ERROR_ALREADY_INITIALIZED;
mCacheDirectory = cacheDirectory; // save a reference for ourselves
// create nsILocalFile for _CACHE_MAP_
// create nsIFile for _CACHE_MAP_
nsresult rv;
nsCOMPtr<nsIFile> file;
rv = cacheDirectory->Clone(getter_AddRefs(file));
nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(file, &rv));
NS_ENSURE_SUCCESS(rv, rv);
rv = localFile->AppendNative(NS_LITERAL_CSTRING("_CACHE_MAP_"));
rv = file->AppendNative(NS_LITERAL_CSTRING("_CACHE_MAP_"));
NS_ENSURE_SUCCESS(rv, rv);
// open the file - restricted to user, the data could be confidential
rv = localFile->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE, 00600, &mMapFD);
rv = file->OpenNSPRFileDesc(PR_RDWR | PR_CREATE_FILE, 00600, &mMapFD);
NS_ENSURE_SUCCESS(rv, NS_ERROR_FILE_CORRUPTED);
bool cacheFilesExist = CacheFilesExist();
@ -589,8 +587,8 @@ nsDiskCacheMap::EvictRecords( nsDiskCacheRecordVisitor * visitor)
nsresult
nsDiskCacheMap::OpenBlockFiles()
{
// create nsILocalFile for block file
nsCOMPtr<nsILocalFile> blockFile;
// create nsIFile for block file
nsCOMPtr<nsIFile> blockFile;
nsresult rv = NS_OK;
for (int i = 0; i < kNumBlockFiles; ++i) {
@ -625,7 +623,7 @@ nsDiskCacheMap::CloseBlockFiles(bool flush)
bool
nsDiskCacheMap::CacheFilesExist()
{
nsCOMPtr<nsILocalFile> blockFile;
nsCOMPtr<nsIFile> blockFile;
nsresult rv;
for (int i = 0; i < kNumBlockFiles; ++i) {
@ -657,8 +655,7 @@ nsDiskCacheMap::CreateCacheSubDirectories()
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
rv = localFile->Create(nsIFile::DIRECTORY_TYPE, 0700);
rv = file->Create(nsIFile::DIRECTORY_TYPE, 0700);
if (NS_FAILED(rv))
return rv;
}
@ -681,7 +678,7 @@ nsDiskCacheMap::ReadDiskCacheEntry(nsDiskCacheRecord * record)
if (metaFile == 0) { // entry/metadata stored in separate file
// open and read the file
nsCOMPtr<nsILocalFile> file;
nsCOMPtr<nsIFile> file;
rv = GetLocalFileForDiskCacheRecord(record,
nsDiskCache::kMetaData,
false,
@ -871,7 +868,7 @@ nsDiskCacheMap::WriteDiskCacheEntry(nsDiskCacheBinding * binding)
rv = UpdateRecord(&binding->mRecord);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILocalFile> localFile;
nsCOMPtr<nsIFile> localFile;
rv = GetLocalFileForDiskCacheRecord(&binding->mRecord,
nsDiskCache::kMetaData,
true,
@ -1029,8 +1026,7 @@ nsDiskCacheMap::GetFileForDiskCacheRecord(nsDiskCacheRecord * record,
bool exists;
if (createPath && (NS_FAILED(file->Exists(&exists)) || !exists)) {
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
rv = localFile->Create(nsIFile::DIRECTORY_TYPE, 0700);
rv = file->Create(nsIFile::DIRECTORY_TYPE, 0700);
if (NS_FAILED(rv)) return rv;
}
@ -1051,7 +1047,7 @@ nsresult
nsDiskCacheMap::GetLocalFileForDiskCacheRecord(nsDiskCacheRecord * record,
bool meta,
bool createPath,
nsILocalFile ** result)
nsIFile ** result)
{
nsCOMPtr<nsIFile> file;
nsresult rv = GetFileForDiskCacheRecord(record,
@ -1060,16 +1056,13 @@ nsDiskCacheMap::GetLocalFileForDiskCacheRecord(nsDiskCacheRecord * record,
getter_AddRefs(file));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
if (NS_FAILED(rv)) return rv;
NS_IF_ADDREF(*result = localFile);
NS_IF_ADDREF(*result = file);
return rv;
}
nsresult
nsDiskCacheMap::GetBlockFileForIndex(PRUint32 index, nsILocalFile ** result)
nsDiskCacheMap::GetBlockFileForIndex(PRUint32 index, nsIFile ** result)
{
if (!mCacheDirectory) return NS_ERROR_NOT_AVAILABLE;
@ -1082,8 +1075,7 @@ nsDiskCacheMap::GetBlockFileForIndex(PRUint32 index, nsILocalFile ** result)
rv = file->AppendNative(nsDependentCString(name));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
NS_IF_ADDREF(*result = localFile);
NS_IF_ADDREF(*result = file);
return rv;
}

10
netwerk/cache/nsDiskCacheMap.h поставляемый
Просмотреть файл

@ -13,7 +13,7 @@
#include "prnetdb.h"
#include "nsDebug.h"
#include "nsError.h"
#include "nsILocalFile.h"
#include "nsIFile.h"
#include "nsDiskCache.h"
#include "nsDiskCacheBlockFile.h"
@ -396,7 +396,7 @@ public:
* Creates a new cache map file if one doesn't exist.
* Returns error if it detects change in format or cache wasn't closed.
*/
nsresult Open( nsILocalFile * cacheDirectory);
nsresult Open( nsIFile * cacheDirectory);
nsresult Close(bool flush);
nsresult Trim();
@ -428,7 +428,7 @@ public:
nsresult GetLocalFileForDiskCacheRecord( nsDiskCacheRecord * record,
bool meta,
bool createPath,
nsILocalFile ** result);
nsIFile ** result);
// On success, this returns the buffer owned by nsDiskCacheMap,
// so it must not be deleted by the caller.
@ -486,7 +486,7 @@ private:
PRUint32 CalculateFileIndex(PRUint32 size);
nsresult GetBlockFileForIndex( PRUint32 index, nsILocalFile ** result);
nsresult GetBlockFileForIndex( PRUint32 index, nsIFile ** result);
PRUint32 GetBlockSizeForIndex( PRUint32 index) const {
return BLOCK_SIZE_FOR_INDEX(index);
}
@ -529,7 +529,7 @@ private:
* data members
*/
private:
nsCOMPtr<nsILocalFile> mCacheDirectory;
nsCOMPtr<nsIFile> mCacheDirectory;
PRFileDesc * mMapFD;
nsDiskCacheRecord * mRecordArray;
nsDiskCacheBlockFile mBlockFile[kNumBlockFiles];

2
netwerk/cache/nsDiskCacheStreams.h поставляемый
Просмотреть файл

@ -70,7 +70,7 @@ private:
nsDiskCacheDevice * mDevice;
nsDiskCacheOutputStream * mOutStream; // not an owning reference
PRInt32 mInStreamCount;
nsCOMPtr<nsILocalFile> mLocalFile;
nsCOMPtr<nsIFile> mLocalFile;
PRFileDesc * mFD;
PRUint32 mStreamPos; // for Output Streams

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше