Bug 1506965 - Make variables atomic to avoid data race r=mayhemer

Differential Revision: https://phabricator.services.mozilla.com/D13243

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2018-12-05 15:58:21 +00:00
parent c6e7cec8be
commit bf8dd3ab51
2 changed files with 9 additions and 10 deletions

View File

@ -175,6 +175,8 @@ HttpChannelChild::HttpChannelChild()
mDivertingToParent(false),
mFlushedForDiversion(false),
mIsFromCache(false),
mCacheNeedToReportBytesReadInitialized(false),
mNeedToReportBytesRead(true),
mCacheEntryAvailable(false),
mAltDataCacheEntryAvailable(false),
mSendResumeAt(false),
@ -186,9 +188,7 @@ HttpChannelChild::HttpChannelChild()
mPostRedirectChannelShouldIntercept(false),
mPostRedirectChannelShouldUpgrade(false),
mShouldParentIntercept(false),
mSuspendParentAfterSynthesizeResponse(false),
mCacheNeedToReportBytesReadInitialized(false),
mNeedToReportBytesRead(true) {
mSuspendParentAfterSynthesizeResponse(false) {
LOG(("Creating HttpChannelChild @%p\n", this));
mChannelCreationTime = PR_Now();

View File

@ -387,7 +387,12 @@ class HttpChannelChild final : public PHttpChannelChild,
// parent channel, nor dequeued from the ChannelEventQueue.
Atomic<bool, ReleaseAcquire> mFlushedForDiversion;
uint8_t mIsFromCache : 1;
Atomic<bool, SequentiallyConsistent> mIsFromCache;
// Set if we get the result and cache |mNeedToReportBytesRead|
Atomic<bool, SequentiallyConsistent> mCacheNeedToReportBytesReadInitialized;
// True if we need to tell the parent the size of unreported received data
Atomic<bool, SequentiallyConsistent> mNeedToReportBytesRead;
uint8_t mCacheEntryAvailable : 1;
uint8_t mAltDataCacheEntryAvailable : 1;
@ -428,12 +433,6 @@ class HttpChannelChild final : public PHttpChannelChild,
// is synthesized.
uint8_t mSuspendParentAfterSynthesizeResponse : 1;
// Set if we get the result and cache |mNeedToReportBytesRead|
uint8_t mCacheNeedToReportBytesReadInitialized : 1;
// True if we need to tell the parent the size of unreported received data
uint8_t mNeedToReportBytesRead : 1;
void FinishInterceptedRedirect();
void CleanupRedirectingChannel(nsresult rv);