Bug 1494745 part 4 - Make Loader::AddObserver void since it's infallible. r=bz

mObservers is a nsTObserverArray which is infallible, so no need to
check the return value from AppendElementUnlessExists
(which a later patch in this series will remove).
This commit is contained in:
Mats Palmgren 2018-10-14 18:12:23 +02:00
Родитель f29a7e848d
Коммит e608cdac05
3 изменённых файлов: 5 добавлений и 9 удалений

Просмотреть файл

@ -319,8 +319,8 @@ nsXMLContentSink::DidBuildModel(bool aTerminated)
// We're pretty-printing now. See whether we should wait up on
// stylesheet loads
if (mDocument->CSSLoader()->HasPendingLoads() &&
NS_SUCCEEDED(mDocument->CSSLoader()->AddObserver(this))) {
if (mDocument->CSSLoader()->HasPendingLoads()) {
mDocument->CSSLoader()->AddObserver(this);
// wait for those sheets to load
startLayout = false;
}

Просмотреть файл

@ -2570,15 +2570,11 @@ Loader::HasPendingLoads()
mDatasToNotifyOn != 0;
}
nsresult
void
Loader::AddObserver(nsICSSLoaderObserver* aObserver)
{
MOZ_ASSERT(aObserver, "Must have observer");
if (mObservers.AppendElementUnlessExists(aObserver)) {
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
mObservers.AppendElementUnlessExists(aObserver);
}
void

Просмотреть файл

@ -429,7 +429,7 @@ public:
*
* aObserver must not be null.
*/
nsresult AddObserver(nsICSSLoaderObserver* aObserver);
void AddObserver(nsICSSLoaderObserver* aObserver);
/**
* Remove an observer added via AddObserver.