Backed out changeset 00be9983e8c2 a=me

This commit is contained in:
Doug Turner 2012-10-18 11:45:44 -07:00
Родитель c31134ae0a
Коммит ac7455e35a
1 изменённых файлов: 11 добавлений и 42 удалений

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

@ -54,14 +54,14 @@ public:
void
SetLazyData(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, uint64_t aLastModifiedDate)
uint64_t aLength)
{
NS_ASSERTION(aLength, "must have length");
mName = aName;
mContentType = aContentType;
mLength = aLength;
mLastModificationDate = aLastModifiedDate;
mIsFile = !aName.IsVoid();
}
@ -70,25 +70,11 @@ public:
return mLength == UINT64_MAX;
}
bool IsDateUnknown() const
{
return mIsFile && mLastModificationDate == UINT64_MAX;
}
protected:
nsDOMFileBase(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, uint64_t aLastModifiedDate)
: mIsFile(true), mImmutable(false), mContentType(aContentType),
mName(aName), mStart(0), mLength(aLength), mLastModificationDate(aLastModifiedDate)
{
// Ensure non-null mContentType by default
mContentType.SetIsVoid(false);
}
nsDOMFileBase(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength)
: mIsFile(true), mImmutable(false), mContentType(aContentType),
mName(aName), mStart(0), mLength(aLength), mLastModificationDate(UINT64_MAX)
mName(aName), mStart(0), mLength(aLength)
{
// Ensure non-null mContentType by default
mContentType.SetIsVoid(false);
@ -96,7 +82,7 @@ protected:
nsDOMFileBase(const nsAString& aContentType, uint64_t aLength)
: mIsFile(false), mImmutable(false), mContentType(aContentType),
mStart(0), mLength(aLength), mLastModificationDate(UINT64_MAX)
mStart(0), mLength(aLength)
{
// Ensure non-null mContentType by default
mContentType.SetIsVoid(false);
@ -105,7 +91,7 @@ protected:
nsDOMFileBase(const nsAString& aContentType, uint64_t aStart,
uint64_t aLength)
: mIsFile(false), mImmutable(false), mContentType(aContentType),
mStart(aStart), mLength(aLength), mLastModificationDate(UINT64_MAX)
mStart(aStart), mLength(aLength)
{
NS_ASSERTION(aLength != UINT64_MAX,
"Must know length when creating slice");
@ -141,15 +127,12 @@ protected:
bool mIsFile;
bool mImmutable;
nsString mContentType;
nsString mName;
uint64_t mStart;
uint64_t mLength;
uint64_t mLastModificationDate;
// Protected by IndexedDatabaseManager::FileMutex()
nsTArray<nsRefPtr<FileInfo> > mFileInfos;
};
@ -157,11 +140,6 @@ protected:
class nsDOMFile : public nsDOMFileBase
{
public:
nsDOMFile(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, uint64_t aLastModifiedDate)
: nsDOMFileBase(aName, aContentType, aLength, aLastModifiedDate)
{ }
nsDOMFile(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength)
: nsDOMFileBase(aName, aContentType, aLength)
@ -205,7 +183,7 @@ class nsDOMFileFile : public nsDOMFile,
public:
// Create as a file
nsDOMFileFile(nsIFile *aFile)
: nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX, UINT64_MAX),
: nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX),
mFile(aFile), mWholeFile(true), mStoredFile(false)
{
NS_ASSERTION(mFile, "must have file");
@ -217,15 +195,7 @@ public:
// Create as a file
nsDOMFileFile(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, nsIFile *aFile)
: nsDOMFile(aName, aContentType, aLength, UINT64_MAX),
mFile(aFile), mWholeFile(true), mStoredFile(false)
{
NS_ASSERTION(mFile, "must have file");
}
nsDOMFileFile(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, nsIFile *aFile, uint64_t aLastModificationDate)
: nsDOMFile(aName, aContentType, aLength, aLastModificationDate),
: nsDOMFile(aName, aContentType, aLength),
mFile(aFile), mWholeFile(true), mStoredFile(false)
{
NS_ASSERTION(mFile, "must have file");
@ -243,7 +213,7 @@ public:
// Create as a file with custom name
nsDOMFileFile(nsIFile *aFile, const nsAString& aName)
: nsDOMFile(aName, EmptyString(), UINT64_MAX, UINT64_MAX),
: nsDOMFile(aName, EmptyString(), UINT64_MAX),
mFile(aFile), mWholeFile(true), mStoredFile(false)
{
NS_ASSERTION(mFile, "must have file");
@ -255,7 +225,7 @@ public:
nsDOMFileFile(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, nsIFile* aFile,
FileInfo* aFileInfo)
: nsDOMFile(aName, aContentType, aLength, UINT64_MAX),
: nsDOMFile(aName, aContentType, aLength),
mFile(aFile), mWholeFile(true), mStoredFile(true)
{
NS_ASSERTION(mFile, "must have file");
@ -274,7 +244,7 @@ public:
// Create as a file to be later initialized
nsDOMFileFile()
: nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX, UINT64_MAX),
: nsDOMFile(EmptyString(), EmptyString(), UINT64_MAX),
mWholeFile(true), mStoredFile(false)
{
// Lazily get the content type and size
@ -294,8 +264,7 @@ public:
// Overrides
NS_IMETHOD GetSize(uint64_t* aSize);
NS_IMETHOD GetType(nsAString& aType);
NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::Value* aLastModifiedDate);
NS_IMETHOD GetMozLastModifiedDate(uint64_t* aLastModifiedDate);
NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::Value *aLastModifiedDate);
NS_IMETHOD GetMozFullPathInternal(nsAString& aFullPath);
NS_IMETHOD GetInternalStream(nsIInputStream**);