Bug 1177764 - Use nsTObserverArray in APZCCallbackHelper, r=kats, r=dholbert

This commit is contained in:
Andrea Marchesini 2015-06-26 13:20:10 -07:00
parent cc1658cfcb
commit 1a9521dd83
2 changed files with 6 additions and 3 deletions

View File

@ -1822,8 +1822,10 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
mozilla::Telemetry::AccumulateTimeDelta(mozilla::Telemetry::REFRESH_DRIVER_TICK, mTickStart);
#endif
for (nsAPostRefreshObserver* postRefreshObserver: mPostRefreshObservers) {
postRefreshObserver->DidRefresh();
nsTObserverArray<nsAPostRefreshObserver*>::ForwardIterator iter(mPostRefreshObservers);
while (iter.HasMore()) {
nsAPostRefreshObserver* observer = iter.GetNext();
observer->DidRefresh();
}
NS_ASSERTION(mInRefresh, "Still in refresh");

View File

@ -17,6 +17,7 @@
#include "nsTObserverArray.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "nsTObserverArray.h"
#include "nsClassHashtable.h"
#include "nsHashKeys.h"
#include "mozilla/Attributes.h"
@ -408,7 +409,7 @@ private:
// nsTArray on purpose, because we want to be able to swap.
nsTArray<nsIDocument*> mFrameRequestCallbackDocs;
nsTArray<nsIDocument*> mThrottledFrameRequestCallbackDocs;
nsTArray<nsAPostRefreshObserver*> mPostRefreshObservers;
nsTObserverArray<nsAPostRefreshObserver*> mPostRefreshObservers;
// Helper struct for processing image requests
struct ImageRequestParameters {