зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-inbound and mozilla-central on a CLOSED TREE to fix Android permaorange
This commit is contained in:
Коммит
cbcf0066aa
|
@ -6984,14 +6984,16 @@ dnl = ARM toolchain tweaks
|
|||
dnl ========================================================
|
||||
|
||||
dnl Defaults
|
||||
case "${target}" in
|
||||
arm-android*|arm-linuxandroid*)
|
||||
case "${CPU_ARCH}-${OS_TARGET}" in
|
||||
arm-Android)
|
||||
MOZ_THUMB=yes
|
||||
MOZ_ARCH=armv7-a
|
||||
MOZ_FPU=vfp
|
||||
MOZ_FLOAT_ABI=softfp
|
||||
# Temporarily set nspr flags via configure, until bug 674880 lands
|
||||
NSPR_CONFIGURE_FLAGS="--with-thumb --with-arch=armv7-a --with-fpu=vfp --with-float-abi=softfp"
|
||||
;;
|
||||
arm*-*)
|
||||
arm-*)
|
||||
if test -n "$MOZ_PLATFORM_MAEMO"; then
|
||||
MOZ_THUMB=no
|
||||
MOZ_ARCH=armv7-a
|
||||
|
@ -9552,6 +9554,7 @@ if test -z "$MOZ_NATIVE_NSPR"; then
|
|||
if test -n "$USE_ARM_KUSER"; then
|
||||
ac_configure_args="$ac_configure_args --with-arm-kuser"
|
||||
fi
|
||||
ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_FLAGS"
|
||||
AC_OUTPUT_SUBDIRS(nsprpub)
|
||||
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
|
||||
fi
|
||||
|
|
|
@ -422,7 +422,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
|||
jsval thisValue = JSVAL_VOID;
|
||||
|
||||
jsval funval = JSVAL_VOID;
|
||||
if (JS_ObjectIsFunction(ctx, object)) {
|
||||
if (JS_ObjectIsCallable(ctx, object)) {
|
||||
// If the listener is a JS function:
|
||||
funval = OBJECT_TO_JSVAL(object);
|
||||
|
||||
|
@ -445,7 +445,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
|
|||
JSVAL_IS_OBJECT(funval) &&
|
||||
!JSVAL_IS_NULL(funval));
|
||||
JSObject* funobject = JSVAL_TO_OBJECT(funval);
|
||||
NS_ENSURE_STATE(JS_ObjectIsFunction(ctx, funobject));
|
||||
NS_ENSURE_STATE(JS_ObjectIsCallable(ctx, funobject));
|
||||
thisValue = OBJECT_TO_JSVAL(object);
|
||||
}
|
||||
|
||||
|
|
|
@ -4489,14 +4489,14 @@ dnl = ARM toolchain tweaks
|
|||
dnl ========================================================
|
||||
|
||||
dnl Defaults
|
||||
case "${target}" in
|
||||
arm-android*|arm-linuxandroid*)
|
||||
case "${CPU_ARCH}-${OS_TARGET}" in
|
||||
arm-Android)
|
||||
MOZ_THUMB=yes
|
||||
MOZ_ARCH=armv7-a
|
||||
MOZ_FPU=vfp
|
||||
MOZ_FLOAT_ABI=softfp
|
||||
;;
|
||||
arm*-*)
|
||||
arm-*)
|
||||
if test -n "$MOZ_PLATFORM_MAEMO"; then
|
||||
MOZ_THUMB=no
|
||||
MOZ_ARCH=armv7-a
|
||||
|
|
|
@ -40,9 +40,13 @@
|
|||
#include "nsIFile.h"
|
||||
#include "nsString.h"
|
||||
#include "prthread.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static void DeleteDirThreadFunc(void *arg)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::NETWORK_DISK_CACHE_DELETEDIR> timer;
|
||||
nsIFile *dir = static_cast<nsIFile *>(arg);
|
||||
dir->Remove(PR_TRUE);
|
||||
NS_RELEASE(dir);
|
||||
|
@ -50,6 +54,7 @@ static void DeleteDirThreadFunc(void *arg)
|
|||
|
||||
nsresult DeleteDir(nsIFile *dirIn, PRBool moveToTrash, PRBool sync)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::NETWORK_DISK_CACHE_TRASHRENAME> timer;
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIFile> trash, dir;
|
||||
|
||||
|
@ -59,31 +64,29 @@ nsresult DeleteDir(nsIFile *dirIn, PRBool moveToTrash, PRBool sync)
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (moveToTrash)
|
||||
{
|
||||
if (moveToTrash) {
|
||||
rv = GetTrashDir(dir, &trash);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIFile> subDir;
|
||||
rv = trash->Clone(getter_AddRefs(subDir));
|
||||
nsCAutoString leaf;
|
||||
rv = trash->GetNativeLeafName(leaf);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = subDir->AppendNative(NS_LITERAL_CSTRING("Trash"));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = subDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
rv = dir->MoveToNative(subDir, EmptyCString());
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Important: must rename directory w/o changing parent directory: else on
|
||||
// NTFS we'll wait (with cache lock) while nsIFile's ACL reset walks file
|
||||
// tree: was hanging GUI for *minutes* on large cache dirs.
|
||||
rv = dir->MoveToNative(nsnull, leaf);
|
||||
if (NS_FAILED(rv)) {
|
||||
nsresult rvMove = rv;
|
||||
// TrashDir may already exist (if we crashed while deleting it, etc.)
|
||||
// In that case current Cache dir should be small--just move it to
|
||||
// subdirectory of TrashDir and eat the NTFS ACL overhead.
|
||||
rv = dir->MoveToNative(trash, leaf);
|
||||
if (NS_FAILED(rv))
|
||||
return rvMove;
|
||||
}
|
||||
} else {
|
||||
// we want to pass a clone of the original off to the worker thread.
|
||||
trash.swap(dir);
|
||||
}
|
||||
|
@ -92,12 +95,9 @@ nsresult DeleteDir(nsIFile *dirIn, PRBool moveToTrash, PRBool sync)
|
|||
nsIFile *trashRef = nsnull;
|
||||
trash.swap(trashRef);
|
||||
|
||||
if (sync)
|
||||
{
|
||||
if (sync) {
|
||||
DeleteDirThreadFunc(trashRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// now, invoke the worker thread
|
||||
PRThread *thread = PR_CreateThread(PR_USER_THREAD,
|
||||
DeleteDirThreadFunc,
|
||||
|
|
|
@ -136,5 +136,7 @@ HISTOGRAM(MOZ_SQLITE_URLCLASSIFIER_SYNC, 1, 10000, 10, EXPONENTIAL, "Time spent
|
|||
HISTOGRAM(MOZ_SQLITE_OTHER_SYNC, 1, 10000, 10, EXPONENTIAL, "Time spent on SQLite fsync() (ms)")
|
||||
HISTOGRAM(STARTUP_MEASUREMENT_ERRORS, 1, 3, 4, LINEAR, "Flags errors in startup calculation()")
|
||||
HISTOGRAM(NETWORK_DISK_CACHE_OPEN, 1, 10000, 10, EXPONENTIAL, "Time spent opening disk cache (ms)")
|
||||
HISTOGRAM(NETWORK_DISK_CACHE_TRASHRENAME, 1, 10000, 10, EXPONENTIAL, "Time spent renaming bad Cache to Cache.Trash (ms)")
|
||||
HISTOGRAM(NETWORK_DISK_CACHE_DELETEDIR, 1, 10000, 10, EXPONENTIAL, "Time spent deleting disk cache (ms)")
|
||||
HISTOGRAM(MOZ_SQLITE_MAIN_THREAD_WAIT_MS, 1, 3000, 10, EXPONENTIAL, "Time spent waiting on SQLite IO on main thread (ms)")
|
||||
HISTOGRAM(MOZ_SQLITE_OTHER_THREAD_WAIT_MS, 1, 3000, 10, EXPONENTIAL, "Time spent waiting on SQLite IO off main thread (ms)")
|
||||
|
|
|
@ -1356,7 +1356,8 @@ nsLocalFile::GetVersionInfoField(const char* aField, nsAString& _retval)
|
|||
nsresult
|
||||
nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
||||
const nsAString &newName,
|
||||
PRBool followSymlinks, PRBool move)
|
||||
PRBool followSymlinks, PRBool move,
|
||||
PRBool skipNtfsAclReset)
|
||||
{
|
||||
nsresult rv;
|
||||
nsAutoString filePath;
|
||||
|
@ -1442,8 +1443,10 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent,
|
|||
|
||||
if (!copyOK) // CopyFileEx and MoveFileEx return zero at failure.
|
||||
rv = ConvertWinError(GetLastError());
|
||||
else if (move) // Set security permissions to inherit from parent.
|
||||
else if (move && !skipNtfsAclReset)
|
||||
{
|
||||
// Set security permissions to inherit from parent.
|
||||
// Note: propagates to all children: slow for big file trees
|
||||
PACL pOldDACL = NULL;
|
||||
PSECURITY_DESCRIPTOR pSD = NULL;
|
||||
::GetNamedSecurityInfoW((LPWSTR)destPath.get(), SE_FILE_OBJECT,
|
||||
|
@ -1476,7 +1479,6 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsAString &newName, PRBool foll
|
|||
if (!newParentDir)
|
||||
{
|
||||
// no parent was specified. We must rename.
|
||||
|
||||
if (newName.IsEmpty())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
|
@ -1542,7 +1544,8 @@ nsLocalFile::CopyMove(nsIFile *aParentDir, const nsAString &newName, PRBool foll
|
|||
if (move || !isDir || (isSymlink && !followSymlinks))
|
||||
{
|
||||
// Copy/Move single file, or move a directory
|
||||
rv = CopySingleFile(this, newParentDir, newName, followSymlinks, move);
|
||||
rv = CopySingleFile(this, newParentDir, newName, followSymlinks, move,
|
||||
!aParentDir);
|
||||
done = NS_SUCCEEDED(rv);
|
||||
// If we are moving a directory and that fails, fallback on directory
|
||||
// enumeration. See bug 231300 for details.
|
||||
|
|
|
@ -123,7 +123,8 @@ private:
|
|||
PRBool followSymlinks, PRBool move);
|
||||
nsresult CopySingleFile(nsIFile *source, nsIFile* dest,
|
||||
const nsAString &newName,
|
||||
PRBool followSymlinks, PRBool move);
|
||||
PRBool followSymlinks, PRBool move,
|
||||
PRBool skipNtfsAclReset = PR_FALSE);
|
||||
|
||||
nsresult SetModDate(PRInt64 aLastModifiedTime, const PRUnichar *filePath);
|
||||
nsresult HasFileAttribute(DWORD fileAttrib, PRBool *_retval);
|
||||
|
|
Загрузка…
Ссылка в новой задаче