Skip to content

Commit

Permalink
Backed out 5 changesets (bug 910412) for intermittent crash whack-a-m…
Browse files Browse the repository at this point in the history
…ole.

Backed out changeset e3eb9463b3e1 (bug 910412)
Backed out changeset d5863d302bde (bug 910412)
Backed out changeset 422b66d4b1ca (bug 910412)
Backed out changeset 3431d59d752e (bug 910412)
Backed out changeset b1c0310cdac1 (bug 910412)
  • Loading branch information
rvandermeulen committed Mar 11, 2014
1 parent 83c8495 commit a154cec
Show file tree
Hide file tree
Showing 43 changed files with 25 additions and 3,151 deletions.
8 changes: 0 additions & 8 deletions dom/base/domerr.msg
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ DOM4_MSG_DEF(QuotaExceededError, "The current transaction exceeded its quota lim

DOM_MSG_DEF(NS_ERROR_DOM_INDEXEDDB_RECOVERABLE_ERR, "The operation failed because the database was prevented from taking an action. The operation might be able to succeed if the application performs some recovery steps and retries the entire transaction. For example, there was not enough remaining storage space, or the storage quota was reached and the user declined to give more space to the database.")

/* FileSystem DOM errors. */
DOM4_MSG_DEF(InvalidAccessError, "Invalid file system path.", NS_ERROR_DOM_FILESYSTEM_INVALID_PATH_ERR)
DOM4_MSG_DEF(InvalidModificationError, "Failed to modify the file.", NS_ERROR_DOM_FILESYSTEM_INVALID_MODIFICATION_ERR)
DOM4_MSG_DEF(NoModificationAllowedError, "Modifications are not allowed for this file", NS_ERROR_DOM_FILESYSTEM_NO_MODIFICATION_ALLOWED_ERR)
DOM4_MSG_DEF(AbortError, "File already exists.", NS_ERROR_DOM_FILESYSTEM_PATH_EXISTS_ERR)
DOM4_MSG_DEF(TypeMismatchError, "The type of the file is incompatible with the expected type.", NS_ERROR_DOM_FILESYSTEM_TYPE_MISMATCH_ERR)
DOM4_MSG_DEF(UnknownError, "The operation failed for reasons unrelated to the file system itself and not covered by any other error code.", NS_ERROR_DOM_FILESYSTEM_UNKNOWN_ERR)

/* DOM error codes defined by us */

/* XXX string should be specified by norris */
Expand Down
9 changes: 0 additions & 9 deletions dom/devicestorage/DeviceStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ namespace dom {
class DeviceStorageEnumerationParameters;
class DOMCursor;
class DOMRequest;
class Promise;
class DeviceStorageFileSystem;
} // namespace dom
namespace ipc {
class FileDescriptor;
Expand Down Expand Up @@ -159,8 +157,6 @@ class nsDOMDeviceStorage MOZ_FINAL
EnumerationParameters;
typedef mozilla::dom::DOMCursor DOMCursor;
typedef mozilla::dom::DOMRequest DOMRequest;
typedef mozilla::dom::Promise Promise;
typedef mozilla::dom::DeviceStorageFileSystem DeviceStorageFileSystem;
public:
typedef nsTArray<nsString> VolumeNameArray;

Expand Down Expand Up @@ -259,9 +255,6 @@ class nsDOMDeviceStorage MOZ_FINAL

// Uses XPCOM GetStorageName

already_AddRefed<Promise>
GetRoot();

static void
CreateDeviceStorageFor(nsPIDOMWindow* aWin,
const nsAString& aType,
Expand Down Expand Up @@ -339,8 +332,6 @@ class nsDOMDeviceStorage MOZ_FINAL
DEVICE_STORAGE_TYPE_SHARED,
DEVICE_STORAGE_TYPE_EXTERNAL
};

nsRefPtr<DeviceStorageFileSystem> mFileSystem;
};

#endif
48 changes: 25 additions & 23 deletions dom/devicestorage/nsDeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/DeviceStorageBinding.h"
#include "mozilla/dom/DeviceStorageFileSystem.h"
#include "mozilla/dom/devicestorage/PDeviceStorageRequestChild.h"
#include "mozilla/dom/Directory.h"
#include "mozilla/dom/FileSystemUtils.h"
#include "mozilla/dom/ipc/Blob.h"
#include "mozilla/dom/PBrowserChild.h"
#include "mozilla/dom/PContentPermissionRequestChild.h"
#include "mozilla/dom/PermissionMessageUtils.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/LazyIdleThread.h"
#include "mozilla/Preferences.h"
#include "mozilla/Scoped.h"
Expand Down Expand Up @@ -895,7 +891,14 @@ DeviceStorageFile::IsSafePath(const nsAString& aPath)

void
DeviceStorageFile::NormalizeFilePath() {
FileSystemUtils::LocalPathToNormalizedPath(mPath, mPath);
#if defined(XP_WIN)
char16_t* cur = mPath.BeginWriting();
char16_t* end = mPath.EndWriting();
for (; cur < end; ++cur) {
if (char16_t('\\') == *cur)
*cur = char16_t('/');
}
#endif
}

void
Expand All @@ -913,9 +916,23 @@ DeviceStorageFile::AppendRelativePath(const nsAString& aPath) {
NS_WARNING(NS_LossyConvertUTF16toASCII(aPath).get());
return;
}
nsString localPath;
FileSystemUtils::NormalizedPathToLocalPath(aPath, localPath);
mFile->AppendRelativePath(localPath);
#if defined(XP_WIN)
// replace forward slashes with backslashes,
// since nsLocalFileWin chokes on them
nsString temp;
temp.Assign(aPath);

char16_t* cur = temp.BeginWriting();
char16_t* end = temp.EndWriting();

for (; cur < end; ++cur) {
if (char16_t('/') == *cur)
*cur = char16_t('\\');
}
mFile->AppendRelativePath(temp);
#else
mFile->AppendRelativePath(aPath);
#endif
}

nsresult
Expand Down Expand Up @@ -3056,11 +3073,6 @@ nsDOMDeviceStorage::Shutdown()
{
MOZ_ASSERT(NS_IsMainThread());

if (mFileSystem) {
mFileSystem->SetDeviceStorage(nullptr);
mFileSystem = nullptr;
}

if (!mStorageName.IsEmpty()) {
UnregisterForSDCardChanges(this);
}
Expand Down Expand Up @@ -3799,16 +3811,6 @@ nsDOMDeviceStorage::Default()
return mStorageName.Equals(defaultStorageName);
}

already_AddRefed<Promise>
nsDOMDeviceStorage::GetRoot()
{
if (!mFileSystem) {
mFileSystem = new DeviceStorageFileSystem(mStorageType, mStorageName);
mFileSystem->SetDeviceStorage(this);
}
return mozilla::dom::Directory::GetRoot(mFileSystem);
}

NS_IMETHODIMP
nsDOMDeviceStorage::GetDefault(bool* aDefault)
{
Expand Down
1 change: 0 additions & 1 deletion dom/devicestorage/test/chrome.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[DEFAULT]

[test_app_permissions.html]
[test_fs_app_permissions.html]
5 changes: 0 additions & 5 deletions dom/devicestorage/test/mochitest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,3 @@ support-files = devicestorage_common.js
[test_usedSpace.html]
[test_watch.html]
[test_watchOther.html]

# FileSystem API tests
[test_fs_basic.html]
[test_fs_createDirectory.html]
[test_fs_get.html]
Loading

0 comments on commit a154cec

Please sign in to comment.