Bug 629950 - [@ nsIPresShell::RemoveRefreshObserverInternal(nsARefreshObserver*, mozFlushType)], r=bz, a=bz
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 01 Feb 2011 14:44:20 +0800
changeset 61723 8b5cb26bbb1019dd932d7ae9346ed932fa2d9436
parent 61722 155ffb7e886c4f78de14c95dba8680fe6e0bdc2a
child 61724 214a2453b44177352b9ff85b21229a9b9bd66765
push id18454
push usersurkov.alexander@gmail.com
push dateTue, 01 Feb 2011 06:44:54 +0000
treeherdermozilla-central@8b5cb26bbb10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, bz
bugs629950
milestone2.0b11pre
first release with
nightly linux32
8b5cb26bbb10 / 4.0b11pre / 20110201030339 / files
nightly linux64
8b5cb26bbb10 / 4.0b11pre / 20110201030339 / files
nightly mac
8b5cb26bbb10 / 4.0b11pre / 20110201030339 / files
nightly win32
8b5cb26bbb10 / 4.0b11pre / 20110201030339 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 629950 - [@ nsIPresShell::RemoveRefreshObserverInternal(nsARefreshObserver*, mozFlushType)], r=bz, a=bz
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -8172,33 +8172,35 @@ PresShell::Observe(nsISupports* aSubject
   NS_WARNING("unrecognized topic in PresShell::Observe");
   return NS_ERROR_FAILURE;
 }
 
 PRBool
 nsIPresShell::AddRefreshObserverInternal(nsARefreshObserver* aObserver,
                                          mozFlushType aFlushType)
 {
-  return GetPresContext()->RefreshDriver()->
-    AddRefreshObserver(aObserver, aFlushType);
+  nsPresContext* presContext = GetPresContext();
+  return presContext ? presContext->RefreshDriver()->
+    AddRefreshObserver(aObserver, aFlushType) : PR_FALSE;
 }
 
 /* virtual */ PRBool
 nsIPresShell::AddRefreshObserverExternal(nsARefreshObserver* aObserver,
                                          mozFlushType aFlushType)
 {
   return AddRefreshObserverInternal(aObserver, aFlushType);
 }
 
 PRBool
 nsIPresShell::RemoveRefreshObserverInternal(nsARefreshObserver* aObserver,
                                             mozFlushType aFlushType)
 {
-  return GetPresContext()->RefreshDriver()->
-    RemoveRefreshObserver(aObserver, aFlushType);
+  nsPresContext* presContext = GetPresContext();
+  return presContext ? presContext->RefreshDriver()->
+    RemoveRefreshObserver(aObserver, aFlushType) : PR_FALSE;
 }
 
 /* virtual */ PRBool
 nsIPresShell::RemoveRefreshObserverExternal(nsARefreshObserver* aObserver,
                                             mozFlushType aFlushType)
 {
   return RemoveRefreshObserverInternal(aObserver, aFlushType);
 }