mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1034912, part 2 - Remove dangerous public destructor of DeviceStorageFile. r=dhylands
This commit is contained in:
parent
7d76e0867a
commit
23cdfd9cc2
@ -23,7 +23,6 @@
|
||||
#define DEVICESTORAGE_SDCARD "sdcard"
|
||||
#define DEVICESTORAGE_CRASHES "crashes"
|
||||
|
||||
class DeviceStorageFile;
|
||||
class nsIInputStream;
|
||||
class nsIOutputStream;
|
||||
|
||||
@ -39,13 +38,6 @@ class DeviceStorageFileSystem;
|
||||
namespace ipc {
|
||||
class FileDescriptor;
|
||||
}
|
||||
|
||||
template<>
|
||||
struct HasDangerousPublicDestructor<DeviceStorageFile>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
class DeviceStorageFile MOZ_FINAL
|
||||
@ -126,6 +118,7 @@ public:
|
||||
nsresult CreateFileDescriptor(mozilla::ipc::FileDescriptor& aFileDescriptor);
|
||||
|
||||
private:
|
||||
~DeviceStorageFile() {}
|
||||
void Init();
|
||||
void NormalizeFilePath();
|
||||
void AppendRelativePath(const nsAString& aPath);
|
||||
|
@ -142,10 +142,10 @@ GetFreeBytes(const nsAString& aStorageName)
|
||||
// This function makes the assumption that the various types
|
||||
// are all stored on the same filesystem. So we use pictures.
|
||||
|
||||
DeviceStorageFile dsf(NS_LITERAL_STRING(DEVICESTORAGE_PICTURES),
|
||||
aStorageName);
|
||||
nsRefPtr<DeviceStorageFile> dsf(new DeviceStorageFile(NS_LITERAL_STRING(DEVICESTORAGE_PICTURES),
|
||||
aStorageName));
|
||||
int64_t freeBytes = 0;
|
||||
dsf.GetDiskFreeSpace(&freeBytes);
|
||||
dsf->GetDiskFreeSpace(&freeBytes);
|
||||
return freeBytes;
|
||||
}
|
||||
|
||||
@ -3574,8 +3574,8 @@ nsDOMDeviceStorage::GetDefaultStorageName(const nsAString& aStorageType,
|
||||
bool
|
||||
nsDOMDeviceStorage::IsAvailable()
|
||||
{
|
||||
DeviceStorageFile dsf(mStorageType, mStorageName);
|
||||
return dsf.IsAvailable();
|
||||
nsRefPtr<DeviceStorageFile> dsf(new DeviceStorageFile(mStorageType, mStorageName));
|
||||
return dsf->IsAvailable();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
Reference in New Issue
Block a user