зеркало из https://github.com/mozilla/gecko-dev.git
Whitespace cleanup (diff -w shows no changes).
This commit is contained in:
Родитель
71b8ffc325
Коммит
62e4a4e45f
|
@ -98,7 +98,7 @@ interface nsIXULChromeRegistry : nsIChromeRegistry
|
|||
|
||||
/* Whether or not an addon package can dynamically overlay another package.
|
||||
You can use these APIs to effectively disable a chrome add-on without
|
||||
uninstalling it. */
|
||||
uninstalling it. */
|
||||
void setAllowOverlaysForPackage(in wstring packageName, in boolean allowOverlays);
|
||||
|
||||
/* Installation APIs */
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
|
||||
//*****************************************************************************
|
||||
// nsProfileDirServiceProvider::nsProfileDirServiceProvider
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
|
||||
nsProfileDirServiceProvider::nsProfileDirServiceProvider(PRBool aNotifyObservers) :
|
||||
#ifdef MOZ_PROFILELOCKING
|
||||
|
@ -91,7 +91,7 @@ nsProfileDirServiceProvider::~nsProfileDirServiceProvider()
|
|||
nsresult
|
||||
nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
|
||||
{
|
||||
if (mProfileDir) {
|
||||
if (mProfileDir) {
|
||||
PRBool isEqual;
|
||||
if (aProfileDir &&
|
||||
NS_SUCCEEDED(aProfileDir->Equals(mProfileDir, &isEqual)) && isEqual) {
|
||||
|
@ -106,7 +106,7 @@ nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
|
|||
mProfileDir = aProfileDir;
|
||||
if (!mProfileDir)
|
||||
return NS_OK;
|
||||
|
||||
|
||||
nsresult rv = InitProfileDir(mProfileDir);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
@ -126,7 +126,7 @@ nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MOZ_PROFILELOCKING
|
||||
// Lock the non-shared sub-dir if we are sharing,
|
||||
// the whole profile dir if we are not.
|
||||
|
@ -139,9 +139,9 @@ nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
#endif
|
||||
|
||||
|
||||
if (mNotifyObservers) {
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (!observerService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -152,14 +152,14 @@ nsProfileDirServiceProvider::SetProfileDir(nsIFile* aProfileDir)
|
|||
// Now observers can respond to something another observer did on "profile-do-change"
|
||||
observerService->NotifyObservers(nsnull, "profile-after-change", context.get());
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsProfileDirServiceProvider::Register()
|
||||
{
|
||||
nsCOMPtr<nsIDirectoryService> directoryService =
|
||||
nsCOMPtr<nsIDirectoryService> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID);
|
||||
if (!directoryService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -171,27 +171,27 @@ nsProfileDirServiceProvider::Shutdown()
|
|||
{
|
||||
if (!mNotifyObservers)
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
if (!observerService)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
NS_NAMED_LITERAL_STRING(context, "shutdown-persist");
|
||||
observerService->NotifyObservers(nsnull, "profile-before-change", context.get());
|
||||
observerService->NotifyObservers(nsnull, "profile-before-change", context.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsProfileDirServiceProvider::nsISupports
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsProfileDirServiceProvider,
|
||||
nsIDirectoryServiceProvider)
|
||||
|
||||
//*****************************************************************************
|
||||
// nsProfileDirServiceProvider::nsIDirectoryServiceProvider
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProfileDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFile **_retval)
|
||||
|
@ -199,22 +199,22 @@ nsProfileDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFi
|
|||
NS_ENSURE_ARG(prop);
|
||||
NS_ENSURE_ARG_POINTER(persistant);
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
|
||||
// Don't assert - we can be called many times before SetProfileDir() has been called.
|
||||
if (!mProfileDir)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
*persistant = PR_TRUE;
|
||||
nsIFile* domainDir = mProfileDir;
|
||||
|
||||
#ifdef MOZ_PROFILESHARING
|
||||
// If the prop is prefixed with NS_SHARED,
|
||||
// the location is in the shared domain.
|
||||
PRBool bUseShared = PR_FALSE;
|
||||
PRBool bUseShared = PR_FALSE;
|
||||
if (strncmp(prop, NS_SHARED, sizeof(NS_SHARED)-1) == 0) {
|
||||
prop += (sizeof(NS_SHARED)-1);
|
||||
bUseShared = PR_TRUE;
|
||||
}
|
||||
bUseShared = PR_TRUE;
|
||||
}
|
||||
if (!bUseShared && mNonSharedProfileDir)
|
||||
domainDir = mNonSharedProfileDir;
|
||||
#endif
|
||||
|
@ -311,13 +311,13 @@ nsProfileDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFi
|
|||
|
||||
if (localFile && NS_SUCCEEDED(rv))
|
||||
return CallQueryInterface(localFile, _retval);
|
||||
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// Protected methods
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
|
||||
nsresult
|
||||
nsProfileDirServiceProvider::Initialize()
|
||||
|
@ -345,11 +345,11 @@ nsProfileDirServiceProvider::Initialize()
|
|||
|
||||
nsresult
|
||||
nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir)
|
||||
{
|
||||
{
|
||||
// Make sure our "Profile" folder exists.
|
||||
// If it does not, copy the profile defaults to its location.
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsresult rv;
|
||||
PRBool exists;
|
||||
rv = profileDir->Exists(&exists);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -359,7 +359,7 @@ nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir)
|
|||
nsCOMPtr<nsIFile> profileDefaultsDir;
|
||||
nsCOMPtr<nsIFile> profileDirParent;
|
||||
nsCAutoString profileDirName;
|
||||
|
||||
|
||||
(void)profileDir->GetParent(getter_AddRefs(profileDirParent));
|
||||
if (!profileDirParent)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -381,7 +381,7 @@ nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir)
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
#ifndef XP_MAC
|
||||
rv = profileDir->SetPermissions(0700);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -445,13 +445,13 @@ nsProfileDirServiceProvider::EnsureProfileFileExists(nsIFile *aFile, nsIFile *de
|
|||
{
|
||||
nsresult rv;
|
||||
PRBool exists;
|
||||
|
||||
|
||||
rv = aFile->Exists(&exists);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (exists)
|
||||
return NS_OK;
|
||||
|
||||
|
||||
nsCOMPtr<nsIFile> defaultsFile;
|
||||
|
||||
// Attempt first to get the localized subdir of the defaults
|
||||
|
@ -462,7 +462,7 @@ nsProfileDirServiceProvider::EnsureProfileFileExists(nsIFile *aFile, nsIFile *de
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsCAutoString leafName;
|
||||
rv = aFile->GetNativeLeafName(leafName);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -478,8 +478,8 @@ nsresult
|
|||
nsProfileDirServiceProvider::UndefineFileLocations()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
NS_ENSURE_TRUE(directoryService, NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -504,14 +504,14 @@ nsProfileDirServiceProvider::UndefineFileLocations()
|
|||
|
||||
//*****************************************************************************
|
||||
// Global creation function
|
||||
//*****************************************************************************
|
||||
//*****************************************************************************
|
||||
|
||||
nsresult NS_NewProfileDirServiceProvider(PRBool aNotifyObservers,
|
||||
nsProfileDirServiceProvider** aProvider)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aProvider);
|
||||
*aProvider = nsnull;
|
||||
|
||||
|
||||
nsProfileDirServiceProvider *prov = new nsProfileDirServiceProvider(aNotifyObservers);
|
||||
if (!prov)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -521,5 +521,5 @@ nsresult NS_NewProfileDirServiceProvider(PRBool aNotifyObservers,
|
|||
return rv;
|
||||
}
|
||||
NS_ADDREF(*aProvider = prov);
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \
|
|||
return rv; \
|
||||
} \
|
||||
NS_ADDREF(inst); \
|
||||
rv = inst->_InitMethod(); \
|
||||
rv = inst->_InitMethod(); \
|
||||
if(NS_SUCCEEDED(rv)) { \
|
||||
rv = inst->QueryInterface(aIID, aResult); \
|
||||
} \
|
||||
|
|
|
@ -223,10 +223,10 @@ nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) {
|
|||
|
||||
class IFoo : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
|
||||
|
||||
public:
|
||||
public:
|
||||
IFoo();
|
||||
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
|
@ -307,27 +307,27 @@ IFoo::Release()
|
|||
|
||||
nsresult
|
||||
IFoo::QueryInterface( const nsIID& aIID, void** aResult )
|
||||
{
|
||||
{
|
||||
printf("IFoo@%p::QueryInterface()\n", NS_STATIC_CAST(void*, this));
|
||||
nsISupports* rawPtr = 0;
|
||||
nsresult status = NS_OK;
|
||||
nsISupports* rawPtr = 0;
|
||||
nsresult status = NS_OK;
|
||||
|
||||
if ( aIID.Equals(GetIID()) )
|
||||
rawPtr = this;
|
||||
else
|
||||
{
|
||||
nsID iid_of_ISupports = NS_ISUPPORTS_IID;
|
||||
if ( aIID.Equals(iid_of_ISupports) )
|
||||
rawPtr = NS_STATIC_CAST(nsISupports*, this);
|
||||
else
|
||||
status = NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
if ( aIID.Equals(GetIID()) )
|
||||
rawPtr = this;
|
||||
else
|
||||
{
|
||||
nsID iid_of_ISupports = NS_ISUPPORTS_IID;
|
||||
if ( aIID.Equals(iid_of_ISupports) )
|
||||
rawPtr = NS_STATIC_CAST(nsISupports*, this);
|
||||
else
|
||||
status = NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
|
||||
NS_IF_ADDREF(rawPtr);
|
||||
*aResult = rawPtr;
|
||||
NS_IF_ADDREF(rawPtr);
|
||||
*aResult = rawPtr;
|
||||
|
||||
return status;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
nsresult
|
||||
IFoo::SetString(const nsACString& aString)
|
||||
|
|
Загрузка…
Ссылка в новой задаче