Bug 1184789 - Remove unnecessary IsOuterWindow() check from nsGlobalWindow::GetCaches(). r=khuey
authorMichael Layzell <michael@thelayzells.com>
Thu, 16 Jul 2015 17:19:00 -0400
changeset 253499 b78799c94fdf2b1c74e2b7a5359e47651885481b
parent 253498 a3daf80507807860477b32609aef8a6a45c4d09d
child 253500 3eaf867930dd72d65eb4d1beebe0c1b38a401063
push id29067
push userkwierso@gmail.com
push dateSat, 18 Jul 2015 00:57:04 +0000
treeherdermozilla-central@e2f2eb9ecca0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1184789
milestone42.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 1184789 - Remove unnecessary IsOuterWindow() check from nsGlobalWindow::GetCaches(). r=khuey
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -11105,23 +11105,19 @@ nsGlobalWindow::GetInterface(JSContext* 
 }
 
 already_AddRefed<CacheStorage>
 nsGlobalWindow::GetCaches(ErrorResult& aRv)
 {
   MOZ_ASSERT(IsInnerWindow());
 
   if (!mCacheStorage) {
-    bool forceTrustedOrigin = false;
-    if (IsOuterWindow()) {
-      forceTrustedOrigin = GetServiceWorkersTestingEnabled();
-    } else {
-      nsRefPtr<nsGlobalWindow> outer = GetOuterWindowInternal();
-      forceTrustedOrigin = outer->GetServiceWorkersTestingEnabled();
-    }
+    bool forceTrustedOrigin =
+      GetOuterWindowInternal()->GetServiceWorkersTestingEnabled();
+
     mCacheStorage = CacheStorage::CreateOnMainThread(cache::DEFAULT_NAMESPACE,
                                                      this, GetPrincipal(),
                                                      IsPrivateBrowsing(),
                                                      forceTrustedOrigin, aRv);
   }
 
   nsRefPtr<CacheStorage> ref = mCacheStorage;
   return ref.forget();