зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f29a7e848d
Коммит
e608cdac05
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче