Bug 870598 - Don't send the frameloader-visibility-changed notification if the frameloader's visibility didn't actually change. r=khuey
authorJustin Lebar <justin.lebar@gmail.com>
Fri, 10 May 2013 11:46:08 -0400
changeset 131543 aee46daa226279adc52e2f30f1b825418cfb9f0e
parent 131542 150241980e66d828ea9803db901f3f15cda134f0
child 131544 3044afa610b2bf2da2893a4fbedb86161ee36ee9
push id27891
push userryanvm@gmail.com
push dateFri, 10 May 2013 18:57:52 +0000
treeherdermozilla-inbound@ada852fc265a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs870598
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 870598 - Don't send the frameloader-visibility-changed notification if the frameloader's visibility didn't actually change. r=khuey
content/base/src/nsFrameLoader.cpp
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -2549,16 +2549,20 @@ nsFrameLoader::ResetPermissionManagerSta
     mAppIdSentToPermissionManager = appId;
     permMgr->AddrefAppId(mAppIdSentToPermissionManager);
   }
 }
 
 /* [infallible] */ NS_IMETHODIMP
 nsFrameLoader::SetVisible(bool aVisible)
 {
+  if (mVisible == aVisible) {
+    return NS_OK;
+  }
+
   mVisible = aVisible;
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   if (os) {
     os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this),
                         "frameloader-visible-changed", nullptr);
   }
   return NS_OK;
 }