Back out d93c07e6bcd2 (Bug 1140597) due to mochitest failures

This commit is contained in:
Dave Hylands 2015-03-27 15:48:20 -07:00
Родитель 5cf53aa1d4
Коммит 48b71c9bb0
8 изменённых файлов: 1 добавлений и 75 удалений

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

@ -196,8 +196,6 @@ public:
explicit nsDOMDeviceStorage(nsPIDOMWindow* aWindow); explicit nsDOMDeviceStorage(nsPIDOMWindow* aWindow);
static int InstanceCount() { return sInstanceCount; }
nsresult Init(nsPIDOMWindow* aWindow, const nsAString& aType, nsresult Init(nsPIDOMWindow* aWindow, const nsAString& aType,
const nsAString& aVolName); const nsAString& aVolName);
@ -321,8 +319,6 @@ private:
const EnumerationParameters& aOptions, bool aEditable, const EnumerationParameters& aOptions, bool aEditable,
ErrorResult& aRv); ErrorResult& aRv);
static int sInstanceCount;
nsString mStorageType; nsString mStorageType;
nsCOMPtr<nsIFile> mRootDirectory; nsCOMPtr<nsIFile> mRootDirectory;
nsString mStorageName; nsString mStorageName;

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

@ -572,14 +572,6 @@ FileUpdateDispatcher::Observe(nsISupports* aSubject,
return NS_OK; return NS_OK;
} }
if (nsDOMDeviceStorage::InstanceCount() == 0) {
// This process doesn't have any nsDOMDeviceStorage instances, so no
// need to send out notifications (since there are no nsDOMDeviceStorage
// instances, we can't create a DeviceStorageFile object).
return NS_OK;
}
// Multiple storage types may match the same files. So walk through each of // Multiple storage types may match the same files. So walk through each of
// the storage types, and if the extension matches, tell them about it. // the storage types, and if the extension matches, tell them about it.
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService(); nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
@ -3344,8 +3336,6 @@ NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper) NS_IMPL_ADDREF_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper) NS_IMPL_RELEASE_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper)
int nsDOMDeviceStorage::sInstanceCount = 0;
nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow) nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow)
: DOMEventTargetHelper(aWindow) : DOMEventTargetHelper(aWindow)
, mIsShareable(false) , mIsShareable(false)
@ -3353,8 +3343,6 @@ nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow)
, mIsWatchingFile(false) , mIsWatchingFile(false)
, mAllowedToWatchFile(false) , mAllowedToWatchFile(false)
{ {
MOZ_ASSERT(NS_IsMainThread());
sInstanceCount++;
} }
/* virtual */ JSObject* /* virtual */ JSObject*
@ -3438,8 +3426,6 @@ nsDOMDeviceStorage::Init(nsPIDOMWindow* aWindow, const nsAString &aType,
nsDOMDeviceStorage::~nsDOMDeviceStorage() nsDOMDeviceStorage::~nsDOMDeviceStorage()
{ {
MOZ_ASSERT(NS_IsMainThread());
sInstanceCount--;
} }
void void

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

@ -2290,13 +2290,6 @@ ContentChild::RecvFilePathUpdate(const nsString& aStorageType,
const nsString& aPath, const nsString& aPath,
const nsCString& aReason) const nsCString& aReason)
{ {
if (nsDOMDeviceStorage::InstanceCount() == 0) {
// No device storage instances in this process. Don't try and
// and create a DeviceStorageFile since it will fail.
return true;
}
nsRefPtr<DeviceStorageFile> dsf = new DeviceStorageFile(aStorageType, aStorageName, aPath); nsRefPtr<DeviceStorageFile> dsf = new DeviceStorageFile(aStorageType, aStorageName, aPath);
nsString reason; nsString reason;

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

@ -8,7 +8,7 @@
interface nsIArray; interface nsIArray;
[scriptable, uuid(879874c6-5532-437a-bf76-703d0c2e7e77)] [scriptable, uuid(c31b182c-61a3-449c-bba8-fd45044499c2)]
interface nsIVolumeService : nsISupports interface nsIVolumeService : nsISupports
{ {
nsIVolume getVolumeByName(in DOMString volName); nsIVolume getVolumeByName(in DOMString volName);
@ -19,8 +19,6 @@ interface nsIVolumeService : nsISupports
nsIArray getVolumeNames(); nsIArray getVolumeNames();
void Dump(in DOMString label);
/* for test case only to simulate sdcard insertion/removal */ /* for test case only to simulate sdcard insertion/removal */
void createFakeVolume(in DOMString name, in DOMString path); void createFakeVolume(in DOMString name, in DOMString path);
void SetFakeVolumeState(in DOMString name, in long state); void SetFakeVolumeState(in DOMString name, in long state);

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

@ -66,23 +66,6 @@ nsVolume::nsVolume(const Volume* aVolume)
{ {
} }
void nsVolume::Dump(const char* aLabel) const
{
LOG("%s: Volume: %s is %s and %s @ %s gen %d locked %d",
aLabel,
NameStr().get(),
StateStr(),
IsMediaPresent() ? "inserted" : "missing",
MountPointStr().get(),
MountGeneration(),
(int)IsMountLocked());
LOG("%s: IsSharing %s IsFormating %s IsUnmounting %s",
aLabel,
(IsSharing() ? "y" : "n"),
(IsFormatting() ? "y" : "n"),
(IsUnmounting() ? "y" : "n"));
}
bool nsVolume::Equals(nsIVolume* aVolume) bool nsVolume::Equals(nsIVolume* aVolume)
{ {
nsString volName; nsString volName;

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

@ -73,8 +73,6 @@ public:
const nsString& Name() const { return mName; } const nsString& Name() const { return mName; }
nsCString NameStr() const { return NS_LossyConvertUTF16toASCII(mName); } nsCString NameStr() const { return NS_LossyConvertUTF16toASCII(mName); }
void Dump(const char* aLabel) const;
int32_t MountGeneration() const { return mMountGeneration; } int32_t MountGeneration() const { return mMountGeneration; }
bool IsMountLocked() const { return mMountLocked; } bool IsMountLocked() const { return mMountLocked; }

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

@ -124,31 +124,6 @@ nsVolumeService::Callback(const nsAString& aTopic, const nsAString& aState)
return NS_OK; return NS_OK;
} }
void nsVolumeService::DumpNoLock(const char* aLabel)
{
mArrayMonitor.AssertCurrentThreadOwns();
nsVolume::Array::size_type numVolumes = mVolumeArray.Length();
if (numVolumes == 0) {
LOG("%s: No Volumes!", aLabel);
return;
}
nsVolume::Array::index_type volIndex;
for (volIndex = 0; volIndex < numVolumes; volIndex++) {
nsRefPtr<nsVolume> vol = mVolumeArray[volIndex];
vol->Dump(aLabel);
}
}
NS_IMETHODIMP
nsVolumeService::Dump(const nsAString& aLabel)
{
MonitorAutoLock autoLock(mArrayMonitor);
DumpNoLock(NS_LossyConvertUTF16toASCII(aLabel).get());
return NS_OK;
}
NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVolume **aResult) NS_IMETHODIMP nsVolumeService::GetVolumeByName(const nsAString& aVolName, nsIVolume **aResult)
{ {
MonitorAutoLock autoLock(mArrayMonitor); MonitorAutoLock autoLock(mArrayMonitor);
@ -307,7 +282,6 @@ nsVolumeService::RecvVolumesFromParent(const nsTArray<VolumeInfo>& aVolumes)
// We've already done this, no need to do it again. // We've already done this, no need to do it again.
return; return;
} }
for (uint32_t i = 0; i < aVolumes.Length(); i++) { for (uint32_t i = 0; i < aVolumes.Length(); i++) {
const VolumeInfo& volInfo(aVolumes[i]); const VolumeInfo& volInfo(aVolumes[i]);
nsRefPtr<nsVolume> vol = new nsVolume(volInfo.name(), nsRefPtr<nsVolume> vol = new nsVolume(volInfo.name(),

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

@ -45,8 +45,6 @@ public:
//static nsVolumeService* GetSingleton(); //static nsVolumeService* GetSingleton();
static void Shutdown(); static void Shutdown();
void DumpNoLock(const char* aLabel);
void UpdateVolume(nsIVolume* aVolume, bool aNotifyObservers = true); void UpdateVolume(nsIVolume* aVolume, bool aNotifyObservers = true);
void UpdateVolumeIOThread(const Volume* aVolume); void UpdateVolumeIOThread(const Volume* aVolume);