Backed out changeset 60549faf4734 (bug 1605895) for StreamLoader related failures CLOSED TREE

This commit is contained in:
Bogdan Tara 2020-02-14 14:35:46 +02:00
parent 2a147d1696
commit 069b456ae9
4 changed files with 9 additions and 30 deletions

View File

@ -360,9 +360,6 @@ SheetLoadData::SheetLoadData(Loader* aLoader, nsIURI* aURI, StyleSheet* aSheet,
}
SheetLoadData::~SheetLoadData() {
MOZ_DIAGNOSTIC_ASSERT(mSheetCompleteCalled,
"Should always call SheetComplete");
// Do this iteratively to avoid blowing up the stack.
RefPtr<SheetLoadData> next = std::move(mNext);
while (next) {
@ -1775,10 +1772,14 @@ void Loader::DoSheetComplete(SheetLoadData& aLoadData,
// Remove the data from the list of loading datas
if (aLoadData.mIsLoading) {
SheetLoadDataHashKey key(aLoadData);
Maybe<SheetLoadData*> loadingData =
mSheets->mLoadingDatas.GetAndRemove(&key);
MOZ_DIAGNOSTIC_ASSERT(loadingData && loadingData.value() == &aLoadData);
Unused << loadingData;
#ifdef DEBUG
SheetLoadData* loadingData;
NS_ASSERTION(mSheets->mLoadingDatas.Get(&key, &loadingData) &&
loadingData == &aLoadData,
"Bad loading table");
#endif
mSheets->mLoadingDatas.Remove(&key);
aLoadData.mIsLoading = false;
}
}
@ -1786,11 +1787,6 @@ void Loader::DoSheetComplete(SheetLoadData& aLoadData,
// Go through and deal with the whole linked list.
SheetLoadData* data = &aLoadData;
do {
MOZ_DIAGNOSTIC_ASSERT(!data->mSheetCompleteCalled);
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
data->mSheetCompleteCalled = true;
#endif
if (!data->mSheetAlreadyComplete) {
// If mSheetAlreadyComplete, then the sheet could well be modified between
// when we posted the async call to SheetComplete and now, since the sheet

View File

@ -196,11 +196,6 @@ class SheetLoadData final : public nsIRunnable, public nsIThreadObserver {
// is non-null.
const Encoding* mPreloadEncoding;
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
// Whether SheetComplete was called.
bool mSheetCompleteCalled = false;
#endif
bool ShouldDefer() const { return mWasAlternate || !mMediaMatched; }
private:

View File

@ -20,9 +20,7 @@ namespace css {
StreamLoader::StreamLoader(SheetLoadData& aSheetLoadData)
: mSheetLoadData(&aSheetLoadData), mStatus(NS_OK) {}
StreamLoader::~StreamLoader() {
MOZ_DIAGNOSTIC_ASSERT(mOnStopRequestCalled);
}
StreamLoader::~StreamLoader() {}
NS_IMPL_ISUPPORTS(StreamLoader, nsIStreamListener)
@ -51,11 +49,6 @@ StreamLoader::OnStartRequest(nsIRequest* aRequest) {
NS_IMETHODIMP
StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
MOZ_DIAGNOSTIC_ASSERT(!mOnStopRequestCalled);
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
mOnStopRequestCalled = true;
#endif
// Decoded data
nsCString utf8String;
{

View File

@ -10,7 +10,6 @@
#include "nsIStreamListener.h"
#include "nsString.h"
#include "mozilla/css/SheetLoadData.h"
#include "mozilla/Assertions.h"
class nsIInputStream;
@ -45,10 +44,6 @@ class StreamLoader : public nsIStreamListener {
// mBytes, and store all subsequent data in that buffer.
nsCString mBytes;
nsAutoCStringN<3> mBOMBytes;
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
bool mOnStopRequestCalled = false;
#endif
};
} // namespace css