mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1735484 - avoid crashing in nsRefreshDriver::RemoveImageRequest when mPresContext is null, r=emilio.
Differential Revision: https://phabricator.services.mozilla.com/D129506
This commit is contained in:
parent
43016d43a8
commit
b50386c085
@ -1130,6 +1130,9 @@ RefreshDriverTimer* nsRefreshDriver::ChooseTimer() {
|
||||
}
|
||||
|
||||
static nsDocShell* GetDocShell(nsPresContext* aPresContext) {
|
||||
if (!aPresContext) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<nsDocShell*>(aPresContext->GetDocShell());
|
||||
}
|
||||
|
||||
@ -1236,12 +1239,10 @@ void nsRefreshDriver::AddRefreshObserver(nsARefreshObserver* aObserver,
|
||||
FlushType aFlushType,
|
||||
const char* aObserverDescription) {
|
||||
ObserverArray& array = ArrayFor(aFlushType);
|
||||
array.AppendElement(ObserverData{
|
||||
aObserver, aObserverDescription, TimeStamp::Now(),
|
||||
mPresContext
|
||||
? MarkerInnerWindowIdFromDocShell(mPresContext->GetDocShell())
|
||||
: MarkerInnerWindowId::NoId(),
|
||||
profiler_capture_backtrace(), aFlushType});
|
||||
array.AppendElement(
|
||||
ObserverData{aObserver, aObserverDescription, TimeStamp::Now(),
|
||||
MarkerInnerWindowIdFromDocShell(GetDocShell(mPresContext)),
|
||||
profiler_capture_backtrace(), aFlushType});
|
||||
EnsureTimerStarted();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user