mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 939509 - File constuctor should use lastModified attribute, r=bz
This commit is contained in:
parent
dff0b85534
commit
98235662c7
@ -616,6 +616,10 @@ File::Constructor(
|
||||
}
|
||||
MOZ_ASSERT(impl->IsFile());
|
||||
|
||||
if (aBag.mLastModified.WasPassed()) {
|
||||
impl->SetLastModified(aBag.mLastModified.Value());
|
||||
}
|
||||
|
||||
nsRefPtr<File> file = new File(aGlobal.GetAsSupports(), impl);
|
||||
return file.forget();
|
||||
}
|
||||
@ -792,6 +796,12 @@ FileImplBase::GetLastModified(ErrorResult& aRv)
|
||||
return mLastModificationDate / PR_USEC_PER_MSEC;
|
||||
}
|
||||
|
||||
void
|
||||
FileImplBase::SetLastModified(int64_t aLastModified)
|
||||
{
|
||||
mLastModificationDate = aLastModified * PR_USEC_PER_MSEC;
|
||||
}
|
||||
|
||||
int64_t
|
||||
FileImplBase::GetFileId()
|
||||
{
|
||||
@ -1015,6 +1025,12 @@ FileImplFile::GetLastModified(ErrorResult& aRv)
|
||||
return mLastModificationDate;
|
||||
}
|
||||
|
||||
void
|
||||
FileImplFile::SetLastModified(int64_t aLastModified)
|
||||
{
|
||||
MOZ_CRASH("SetLastModified of a real file is not allowed!");
|
||||
}
|
||||
|
||||
const uint32_t sFileStreamFlags =
|
||||
nsIFileInputStream::CLOSE_ON_EOF |
|
||||
nsIFileInputStream::REOPEN_ON_REWIND |
|
||||
|
@ -236,6 +236,8 @@ public:
|
||||
|
||||
virtual int64_t GetLastModified(ErrorResult& aRv) = 0;
|
||||
|
||||
virtual void SetLastModified(int64_t aLastModified) = 0;
|
||||
|
||||
virtual void GetMozFullPath(nsAString& aName, ErrorResult& aRv) = 0;
|
||||
|
||||
virtual void GetMozFullPathInternal(nsAString& aFileName, ErrorResult& aRv) = 0;
|
||||
@ -362,6 +364,8 @@ public:
|
||||
|
||||
virtual int64_t GetLastModified(ErrorResult& aRv) MOZ_OVERRIDE;
|
||||
|
||||
virtual void SetLastModified(int64_t aLastModified) MOZ_OVERRIDE;
|
||||
|
||||
virtual void GetMozFullPath(nsAString& aName, ErrorResult& aRv) MOZ_OVERRIDE;
|
||||
|
||||
virtual void GetMozFullPathInternal(nsAString& aFileName,
|
||||
@ -738,6 +742,7 @@ public:
|
||||
virtual uint64_t GetSize(ErrorResult& aRv) MOZ_OVERRIDE;
|
||||
virtual void GetType(nsAString& aType) MOZ_OVERRIDE;
|
||||
virtual int64_t GetLastModified(ErrorResult& aRv) MOZ_OVERRIDE;
|
||||
virtual void SetLastModified(int64_t aLastModified) MOZ_OVERRIDE;
|
||||
virtual void GetMozFullPathInternal(nsAString& aFullPath,
|
||||
ErrorResult& aRv) MOZ_OVERRIDE;
|
||||
virtual nsresult GetInternalStream(nsIInputStream**) MOZ_OVERRIDE;
|
||||
|
Loading…
Reference in New Issue
Block a user