Bug 968804 - Part e: Add outer window assertions to PreloadLocalStorage; r=peterv
authorMs2ger <ms2ger@gmail.com>
Tue, 20 May 2014 21:50:58 +0200
changeset 184010 11cb08d1670c4ae824e21bcf44315ab2b18d3a9c
parent 184009 e5a6f6fb6db301945c308d50707f5dad9fb9038b
child 184011 f0a563b325eb794f223a8c32a058c84587ae8a1f
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs968804
milestone32.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 968804 - Part e: Add outer window assertions to PreloadLocalStorage; r=peterv
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2685,16 +2685,18 @@ nsGlobalWindow::SetNewDocument(nsIDocume
   PreloadLocalStorage();
 
   return NS_OK;
 }
 
 void
 nsGlobalWindow::PreloadLocalStorage()
 {
+  MOZ_ASSERT(IsOuterWindow());
+
   if (!Preferences::GetBool(kStorageEnabled)) {
     return;
   }
 
   if (IsChromeWindow()) {
     return;
   }
 
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -1343,16 +1343,17 @@ protected:
                            const nsAString& aPseudoElt,
                            bool aDefaultStylesOnly,
                            mozilla::ErrorResult& aError);
   nsresult GetComputedStyleHelper(nsIDOMElement* aElt,
                                   const nsAString& aPseudoElt,
                                   bool aDefaultStylesOnly,
                                   nsIDOMCSSStyleDeclaration** aReturn);
 
+  // Outer windows only.
   void PreloadLocalStorage();
 
   // Returns device pixels.  Outer windows only.
   nsIntPoint GetScreenXY(mozilla::ErrorResult& aError);
 
   int32_t RequestAnimationFrame(const nsIDocument::FrameRequestCallbackHolder& aCallback,
                                 mozilla::ErrorResult& aError);