Back out d93c07e6bcd2 (Bug 1140597) due to mochitest failures

This commit is contained in:
Dave Hylands 2015-03-27 15:48:20 -07:00
parent 5cf53aa1d4
commit 48b71c9bb0
8 changed files with 1 additions and 75 deletions

View File

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

View File

@ -572,14 +572,6 @@ FileUpdateDispatcher::Observe(nsISupports* aSubject,
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
// the storage types, and if the extension matches, tell them about it.
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
@ -3344,8 +3336,6 @@ NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(nsDOMDeviceStorage, DOMEventTargetHelper)
int nsDOMDeviceStorage::sInstanceCount = 0;
nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow)
: DOMEventTargetHelper(aWindow)
, mIsShareable(false)
@ -3353,8 +3343,6 @@ nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow)
, mIsWatchingFile(false)
, mAllowedToWatchFile(false)
{
MOZ_ASSERT(NS_IsMainThread());
sInstanceCount++;
}
/* virtual */ JSObject*
@ -3438,8 +3426,6 @@ nsDOMDeviceStorage::Init(nsPIDOMWindow* aWindow, const nsAString &aType,
nsDOMDeviceStorage::~nsDOMDeviceStorage()
{
MOZ_ASSERT(NS_IsMainThread());
sInstanceCount--;
}
void

View File

@ -2290,13 +2290,6 @@ ContentChild::RecvFilePathUpdate(const nsString& aStorageType,
const nsString& aPath,
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);
nsString reason;

View File

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

View File

@ -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)
{
nsString volName;

View File

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

View File

@ -124,31 +124,6 @@ nsVolumeService::Callback(const nsAString& aTopic, const nsAString& aState)
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)
{
MonitorAutoLock autoLock(mArrayMonitor);
@ -307,7 +282,6 @@ nsVolumeService::RecvVolumesFromParent(const nsTArray<VolumeInfo>& aVolumes)
// We've already done this, no need to do it again.
return;
}
for (uint32_t i = 0; i < aVolumes.Length(); i++) {
const VolumeInfo& volInfo(aVolumes[i]);
nsRefPtr<nsVolume> vol = new nsVolume(volInfo.name(),

View File

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