Bug 1279246 - Hang due to CacheFileInputStream deadlock, r=honzab

This commit is contained in:
Michal Novotny
2016-07-12 17:58:38 +02:00
parent 1df8e08439
commit 4a34f169ee
8 changed files with 695 additions and 321 deletions

View File

@@ -43,22 +43,24 @@ private:
virtual ~CacheFileInputStream();
nsresult CloseWithStatusLocked(nsresult aStatus);
void CleanUp();
void ReleaseChunk();
void EnsureCorrectChunk(bool aReleaseOnly);
// CanRead returns negative value when output stream truncates the data before
// the input stream's mPos.
void CanRead(int64_t *aCanRead, const char **aBuf);
int64_t CanRead(CacheFileChunkReadHandle *aHandle);
void NotifyListener();
void MaybeNotifyListener();
RefPtr<CacheFile> mFile;
RefPtr<CacheFile> mFile;
RefPtr<CacheFileChunk> mChunk;
int64_t mPos;
bool mClosed;
nsresult mStatus;
bool mWaitingForUpdate;
int64_t mListeningForChunk;
int64_t mPos;
nsresult mStatus;
bool mClosed : 1;
bool mInReadSegments : 1;
bool mWaitingForUpdate : 1;
int64_t mListeningForChunk;
nsCOMPtr<nsIInputStreamCallback> mCallback;
uint32_t mCallbackFlags;