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 131513 aee46daa2262
parent 131512 150241980e66
child 131514 3044afa610b2
push id24660
push userryanvm@gmail.com
push date2013-05-10 18:56 +0000
treeherdermozilla-central@1d7c615b4b62 [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;
 }