mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Backed out changeset 60549faf4734 (bug 1605895) for StreamLoader related failures CLOSED TREE
This commit is contained in:
parent
2a147d1696
commit
069b456ae9
@ -360,9 +360,6 @@ SheetLoadData::SheetLoadData(Loader* aLoader, nsIURI* aURI, StyleSheet* aSheet,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SheetLoadData::~SheetLoadData() {
|
SheetLoadData::~SheetLoadData() {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(mSheetCompleteCalled,
|
|
||||||
"Should always call SheetComplete");
|
|
||||||
|
|
||||||
// Do this iteratively to avoid blowing up the stack.
|
// Do this iteratively to avoid blowing up the stack.
|
||||||
RefPtr<SheetLoadData> next = std::move(mNext);
|
RefPtr<SheetLoadData> next = std::move(mNext);
|
||||||
while (next) {
|
while (next) {
|
||||||
@ -1775,10 +1772,14 @@ void Loader::DoSheetComplete(SheetLoadData& aLoadData,
|
|||||||
// Remove the data from the list of loading datas
|
// Remove the data from the list of loading datas
|
||||||
if (aLoadData.mIsLoading) {
|
if (aLoadData.mIsLoading) {
|
||||||
SheetLoadDataHashKey key(aLoadData);
|
SheetLoadDataHashKey key(aLoadData);
|
||||||
Maybe<SheetLoadData*> loadingData =
|
#ifdef DEBUG
|
||||||
mSheets->mLoadingDatas.GetAndRemove(&key);
|
SheetLoadData* loadingData;
|
||||||
MOZ_DIAGNOSTIC_ASSERT(loadingData && loadingData.value() == &aLoadData);
|
NS_ASSERTION(mSheets->mLoadingDatas.Get(&key, &loadingData) &&
|
||||||
Unused << loadingData;
|
loadingData == &aLoadData,
|
||||||
|
"Bad loading table");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
mSheets->mLoadingDatas.Remove(&key);
|
||||||
aLoadData.mIsLoading = false;
|
aLoadData.mIsLoading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1786,11 +1787,6 @@ void Loader::DoSheetComplete(SheetLoadData& aLoadData,
|
|||||||
// Go through and deal with the whole linked list.
|
// Go through and deal with the whole linked list.
|
||||||
SheetLoadData* data = &aLoadData;
|
SheetLoadData* data = &aLoadData;
|
||||||
do {
|
do {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!data->mSheetCompleteCalled);
|
|
||||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
|
||||||
data->mSheetCompleteCalled = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!data->mSheetAlreadyComplete) {
|
if (!data->mSheetAlreadyComplete) {
|
||||||
// If mSheetAlreadyComplete, then the sheet could well be modified between
|
// If mSheetAlreadyComplete, then the sheet could well be modified between
|
||||||
// when we posted the async call to SheetComplete and now, since the sheet
|
// when we posted the async call to SheetComplete and now, since the sheet
|
||||||
|
@ -196,11 +196,6 @@ class SheetLoadData final : public nsIRunnable, public nsIThreadObserver {
|
|||||||
// is non-null.
|
// is non-null.
|
||||||
const Encoding* mPreloadEncoding;
|
const Encoding* mPreloadEncoding;
|
||||||
|
|
||||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
|
||||||
// Whether SheetComplete was called.
|
|
||||||
bool mSheetCompleteCalled = false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool ShouldDefer() const { return mWasAlternate || !mMediaMatched; }
|
bool ShouldDefer() const { return mWasAlternate || !mMediaMatched; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -20,9 +20,7 @@ namespace css {
|
|||||||
StreamLoader::StreamLoader(SheetLoadData& aSheetLoadData)
|
StreamLoader::StreamLoader(SheetLoadData& aSheetLoadData)
|
||||||
: mSheetLoadData(&aSheetLoadData), mStatus(NS_OK) {}
|
: mSheetLoadData(&aSheetLoadData), mStatus(NS_OK) {}
|
||||||
|
|
||||||
StreamLoader::~StreamLoader() {
|
StreamLoader::~StreamLoader() {}
|
||||||
MOZ_DIAGNOSTIC_ASSERT(mOnStopRequestCalled);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(StreamLoader, nsIStreamListener)
|
NS_IMPL_ISUPPORTS(StreamLoader, nsIStreamListener)
|
||||||
|
|
||||||
@ -51,11 +49,6 @@ StreamLoader::OnStartRequest(nsIRequest* aRequest) {
|
|||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!mOnStopRequestCalled);
|
|
||||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
|
||||||
mOnStopRequestCalled = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Decoded data
|
// Decoded data
|
||||||
nsCString utf8String;
|
nsCString utf8String;
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "nsIStreamListener.h"
|
#include "nsIStreamListener.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "mozilla/css/SheetLoadData.h"
|
#include "mozilla/css/SheetLoadData.h"
|
||||||
#include "mozilla/Assertions.h"
|
|
||||||
|
|
||||||
class nsIInputStream;
|
class nsIInputStream;
|
||||||
|
|
||||||
@ -45,10 +44,6 @@ class StreamLoader : public nsIStreamListener {
|
|||||||
// mBytes, and store all subsequent data in that buffer.
|
// mBytes, and store all subsequent data in that buffer.
|
||||||
nsCString mBytes;
|
nsCString mBytes;
|
||||||
nsAutoCStringN<3> mBOMBytes;
|
nsAutoCStringN<3> mBOMBytes;
|
||||||
|
|
||||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
|
||||||
bool mOnStopRequestCalled = false;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace css
|
} // namespace css
|
||||||
|
Loading…
Reference in New Issue
Block a user