Merge inbound to mozilla-central. a=merge
authorBrindusan Cristian <cbrindusan@mozilla.com>
Fri, 14 Sep 2018 12:53:25 +0300
changeset 492059 28baa3df5f0f530faee1900f43c463f6b77b985c
parent 492048 dd2958c5e2a929d94b3d4078d05a986a9345b9b1 (current diff)
parent 492058 6dba6afbe836f7bd8e484be4e823e0c680d41ee3 (diff)
child 492060 c5fbbf959e23a4f33d450cb6c64ef739e09fbe13
child 492064 0bd6b228ce72083efd4763784e497c9a810bf697
child 492079 2d6f07a1ac3a89d77cd861ad9e45ea53dde53ec2
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone64.0a1
first release with
nightly linux32
28baa3df5f0f / 64.0a1 / 20180914100156 / files
nightly linux64
28baa3df5f0f / 64.0a1 / 20180914100156 / files
nightly mac
28baa3df5f0f / 64.0a1 / 20180914100156 / files
nightly win32
28baa3df5f0f / 64.0a1 / 20180914100156 / files
nightly win64
28baa3df5f0f / 64.0a1 / 20180914100156 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to mozilla-central. a=merge
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -11,21 +11,17 @@ MOZ_PKG_REMOVALS = $(srcdir)/removed-fil
 
 MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
 MOZ_PKG_DUPEFLAGS = -f $(srcdir)/allowed-dupes.mn
 
 DEFINES += -DPKG_LOCALE_MANIFEST=$(topobjdir)/browser/installer/locale-manifest.in
 MOZ_CHROME_LOCALE_ENTRIES=@RESPATH@/browser/chrome/ @RESPATH@/chrome/
 
 # Some files have been already bundled with xulrunner
-ifndef MOZ_MULET
 MOZ_PKG_FATAL_WARNINGS = 1
-else
-DEFINES += -DMOZ_MULET
-endif
 
 # When packaging an artifact build not all xpt files expected by the
 # packager will be present.
 ifdef MOZ_ARTIFACT_BUILDS
 MOZ_PKG_FATAL_WARNINGS =
 endif
 
 DEFINES += -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
--- a/build/macosx/cross-mozconfig.common
+++ b/build/macosx/cross-mozconfig.common
@@ -1,16 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 if [ "x$IS_NIGHTLY" = "xyes" ]; then
-  # Some nightlies (eg: Mulet) don't want these set.
+  # Some nightlies don't want these set.
   MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
 fi
 . "$topsrcdir/build/mozconfig.common"
 
 # Rust requires dsymutil into PATH
 mk_add_options "export PATH=$topsrcdir/llvm-dsymutil/bin:$PATH"
 
 # ld needs libLTO.so from llvm
--- a/build/macosx/local-mozconfig.common
+++ b/build/macosx/local-mozconfig.common
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if [ "x$IS_NIGHTLY" = "xyes" ]; then
-  # Some nightlies (eg: Mulet) don't want these set.
+  # Some nightlies don't want these set.
   MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
 fi
 . "$topsrcdir/build/mozconfig.common"
 
 if [ -d "$topsrcdir/clang" ]; then
     # mozilla-central based build
     export CC=$topsrcdir/clang/bin/clang
     export CXX=$topsrcdir/clang/bin/clang++
--- a/build/mozconfig.win-common
+++ b/build/mozconfig.win-common
@@ -1,11 +1,11 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if [ "x$IS_NIGHTLY" = "xyes" ]; then
-  # Some nightlies (eg: Mulet) don't want these set.
+  # Some nightlies don't want these set.
   MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
 fi
 
 TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 export MAKECAB=$TOOLTOOL_DIR/makecab.exe
--- a/build/unix/mozconfig.unix
+++ b/build/unix/mozconfig.unix
@@ -1,10 +1,10 @@
 if [ "x$IS_NIGHTLY" = "xyes" ]; then
-  # Some nightlies (eg: Mulet) don't want these set.
+  # Some nightlies don't want these set.
   MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
 fi
 
 . "$topsrcdir/build/mozconfig.common"
 
 TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 
 if [ -n "$FORCE_GCC" ]; then
--- a/devtools/moz.build
+++ b/devtools/moz.build
@@ -17,17 +17,17 @@ DIRS += [
     'platform',
     'server',
     'shared',
     'startup',
 ]
 
 # /browser uses DIST_SUBDIR.  We opt-in to this treatment when building
 # DevTools for the browser to keep the root omni.ja slim for use by external XUL
-# apps.  Mulet also uses this since it includes /browser.
+# apps.
 if CONFIG['MOZ_BUILD_APP'] == 'browser':
     DIST_SUBDIR = 'browser'
     export('DIST_SUBDIR')
 
 with Files('**'):
     BUG_COMPONENT = ('DevTools', 'General')
 
 with Files('docs/**'):
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1341,17 +1341,17 @@ nsDocShell::SetCurrentURI(nsIURI* aURI, 
   nsCOMPtr<nsIDocShellTreeItem> root;
 
   GetSameTypeRootTreeItem(getter_AddRefs(root));
   if (root.get() == static_cast<nsIDocShellTreeItem*>(this)) {
     // This is the root docshell
     isRoot = true;
   }
   if (mLSHE) {
-    mLSHE->GetIsSubFrame(&isSubFrame);
+    isSubFrame = mLSHE->GetIsSubFrame();
   }
 
   if (!isSubFrame && !isRoot) {
     /*
      * We don't want to send OnLocationChange notifications when
      * a subframe is being loaded for the first time, while
      * visiting a frameset page
      */
@@ -3737,24 +3737,22 @@ nsDocShell::GetChildSHEntry(int32_t aChi
   // the progress of loading a document too...
 
   if (mLSHE) {
     /* Before looking for the subframe's url, check
      * the expiration status of the parent. If the parent
      * has expired from cache, then subframes will not be
      * loaded from history in certain situations.
      */
-    bool parentExpired = false;
-    mLSHE->GetExpirationStatus(&parentExpired);
+    bool parentExpired = mLSHE->GetExpirationStatus();
 
     /* Get the parent's Load Type so that it can be set on the child too.
      * By default give a loadHistory value
      */
-    uint32_t loadType = LOAD_HISTORY;
-    mLSHE->GetLoadType(&loadType);
+    uint32_t loadType = mLSHE->GetLoadType();
     // If the user did a shift-reload on this frameset page,
     // we don't want to load the subframes from history.
     if (IsForceReloadType(loadType) ||
         loadType == LOAD_REFRESH) {
       return rv;
     }
 
     /* If the user pressed reload and the parent frame has expired
@@ -3824,19 +3822,18 @@ nsDocShell::AddChildSHEntryInternal(nsIS
     }
 
     rv = mSessionHistory->LegacySHistory()->GetEntryAtIndex(
       index, getter_AddRefs(currentHE));
     NS_ENSURE_TRUE(currentHE, NS_ERROR_FAILURE);
 
     nsCOMPtr<nsISHEntry> currentEntry(do_QueryInterface(currentHE));
     if (currentEntry) {
-      uint32_t cloneID = 0;
       nsCOMPtr<nsISHEntry> nextEntry;
-      aCloneRef->GetID(&cloneID);
+      uint32_t cloneID = aCloneRef->GetID();
       rv = nsSHistory::CloneAndReplace(currentEntry, this, cloneID,
         aNewEntry, aCloneChildren, getter_AddRefs(nextEntry));
 
       if (NS_SUCCEEDED(rv)) {
         rv = mSessionHistory->LegacySHistory()->AddEntry(nextEntry, true);
       }
     }
   } else {
@@ -4027,18 +4024,17 @@ nsDocShell::GetDeviceSizeIsPageSize(bool
 void
 nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
 {
   RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
   if (!rootSH || !aEntry) {
     return;
   }
 
-  int32_t count = 0;
-  aEntry->GetChildCount(&count);
+  int32_t count = aEntry->GetChildCount();
   AutoTArray<nsID, 16> ids;
   for (int32_t i = 0; i < count; ++i) {
     nsCOMPtr<nsISHEntry> child;
     aEntry->GetChildAt(i, getter_AddRefs(child));
     if (child) {
       ids.AppendElement(child->DocshellID());
     }
   }
@@ -5132,29 +5128,26 @@ nsDocShell::LoadPage(nsISupports* aPageD
   // and 585298.)
   rv = shEntry->AbandonBFCacheEntry();
   NS_ENSURE_SUCCESS(rv, rv);
 
   //
   // load the page as view-source
   //
   if (nsIWebPageDescriptor::DISPLAY_AS_SOURCE == aDisplayType) {
-    nsCOMPtr<nsIURI> oldUri, newUri;
     nsCString spec, newSpec;
 
     // Create a new view-source URI and replace the original.
-    rv = shEntry->GetURI(getter_AddRefs(oldUri));
-    if (NS_FAILED(rv)) {
-      return rv;
-    }
+    nsCOMPtr<nsIURI> oldUri = shEntry->GetURI();
 
     oldUri->GetSpec(spec);
     newSpec.AppendLiteral("view-source:");
     newSpec.Append(spec);
 
+    nsCOMPtr<nsIURI> newUri;
     rv = NS_NewURI(getter_AddRefs(newUri), newSpec);
     if (NS_FAILED(rv)) {
       return rv;
     }
     shEntry->SetURI(newUri);
     shEntry->SetOriginalURI(nullptr);
     shEntry->SetResultPrincipalURI(nullptr);
     // shEntry's current triggering principal is whoever loaded that page initially.
@@ -7627,18 +7620,17 @@ bool
 nsDocShell::CanSavePresentation(uint32_t aLoadType,
                                 nsIRequest* aNewRequest,
                                 nsIDocument* aNewDocument)
 {
   if (!mOSHE) {
     return false;  // no entry to save into
   }
 
-  nsCOMPtr<nsIContentViewer> viewer;
-  mOSHE->GetContentViewer(getter_AddRefs(viewer));
+  nsCOMPtr<nsIContentViewer> viewer = mOSHE->GetContentViewer();
   if (viewer) {
     NS_WARNING("mOSHE already has a content viewer!");
     return false;
   }
 
   // Only save presentation for "normal" loads and link loads.  Anything else
   // probably wants to refetch the page, so caching the old presentation
   // would be incorrect.
@@ -7648,19 +7640,17 @@ nsDocShell::CanSavePresentation(uint32_t
       aLoadType != LOAD_STOP_CONTENT &&
       aLoadType != LOAD_STOP_CONTENT_AND_REPLACE &&
       aLoadType != LOAD_ERROR_PAGE) {
     return false;
   }
 
   // If the session history entry has the saveLayoutState flag set to false,
   // then we should not cache the presentation.
-  bool canSaveState;
-  mOSHE->GetSaveLayoutStateFlag(&canSaveState);
-  if (!canSaveState) {
+  if (!mOSHE->GetSaveLayoutStateFlag()) {
     return false;
   }
 
   // If the document is not done loading, don't cache it.
   if (!mScriptGlobal || mScriptGlobal->IsLoading()) {
     return false;
   }
 
@@ -7758,39 +7748,35 @@ nsDocShell::CaptureState()
   if (!mScriptGlobal) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsISupports> windowState = mScriptGlobal->SaveWindowState();
   NS_ENSURE_TRUE(windowState, NS_ERROR_FAILURE);
 
 #ifdef DEBUG_PAGE_CACHE
-  nsCOMPtr<nsIURI> uri;
-  mOSHE->GetURI(getter_AddRefs(uri));
+  nsCOMPtr<nsIURI> uri = mOSHE->GetURI();
   nsAutoCString spec;
   if (uri) {
     uri->GetSpec(spec);
   }
   printf("Saving presentation into session history\n");
   printf("  SH URI: %s\n", spec.get());
 #endif
 
-  nsresult rv = mOSHE->SetWindowState(windowState);
-  NS_ENSURE_SUCCESS(rv, rv);
+  mOSHE->SetWindowState(windowState);
 
   // Suspend refresh URIs and save off the timer queue
-  rv = mOSHE->SetRefreshURIList(mSavedRefreshURIList);
-  NS_ENSURE_SUCCESS(rv, rv);
+  mOSHE->SetRefreshURIList(mSavedRefreshURIList);
 
   // Capture the current content viewer bounds.
   if (mContentViewer) {
     nsIntRect bounds;
     mContentViewer->GetBounds(bounds);
-    rv = mOSHE->SetViewerBounds(bounds);
-    NS_ENSURE_SUCCESS(rv, rv);
+    mOSHE->SetViewerBounds(bounds);
   }
 
   // Capture the docshell hierarchy.
   mOSHE->ClearChildShells();
 
   uint32_t childCount = mChildList.Length();
   for (uint32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childShell = do_QueryInterface(ChildAt(i));
@@ -7917,22 +7903,20 @@ nsDocShell::GetRestoringDocument(bool* a
 nsresult
 nsDocShell::RestorePresentation(nsISHEntry* aSHEntry, bool* aRestoring)
 {
   MOZ_ASSERT(!mIsBeingDestroyed);
 
   NS_ASSERTION(mLoadType & LOAD_CMD_HISTORY,
                "RestorePresentation should only be called for history loads");
 
-  nsCOMPtr<nsIContentViewer> viewer;
-  aSHEntry->GetContentViewer(getter_AddRefs(viewer));
+  nsCOMPtr<nsIContentViewer> viewer = aSHEntry->GetContentViewer();
 
 #ifdef DEBUG_PAGE_CACHE
-  nsCOMPtr<nsIURI> uri;
-  aSHEntry->GetURI(getter_AddRefs(uri));
+  nsCOMPtr<nsIURI> uri = aSHEntry->GetURI();
 
   nsAutoCString spec;
   if (uri) {
     uri->GetSpec(spec);
   }
 #endif
 
   *aRestoring = false;
@@ -8035,18 +8019,17 @@ nsDocShell::RestoreFromHistory()
   MOZ_ASSERT(mRestorePresentationEvent.IsPending());
   PresentationEventForgetter forgetter(mRestorePresentationEvent);
 
   // This section of code follows the same ordering as CreateContentViewer.
   if (!mLSHE) {
     return NS_ERROR_FAILURE;
   }
 
-  nsCOMPtr<nsIContentViewer> viewer;
-  mLSHE->GetContentViewer(getter_AddRefs(viewer));
+  nsCOMPtr<nsIContentViewer> viewer = mLSHE->GetContentViewer();
   if (!viewer) {
     return NS_ERROR_FAILURE;
   }
 
   if (mSavingOldViewer) {
     // We determined that it was safe to cache the document presentation
     // at the time we initiated the new load.  We need to check whether
     // it's still safe to do so, since there may have been DOM mutations
@@ -8217,22 +8200,20 @@ nsDocShell::RestoreFromHistory()
   // Now that we're about to switch documents, forget all of our children.
   // Note that we cached them as needed up in CaptureState above.
   DestroyChildren();
 
   mContentViewer.swap(viewer);
 
   // Grab all of the related presentation from the SHEntry now.
   // Clearing the viewer from the SHEntry will clear all of this state.
-  nsCOMPtr<nsISupports> windowState;
-  mLSHE->GetWindowState(getter_AddRefs(windowState));
+  nsCOMPtr<nsISupports> windowState = mLSHE->GetWindowState();
   mLSHE->SetWindowState(nullptr);
 
-  bool sticky;
-  mLSHE->GetSticky(&sticky);
+  bool sticky = mLSHE->GetSticky();
 
   nsCOMPtr<nsIDocument> document = mContentViewer->GetDocument();
 
   nsCOMArray<nsIDocShellTreeItem> childShells;
   int32_t i = 0;
   nsCOMPtr<nsIDocShellTreeItem> child;
   while (NS_SUCCEEDED(mLSHE->ChildShellAt(i++, getter_AddRefs(child))) &&
          child) {
@@ -8240,18 +8221,17 @@ nsDocShell::RestoreFromHistory()
   }
 
   // get the previous content viewer size
   nsIntRect oldBounds(0, 0, 0, 0);
   mLSHE->GetViewerBounds(oldBounds);
 
   // Restore the refresh URI list.  The refresh timers will be restarted
   // when EndPageLoad() is called.
-  nsCOMPtr<nsIMutableArray> refreshURIList;
-  mLSHE->GetRefreshURIList(getter_AddRefs(refreshURIList));
+  nsCOMPtr<nsIMutableArray> refreshURIList = mLSHE->GetRefreshURIList();
 
   // Reattach to the window object.
   mIsRestoringDocument = true; // for MediaDocument::BecomeInteractive
   rv = mContentViewer->Open(windowState, mLSHE);
   mIsRestoringDocument = false;
 
   // Hack to keep nsDocShellEditorData alive across the
   // SetContentViewer(nullptr) call below.
@@ -8260,18 +8240,17 @@ nsDocShell::RestoreFromHistory()
   // Now remove it from the cached presentation.
   mLSHE->SetContentViewer(nullptr);
   mEODForCurrentDocument = false;
 
   mLSHE->SetEditorData(data.forget());
 
 #ifdef DEBUG
   {
-    nsCOMPtr<nsIMutableArray> refreshURIs;
-    mLSHE->GetRefreshURIList(getter_AddRefs(refreshURIs));
+    nsCOMPtr<nsIMutableArray> refreshURIs = mLSHE->GetRefreshURIList();
     nsCOMPtr<nsIDocShellTreeItem> childShell;
     mLSHE->ChildShellAt(0, getter_AddRefs(childShell));
     NS_ASSERTION(!refreshURIs && !childShell,
                  "SHEntry should have cleared presentation state");
   }
 #endif
 
   // Restore the sticky state of the viewer.  The viewer has set this state
@@ -8320,18 +8299,17 @@ nsDocShell::RestoreFromHistory()
       }
     }
 
     // Use the uri from the mLSHE we had when we entered this function
     // (which need not match the document's URI if anchors are involved),
     // since that's the history entry we're loading.  Note that if we use
     // origLSHE we don't have to worry about whether the entry in question
     // is still mLSHE or whether it's now mOSHE.
-    nsCOMPtr<nsIURI> uri;
-    origLSHE->GetURI(getter_AddRefs(uri));
+    nsCOMPtr<nsIURI> uri = origLSHE->GetURI();
     SetCurrentURI(uri, document->GetChannel(), true, 0);
   }
 
   // This is the end of our CreateContentViewer() replacement.
   // Now we simulate a load.  First, we restore the state of the javascript
   // window object.
   nsCOMPtr<nsPIDOMWindowOuter> privWin = GetWindow();
   NS_ASSERTION(privWin, "could not get nsPIDOMWindow interface");
@@ -8952,18 +8930,17 @@ nsresult
 nsDocShell::SetDocCurrentStateObj(nsISHEntry* aShEntry)
 {
   NS_ENSURE_STATE(mContentViewer);
   nsCOMPtr<nsIDocument> document = GetDocument();
   NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIStructuredCloneContainer> scContainer;
   if (aShEntry) {
-    nsresult rv = aShEntry->GetStateData(getter_AddRefs(scContainer));
-    NS_ENSURE_SUCCESS(rv, rv);
+    scContainer = aShEntry->GetStateData();
 
     // If aShEntry is null, just set the document's state object to null.
   }
 
   // It's OK for scContainer too be null here; that just means there's no
   // state data associated with this history entry.
   document->SetStateObject(scContainer);
 
@@ -9733,18 +9710,17 @@ nsDocShell::InternalLoad(nsIURI* aURI,
     bool historyNavBetweenSameDoc = false;
     if (mOSHE && aSHEntry) {
       // We're doing a history load.
 
       mOSHE->SharesDocumentWith(aSHEntry, &historyNavBetweenSameDoc);
 
 #ifdef DEBUG
       if (historyNavBetweenSameDoc) {
-        nsCOMPtr<nsIInputStream> currentPostData;
-        mOSHE->GetPostData(getter_AddRefs(currentPostData));
+        nsCOMPtr<nsIInputStream> currentPostData = mOSHE->GetPostData();
         NS_ASSERTION(currentPostData == aPostData,
                      "Different POST data for entries for the same page?");
       }
 #endif
     }
 
     // A short-circuited load happens when we navigate between two SHEntries
     // for the same document.  We do a short-circuited load under two
@@ -9803,18 +9779,18 @@ nsDocShell::InternalLoad(nsIURI* aURI,
       doc->SetDocumentURI(aURI);
 
       /* This is a anchor traversal with in the same page.
        * call OnNewURI() so that, this traversal will be
        * recorded in session and global history.
        */
       nsCOMPtr<nsIPrincipal> newURITriggeringPrincipal, newURIPrincipalToInherit;
       if (mOSHE) {
-        mOSHE->GetTriggeringPrincipal(getter_AddRefs(newURITriggeringPrincipal));
-        mOSHE->GetPrincipalToInherit(getter_AddRefs(newURIPrincipalToInherit));
+        newURITriggeringPrincipal = mOSHE->GetTriggeringPrincipal();
+        newURIPrincipalToInherit = mOSHE->GetPrincipalToInherit();
       } else {
         newURITriggeringPrincipal = aTriggeringPrincipal;
         newURIPrincipalToInherit = doc->NodePrincipal();
       }
       // Pass true for aCloneSHChildren, since we're not
       // changing documents here, so all of our subframes are
       // still relevant to the new session history entry.
       //
@@ -9827,26 +9803,26 @@ nsDocShell::InternalLoad(nsIURI* aURI,
 
       nsCOMPtr<nsIInputStream> postData;
       uint32_t cacheKey = 0;
 
       bool scrollRestorationIsManual = false;
       if (mOSHE) {
         /* save current position of scroller(s) (bug 59774) */
         mOSHE->SetScrollPosition(cx, cy);
-        mOSHE->GetScrollRestorationIsManual(&scrollRestorationIsManual);
+        scrollRestorationIsManual = mOSHE->GetScrollRestorationIsManual();
         // Get the postdata and page ident from the current page, if
         // the new load is being done via normal means.  Note that
         // "normal means" can be checked for just by checking for
         // LOAD_CMD_NORMAL, given the loadType and allowScroll check
         // above -- it filters out some LOAD_CMD_NORMAL cases that we
         // wouldn't want here.
         if (aLoadType & LOAD_CMD_NORMAL) {
-          mOSHE->GetPostData(getter_AddRefs(postData));
-          mOSHE->GetCacheKey(&cacheKey);
+          postData = mOSHE->GetPostData();
+          cacheKey = mOSHE->GetCacheKey();
 
           // Link our new SHEntry to the old SHEntry's back/forward
           // cache data, since the two SHEntries correspond to the
           // same document.
           if (mLSHE) {
             if (!aSHEntry) {
               // If we're not doing a history load, scroll restoration
               // should be inherited from the previous session history entry.
@@ -9854,17 +9830,17 @@ nsDocShell::InternalLoad(nsIURI* aURI,
             }
             mLSHE->AdoptBFCacheEntry(mOSHE);
           }
         }
       }
 
       // If we're doing a history load, use its scroll restoration state.
       if (aSHEntry) {
-        aSHEntry->GetScrollRestorationIsManual(&scrollRestorationIsManual);
+        scrollRestorationIsManual = aSHEntry->GetScrollRestorationIsManual();
       }
 
       /* Assign mOSHE to mLSHE. This will either be a new entry created
        * by OnNewURI() for normal loads or aSHEntry for history loads.
        */
       if (mLSHE) {
         SetHistoryEntry(&mOSHE, mLSHE);
         // Save the postData obtained from the previous page
@@ -10713,19 +10689,19 @@ nsDocShell::DoURILoad(nsIURI* aURI,
                                   aReferrerURI);
   }
 
   nsCOMPtr<nsICacheInfoChannel> cacheChannel(do_QueryInterface(channel));
   /* Get the cache Key from SH */
   uint32_t cacheKey = 0;
   if (cacheChannel) {
     if (mLSHE) {
-      mLSHE->GetCacheKey(&cacheKey);
+      cacheKey = mLSHE->GetCacheKey();
     } else if (mOSHE) {  // for reload cases
-      mOSHE->GetCacheKey(&cacheKey);
+      cacheKey = mOSHE->GetCacheKey();
     }
   }
 
   // figure out if we need to set the post data stream on the channel...
   if (aPostData) {
     nsCOMPtr<nsIFormPOSTActionChannel> postChannel(do_QueryInterface(channel));
     if (postChannel) {
       // XXX it's a bit of a hack to rewind the postdata stream here but
@@ -10939,17 +10915,17 @@ nsDocShell::DoChannelLoad(nsIChannel* aC
   }
   // Load attributes depend on load type...
   switch (mLoadType) {
     case LOAD_HISTORY: {
       // Only send VALIDATE_NEVER if mLSHE's URI was never changed via
       // push/replaceState (bug 669671).
       bool uriModified = false;
       if (mLSHE) {
-        mLSHE->GetURIWasModified(&uriModified);
+        uriModified = mLSHE->GetURIWasModified();
       }
 
       if (!uriModified) {
         loadFlags |= nsIRequest::VALIDATE_NEVER;
       }
       break;
     }
 
@@ -11669,18 +11645,17 @@ nsDocShell::AddState(JS::Handle<JS::Valu
   nsCOMPtr<nsISHEntry> newSHEntry;
   if (!aReplace) {
     // Save the current scroll position (bug 590573).
     nscoord cx = 0, cy = 0;
     GetCurScrollPos(ScrollOrientation_X, &cx);
     GetCurScrollPos(ScrollOrientation_Y, &cy);
     mOSHE->SetScrollPosition(cx, cy);
 
-    bool scrollRestorationIsManual = false;
-    mOSHE->GetScrollRestorationIsManual(&scrollRestorationIsManual);
+    bool scrollRestorationIsManual = mOSHE->GetScrollRestorationIsManual();
 
     // Since we're not changing which page we have loaded, pass
     // true for aCloneChildren.
     rv = AddToSessionHistory(newURI, nullptr,
                              document->NodePrincipal(), // triggeringPrincipal
                              nullptr, true,
                              getter_AddRefs(newSHEntry));
     NS_ENSURE_SUCCESS(rv, rv);
@@ -11715,19 +11690,19 @@ nsDocShell::AddState(JS::Handle<JS::Valu
   // data, if there is any.
   newSHEntry->SetStateData(scContainer);
   newSHEntry->SetPostData(nullptr);
 
   // If this push/replaceState changed the document's current URI and the new
   // URI differs from the old URI in more than the hash, or if the old
   // SHEntry's URI was modified in this way by a push/replaceState call
   // set URIWasModified to true for the current SHEntry (bug 669671).
-  bool sameExceptHashes = true, oldURIWasModified = false;
+  bool sameExceptHashes = true;
   newURI->EqualsExceptRef(currentURI, &sameExceptHashes);
-  oldOSHE->GetURIWasModified(&oldURIWasModified);
+  bool oldURIWasModified = oldOSHE->GetURIWasModified();
   newSHEntry->SetURIWasModified(!sameExceptHashes || oldURIWasModified);
 
   // Step 5: If aReplace is false, indicating that we're doing a pushState
   // rather than a replaceState, notify bfcache that we've added a page to
   // the history so it can evict content viewers if appropriate. Otherwise
   // call ReplaceEntry so that we notify nsIHistoryListeners that an entry
   // was replaced.
   RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
@@ -11789,17 +11764,17 @@ nsDocShell::AddState(JS::Handle<JS::Valu
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetCurrentScrollRestorationIsManual(bool* aIsManual)
 {
   *aIsManual = false;
   if (mOSHE) {
-    mOSHE->GetScrollRestorationIsManual(aIsManual);
+    *aIsManual = mOSHE->GetScrollRestorationIsManual();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetCurrentScrollRestorationIsManual(bool aIsManual)
 {
@@ -11885,18 +11860,17 @@ nsDocShell::AddToSessionHistory(nsIURI* 
    * the existing SH entry in the page and replace the url and
    * other vitalities.
    */
   if (LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY) &&
       root != static_cast<nsIDocShellTreeItem*>(this)) {
     // This is a subframe
     entry = mOSHE;
     if (entry) {
-      int32_t childCount = 0;
-      entry->GetChildCount(&childCount);
+      int32_t childCount = entry->GetChildCount();
       // Remove all children of this entry
       for (int32_t i = childCount - 1; i >= 0; i--) {
         nsCOMPtr<nsISHEntry> child;
         entry->GetChildAt(i, getter_AddRefs(child));
         entry->RemoveChild(child);
       }
       entry->AbandonBFCacheEntry();
     }
@@ -12032,18 +12006,17 @@ nsDocShell::AddToSessionHistory(nsIURI* 
   if (expired) {
     entry->SetExpirationStatus(true);
   }
 
   if (root == static_cast<nsIDocShellTreeItem*>(this) && mSessionHistory) {
     // If we need to clone our children onto the new session
     // history entry, do so now.
     if (aCloneChildren && mOSHE) {
-      uint32_t cloneID;
-      mOSHE->GetID(&cloneID);
+      uint32_t cloneID = mOSHE->GetID();
       nsCOMPtr<nsISHEntry> newEntry;
       nsSHistory::CloneAndReplace(mOSHE, this, cloneID, entry, true,
                                   getter_AddRefs(newEntry));
       NS_ASSERTION(entry == newEntry,
                    "The new session history should be in the new entry");
     }
 
     // This is the root docshell
@@ -12098,47 +12071,29 @@ nsDocShell::AddToSessionHistory(nsIURI* 
 
 nsresult
 nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
 {
   if (!IsNavigationAllowed()) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsIURI> uri;
-  nsCOMPtr<nsIURI> originalURI;
-  nsCOMPtr<nsIURI> resultPrincipalURI;
-  bool loadReplace = false;
-  nsCOMPtr<nsIInputStream> postData;
-  nsCOMPtr<nsIURI> referrerURI;
-  uint32_t referrerPolicy;
+  NS_ENSURE_TRUE(aEntry, NS_ERROR_FAILURE);
+
+  nsCOMPtr<nsIURI> uri = aEntry->GetURI();
+  nsCOMPtr<nsIURI> originalURI = aEntry->GetOriginalURI();
+  nsCOMPtr<nsIURI> resultPrincipalURI = aEntry->GetResultPrincipalURI();
+  bool loadReplace = aEntry->GetLoadReplace();
+  nsCOMPtr<nsIURI> referrerURI = aEntry->GetReferrerURI();
+  uint32_t referrerPolicy = aEntry->GetReferrerPolicy();
+  nsCOMPtr<nsIInputStream> postData = aEntry->GetPostData();
   nsAutoCString contentType;
-  nsCOMPtr<nsIPrincipal> triggeringPrincipal;
-  nsCOMPtr<nsIPrincipal> principalToInherit;
-
-  NS_ENSURE_TRUE(aEntry, NS_ERROR_FAILURE);
-
-  NS_ENSURE_SUCCESS(aEntry->GetURI(getter_AddRefs(uri)), NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetOriginalURI(getter_AddRefs(originalURI)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetLoadReplace(&loadReplace),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetReferrerURI(getter_AddRefs(referrerURI)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetReferrerPolicy(&referrerPolicy),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetPostData(getter_AddRefs(postData)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetContentType(contentType), NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetTriggeringPrincipal(getter_AddRefs(triggeringPrincipal)),
-                    NS_ERROR_FAILURE);
-  NS_ENSURE_SUCCESS(aEntry->GetPrincipalToInherit(getter_AddRefs(principalToInherit)),
-                    NS_ERROR_FAILURE);
+  aEntry->GetContentType(contentType);
+  nsCOMPtr<nsIPrincipal> triggeringPrincipal = aEntry->GetTriggeringPrincipal();
+  nsCOMPtr<nsIPrincipal> principalToInherit = aEntry->GetPrincipalToInherit();
 
   // Calling CreateAboutBlankContentViewer can set mOSHE to null, and if
   // that's the only thing holding a ref to aEntry that will cause aEntry to
   // die while we're loading it.  So hold a strong ref to aEntry here, just
   // in case.
   nsCOMPtr<nsISHEntry> kungFuDeathGrip(aEntry);
   bool isJS;
   nsresult rv = uri->SchemeIs("javascript", &isJS);
@@ -12184,22 +12139,20 @@ nsDocShell::LoadHistoryEntry(nsISHEntry*
       return NS_BINDING_ABORTED;
     }
   }
 
   // Do not inherit principal from document (security-critical!);
   uint32_t flags = INTERNAL_LOAD_FLAGS_NONE;
 
   nsAutoString srcdoc;
-  bool isSrcdoc;
   nsCOMPtr<nsIURI> baseURI;
-  aEntry->GetIsSrcdocEntry(&isSrcdoc);
-  if (isSrcdoc) {
+  if (aEntry->GetIsSrcdocEntry()) {
     aEntry->GetSrcdocData(srcdoc);
-    aEntry->GetBaseURI(getter_AddRefs(baseURI));
+    baseURI = aEntry->GetBaseURI();
     flags |= INTERNAL_LOAD_FLAGS_IS_SRCDOC;
   } else {
     srcdoc = VoidString();
   }
 
   // If there is no valid triggeringPrincipal, we deny the load
   MOZ_ASSERT(triggeringPrincipal, "need a valid triggeringPrincipal to load from history");
   if (!triggeringPrincipal) {
@@ -12240,31 +12193,29 @@ nsDocShell::LoadHistoryEntry(nsISHEntry*
 
 NS_IMETHODIMP
 nsDocShell::GetShouldSaveLayoutState(bool* aShould)
 {
   *aShould = false;
   if (mOSHE) {
     // Don't capture historystate and save it in history
     // if the page asked not to do so.
-    mOSHE->GetSaveLayoutStateFlag(aShould);
+    *aShould = mOSHE->GetSaveLayoutStateFlag();
   }
 
   return NS_OK;
 }
 
 nsresult
 nsDocShell::PersistLayoutHistoryState()
 {
   nsresult rv = NS_OK;
 
   if (mOSHE) {
-    bool scrollRestorationIsManual = false;
-    mOSHE->GetScrollRestorationIsManual(&scrollRestorationIsManual);
-
+    bool scrollRestorationIsManual = mOSHE->GetScrollRestorationIsManual();
     nsCOMPtr<nsIPresShell> shell = GetPresShell();
     nsCOMPtr<nsILayoutHistoryState> layoutState;
     if (shell) {
       rv = shell->CaptureHistoryState(getter_AddRefs(layoutState));
     } else if (scrollRestorationIsManual) {
       // Even if we don't have layout anymore, we may want to reset the current
       // scroll state in layout history.
       GetLayoutHistoryState(getter_AddRefs(layoutState));
@@ -12811,17 +12762,18 @@ nsDocShell::GetIsExecutingOnLoadHandler(
   *aResult = mIsExecutingOnLoadHandler;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetLayoutHistoryState(nsILayoutHistoryState** aLayoutHistoryState)
 {
   if (mOSHE) {
-    mOSHE->GetLayoutHistoryState(aLayoutHistoryState);
+    nsCOMPtr<nsILayoutHistoryState> state = mOSHE->GetLayoutHistoryState();
+    state.forget(aLayoutHistoryState);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetLayoutHistoryState(nsILayoutHistoryState* aLayoutHistoryState)
 {
   if (mOSHE) {
--- a/docshell/shistory/nsISHEntry.idl
+++ b/docshell/shistory/nsISHEntry.idl
@@ -30,212 +30,269 @@ class nsSHEntryShared;
 [ref] native nsIntRect(nsIntRect);
 [ptr] native nsDocShellEditorDataPtr(nsDocShellEditorData);
 [ptr] native nsSHEntryShared(nsSHEntryShared);
 
 [builtinclass, scriptable, uuid(0dad26b8-a259-42c7-93f1-2fa7fc076e45)]
 interface nsISHEntry : nsISupports
 {
     /**
-     * A readonly property that returns the URI
-     * of the current entry. The object returned is
-     * of type nsIURI
+     * The URI of the current entry.
      */
-    readonly attribute nsIURI URI;
+    [infallible] attribute nsIURI URI;
 
     /**
-     * A readonly property that returns the original URI of the current entry.
-     * If an entry is the result of a redirect this attribute holds original
-     * URI. The object returned is of type nsIURI
+     * The original URI of the current entry. If an entry is the result of a
+     * redirect this attribute holds the original URI.
      */
-    attribute nsIURI originalURI;
+    [infallible] attribute nsIURI originalURI;
 
     /**
      * URL as stored from nsILoadInfo.resultPrincipalURI.  See nsILoadInfo
      * for more details.
      */
-    attribute nsIURI resultPrincipalURI;
+    [infallible] attribute nsIURI resultPrincipalURI;
 
     /**
      *  This flag remembers whether channel has LOAD_REPLACE set.
      */
-    attribute boolean loadReplace;
+    [infallible] attribute boolean loadReplace;
 
     /**
      * The title of the current entry.
      */
+    // XXX: make it [infallible] when AString supports that (bug 1491187).
     attribute AString title;
 
     /**
-     * A readonly property that returns a boolean
-     * flag which indicates if the entry was created as a
-     * result of a subframe navigation. This flag will be
-     * 'false' when a frameset page is visited for
-     * the first time. This flag will be 'true' for all
-     * history entries created as a result of a subframe
-     * navigation.
+     * Was the entry created as a result of a subframe navigation?
+     * - Will be 'false' when a frameset page is visited for the first time.
+     * - Will be 'true' for all history entries created as a result of a
+     *   subframe navigation.
      */
-    readonly attribute boolean isSubFrame;
-
-    /** URI for the document */
-    void setURI(in nsIURI aURI);
+    [infallible] attribute boolean isSubFrame;
 
     /** Referrer URI */
-    attribute nsIURI referrerURI;
-
-    /** Referrer policy, holding one of the values (REFERRER_POLICY_*)
-     *  defined in nsIHttpChannel.
-     */
-    attribute unsigned long referrerPolicy;
-
-    /** Content viewer, for fast restoration of presentation */
-    attribute nsIContentViewer contentViewer;
-
-    /** Whether the content viewer is marked "sticky" */
-    attribute boolean sticky;
-
-    /** Saved state of the global window object */
-    attribute nsISupports windowState;
-
-    /**
-     * Saved position and dimensions of the content viewer; we must adjust the
-     * root view's widget accordingly if this has changed when the presentation
-     * is restored.
-     */
-    [noscript] void getViewerBounds(in nsIntRect bounds);
-    [noscript] void setViewerBounds([const] in nsIntRect bounds);
+    [infallible] attribute nsIURI referrerURI;
 
     /**
-     * Saved child docshells corresponding to contentViewer.  The child shells
-     * are restored as children of the parent docshell, in this order, when the
-     * parent docshell restores a saved presentation.
+     * Referrer policy, holding one of the values (REFERRER_POLICY_*) defined
+     * in nsIHttpChannel.
      */
-
-    /** Append a child shell to the end of our list. */
-    void addChildShell(in nsIDocShellTreeItem shell);
+    [infallible] attribute unsigned long referrerPolicy;
 
-    /**
-     * Get the child shell at |index|; returns null if |index| is out of bounds.
-     */
-    nsIDocShellTreeItem childShellAt(in long index);
+    /** Content viewer, for fast restoration of presentation */
+    [infallible] attribute nsIContentViewer contentViewer;
 
-    /**
-     * Clear the child shell list.
-     */
-    void clearChildShells();
+    /** Whether the content viewer is marked "sticky" */
+    [infallible] attribute boolean sticky;
+
+    /** Saved state of the global window object */
+    [infallible] attribute nsISupports windowState;
 
     /** Saved refresh URI list for the content viewer */
-    attribute nsIMutableArray refreshURIList;
-
-    /**
-     * Ensure that the cached presentation members are self-consistent.
-     * If either |contentViewer| or |windowState| are null, then all of the
-     * following members are cleared/reset:
-     *  contentViewer, sticky, windowState, viewerBounds, childShells,
-     *  refreshURIList.
-     */
-    void syncPresentationState();
+    [infallible] attribute nsIMutableArray refreshURIList;
 
     /** Post Data for the document */
-    attribute nsIInputStream postData;
+    [infallible] attribute nsIInputStream postData;
 
     /** LayoutHistoryState for scroll position and form values */
-    attribute nsILayoutHistoryState layoutHistoryState;
-
-    /**
-     * Initialises the LayoutHistoryState if it doesn't already exist
-     * and returns a reference to it.
-     */
-    nsILayoutHistoryState initLayoutHistoryState();
+    [infallible] attribute nsILayoutHistoryState layoutHistoryState;
 
     /** parent of this entry */
-    attribute nsISHEntry parent;
+    [infallible] attribute nsISHEntry parent;
 
     /**
      * The loadType for this entry. This is typically loadHistory except
      * when reload is pressed, it has the appropriate reload flag
      */
-    attribute unsigned long loadType;
+    [infallible] attribute unsigned long loadType;
 
     /**
      * An ID to help identify this entry from others during
      * subframe navigation
      */
-    attribute unsigned long ID;
+    [infallible] attribute unsigned long ID;
 
-    /** attribute to set and get the cache key for the entry */
-    attribute unsigned long cacheKey;
+    /** The cache key for the entry */
+    [infallible] attribute unsigned long cacheKey;
 
-    /** attribute to indicate whether layoutHistoryState should be saved */
-    attribute boolean saveLayoutStateFlag;
+    /** Should the layoutHistoryState be saved? */
+    [infallible] attribute boolean saveLayoutStateFlag;
 
-    /** attribute to indicate whether the page is already expired in cache */
-    attribute boolean expirationStatus;
+    /** Has the page already expired in cache? */
+    [infallible] attribute boolean expirationStatus;
 
     /**
      * attribute to indicate the content-type of the document that this
      * is a session history entry for
      */
+    // XXX: make it [infallible] when ACString supports that (bug 1491187).
     attribute ACString contentType;
 
     /**
      * If we created this SHEntry via history.pushState or modified it via
      * history.replaceState, and if we changed the SHEntry's URI via the
      * push/replaceState call, and if the SHEntry's new URI differs from its
      * old URI by more than just the hash, then we set this field to true.
      *
      * Additionally, if this SHEntry was created by calling pushState from a
      * SHEntry whose URI was modified, this SHEntry's URIWasModified field is
      * true.
-     *
+     */
+    [infallible] attribute boolean URIWasModified;
+
+    /**
+     * Get the principal, if any, that was associated with the channel
+     * that the document that was loaded to create this history entry
+     * came from.
+     */
+    [infallible] attribute nsIPrincipal triggeringPrincipal;
+
+    /**
+     * Get the principal, if any, that is used when the inherit flag
+     * is set.
+     */
+    [infallible] attribute nsIPrincipal principalToInherit;
+
+    /**
+     * Get/set data associated with this history state via a pushState() call,
+     * serialized using structured clone.
+     **/
+    [infallible] attribute nsIStructuredCloneContainer stateData;
+
+    /**
+     * The history ID of the docshell.
+     */
+    // Would be [infallible], but we don't support that property for nsIDPtr.
+    attribute nsIDPtr docshellID;
+
+    [infallible] readonly attribute nsIBFCacheEntry BFCacheEntry;
+
+    /**
+     * True if this SHEntry corresponds to a document created by a srcdoc
+     * iframe. Set when a value is assigned to srcdocData.
+     */
+    [infallible] readonly attribute boolean isSrcdocEntry;
+
+    /**
+     * Contents of the srcdoc attribute in a srcdoc iframe to be loaded instead
+     * of the URI.  Similar to a Data URI, this information is needed to
+     * recreate the document at a later stage.
+     * Setting this sets isSrcdocEntry to true
      */
-    attribute boolean URIWasModified;
+    // XXX: make it [infallible] when AString supports that (bug 1491187).
+    attribute AString srcdocData;
+
+    /**
+     * When isSrcdocEntry is true, this contains the baseURI of the srcdoc
+     * document for use in situations where it cannot otherwise be determined,
+     * for example with view-source.
+     */
+    [infallible] attribute nsIURI baseURI;
+
+    /**
+     * Sets/gets the current scroll restoration state,
+     * if true == "manual", false == "auto".
+     */
+    [infallible] attribute boolean scrollRestorationIsManual;
+
+    /**
+     * Flag to indicate that the history entry was originally loaded in the
+     * current process. This flag does not survive a browser process switch.
+     */
+    [infallible] readonly attribute boolean loadedInThisProcess;
 
-    /** Set/Get scrollers' positon in anchored pages */
+    /**
+     * The session history it belongs to. It's usually only set on root entries.
+     * SHEntry is strictly bound to the SHistory it belongs to; it should not be
+     * changed once set to a non-null value.
+     */
+    [noscript, infallible] attribute nsISHistory SHistory;
+
+    /**
+     * A number that is assigned by the sHistory when the entry is activated
+     */
+    [noscript, infallible] attribute unsigned long lastTouched;
+
+    /**
+     * The current number of nsISHEntries which are immediate children of this
+     * SHEntry.
+     */
+    [infallible] readonly attribute long childCount;
+
+    /**
+     * When an entry is serving is within nsISHistory's array of entries, this
+     * property specifies if it should persist. If not it will be replaced by
+     * new additions to the list.
+     */
+    [infallible] attribute boolean persist;
+
+    /** Set/Get scrollers' position in anchored pages */
     void setScrollPosition(in long x, in long y);
     void getScrollPosition(out long x, out long y);
 
+    /**
+     * Saved position and dimensions of the content viewer; we must adjust the
+     * root view's widget accordingly if this has changed when the presentation
+     * is restored.
+     */
+    [noscript, notxpcom] void getViewerBounds(in nsIntRect bounds);
+    [noscript, notxpcom] void setViewerBounds([const] in nsIntRect bounds);
+
+    /**
+     * Saved child docshells corresponding to contentViewer.  The child shells
+     * are restored as children of the parent docshell, in this order, when the
+     * parent docshell restores a saved presentation.
+     */
+
+    /** Append a child shell to the end of our list. */
+    [noscript, notxpcom] void addChildShell(in nsIDocShellTreeItem shell);
+
+    /**
+     * Get the child shell at |index|; returns null if |index| is out of bounds.
+     */
+    [noscript] nsIDocShellTreeItem childShellAt(in long index);
+
+    /**
+     * Clear the child shell list.
+     */
+    [noscript, notxpcom] void clearChildShells();
+
+    /**
+     * Ensure that the cached presentation members are self-consistent.
+     * If either |contentViewer| or |windowState| are null, then all of the
+     * following members are cleared/reset:
+     *  contentViewer, sticky, windowState, viewerBounds, childShells,
+     *  refreshURIList.
+     */
+    [noscript, notxpcom] void syncPresentationState();
+
+    /**
+     * Initialises `layoutHistoryState` if it doesn't already exist
+     * and returns a reference to it.
+     */
+    nsILayoutHistoryState initLayoutHistoryState();
+
     /** Additional ways to create an entry */
     [noscript] void create(in nsIURI URI, in AString title,
                            in nsIInputStream inputStream,
                            in nsILayoutHistoryState layoutHistoryState,
                            in unsigned long cacheKey, in ACString contentType,
                            in nsIPrincipal triggeringPrincipal,
                            in nsIPrincipal principalToInherit,
                            in nsIDRef docshellID,
                            in boolean dynamicCreation);
 
     nsISHEntry clone();
 
-    /** Attribute that indicates if this entry is for a subframe navigation */
-    void setIsSubFrame(in boolean aFlag);
-
     /** Return any content viewer present in or below this node in the
         nsSHEntry tree.  This will differ from contentViewer in the case
         where a child nsSHEntry has the content viewer for this tree. */
-    nsIContentViewer getAnyContentViewer(out nsISHEntry ownerEntry);
-
-    /**
-     * Get the principal, if any, that was associated with the channel
-     * that the document that was loaded to create this history entry
-     * came from.
-     */
-    attribute nsIPrincipal triggeringPrincipal;
-
-    /**
-     * Get the principal, if any, that is used when the inherit flag
-     * is set.
-     */
-    attribute nsIPrincipal principalToInherit;
-
-    /**
-     * Get/set data associated with this history state via a pushState() call,
-     * serialized using structured clone.
-     **/
-    attribute nsIStructuredCloneContainer stateData;
+    [noscript] nsIContentViewer getAnyContentViewer(out nsISHEntry ownerEntry);
 
     /**
      * Gets the owning pointer to the editor data assosicated with
      * this shistory entry. This forgets its pointer, so free it when
      * you're done.
      */
     [noscript, notxpcom] nsDocShellEditorDataPtr forgetEditorData();
 
@@ -248,165 +305,98 @@ interface nsISHEntry : nsISupports
 
     /** Returns true if this shistory entry is storing a detached editor. */
     [noscript, notxpcom] boolean hasDetachedEditor();
 
     /**
      * Returns true if the related docshell was added because of
      * dynamic addition of an iframe/frame.
      */
-    boolean isDynamicallyAdded();
+    [noscript, notxpcom] boolean isDynamicallyAdded();
 
     /**
      * Returns true if any of the child entries returns true
      * when isDynamicallyAdded is called on it.
      */
     boolean hasDynamicallyAddedChild();
 
     /**
-     * The history ID of the docshell.
-     */
-    attribute nsIDPtr docshellID;
-
-    /**
-     * Helper method for accessing this value from C++
+     * Helper method for accessing `docshellID` from C++
      */
     [noscript, notxpcom] nsID DocshellID();
 
-    readonly attribute nsIBFCacheEntry BFCacheEntry;
-
     /**
-     * Does this SHEntry point to the given BFCache entry?  If so, evicting
+     * Does this SHEntry point to the given BFCache entry? If so, evicting
      * the BFCache entry will evict the SHEntry, since the two entries
      * correspond to the same document.
      */
-    [notxpcom, noscript]
-    boolean hasBFCacheEntry(in nsIBFCacheEntry aEntry);
+    [noscript, notxpcom] boolean hasBFCacheEntry(in nsIBFCacheEntry aEntry);
 
     /**
      * Adopt aEntry's BFCacheEntry, so now both this and aEntry point to
      * aEntry's BFCacheEntry.
      */
     void adoptBFCacheEntry(in nsISHEntry aEntry);
 
     /**
-     * Create a new BFCache entry and drop our reference to our old one.  This
+     * Create a new BFCache entry and drop our reference to our old one. This
      * call unlinks this SHEntry from any other SHEntries for its document.
      */
     void abandonBFCacheEntry();
 
     /**
-     * Does this SHEntry correspond to the same document as aEntry?  This is
-     * true iff the two SHEntries have the same BFCacheEntry.  So in
-     * particular, sharesDocumentWith(aEntry) is guaranteed to return true if
-     * it's preceeded by a call to adoptBFCacheEntry(aEntry).
+     * Does this SHEntry correspond to the same document as aEntry? This is
+     * true iff the two SHEntries have the same BFCacheEntry. So in particular,
+     * sharesDocumentWith(aEntry) is guaranteed to return true if it's
+     * preceded by a call to adoptBFCacheEntry(aEntry).
      */
     boolean sharesDocumentWith(in nsISHEntry aEntry);
 
     /**
-     * True if this SHEntry corresponds to a document created by a srcdoc iframe.
-     * Set when a value is assigned to  srcdocData.
-     */
-    readonly attribute boolean isSrcdocEntry;
-
-    /**
-     * Contents of the srcdoc attribute in a srcdoc iframe to be loaded instead
-     * of the URI.  Similar to a Data URI, this information is needed to
-     * recreate the document at a later stage.
-     * Setting this sets isSrcdocEntry to true
-     */
-    attribute AString srcdocData;
-
-    /**
-     * When isSrcdocEntry is true, this contains the baseURI of the srcdoc
-     * document for use in situations where it cannot otherwise be determined,
-     * for example with view-source.
-     */
-    attribute nsIURI baseURI;
-
-    /**
-     * Sets/gets the current scroll restoration state,
-     * if true == "manual", false == "auto".
-     */
-    attribute boolean scrollRestorationIsManual;
-
-    /**
-     * Flag to indicate that the history entry was originally loaded in the
-     * current process. This flag does not survive a browser process switch.
-     */
-    readonly attribute boolean loadedInThisProcess;
-
-    /**
-     * The session history it belongs to. It's usually only set on root entries.
-     * SHEntry is strictly bound to the SHistory it belongs to; it should not be
-     * changed once set to a non-null value.
-     */
-    [noscript] attribute nsISHistory SHistory;
-
-    /**
-     * Sets an SHEntry to reflect that it is a history type load. as
+     * Sets an SHEntry to reflect that it is a history type load. As
      * nsIDocShellLoadInfo and its LoadType enum were removed, this is the
      * equivalent to doing
      *
      * shEntry.loadType = 4;
      *
      * in js, but easier to maintain and less opaque.
      */
-    void setAsHistoryLoad();
-
-    /**
-     * A number that is assigned by the sHistory when the entry is activated
-     */
-    [noscript] attribute unsigned long lastTouched;
+    void setLoadTypeAsHistory();
 
     /**
      * Some state, particularly that related to the back/forward cache, is
      * shared between SHEntries which correspond to the same document.  This
      * method gets a pointer to that shared state.
      *
      * This shared state is the SHEntry's BFCacheEntry.  So
      * hasBFCacheEntry(getSharedState()) is guaranteed to return true.
      */
-    [noscript, notxpcom]
-    nsSHEntryShared getSharedState();
-
-    /**
-     * The current number of nsISHEntries which are immediate children of this
-     * SHEntry.
-     */
-    readonly attribute long childCount;
+    [noscript, notxpcom] nsSHEntryShared getSharedState();
 
     /**
      * Add a new child SHEntry. If offset is -1 adds to the end of the list.
      */
     void AddChild(in nsISHEntry aChild, in long aOffset);
 
     /**
      * Remove a child SHEntry.
      */
-    void RemoveChild(in nsISHEntry aChild);
+    [noscript] void RemoveChild(in nsISHEntry aChild);
 
     /**
      * Get child at an index.
      */
     nsISHEntry GetChildAt(in long aIndex);
 
     /**
      * Replaces a child which is for the same docshell as aNewChild
      * with aNewChild.
      * @throw if nothing was replaced.
      */
-    void ReplaceChild(in nsISHEntry aNewChild);
-
-    /**
-     * When an entry is serving is within nsISHistory's array of entries, this
-     * property specifies if it should persist. If not it will be replaced by
-     * new additions to the list.
-     */
-    [infallible] attribute boolean persist;
+    [noscript] void ReplaceChild(in nsISHEntry aNewChild);
 };
 
 %{ C++
 // {BFD1A791-AD9F-11d3-BDC7-0050040A9B44}
 #define NS_SHENTRY_CID \
 {0xbfd1a791, 0xad9f, 0x11d3, {0xbd, 0xc7, 0x0, 0x50, 0x4, 0xa, 0x9b, 0x44}}
 
 #define NS_SHENTRY_CONTRACTID \
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -214,17 +214,18 @@ nsSHEntry::GetContentViewer(nsIContentVi
 
 NS_IMETHODIMP
 nsSHEntry::GetAnyContentViewer(nsISHEntry** aOwnerEntry,
                                nsIContentViewer** aResult)
 {
   // Find a content viewer in the root node or any of its children,
   // assuming that there is only one content viewer total in any one
   // nsSHEntry tree
-  GetContentViewer(aResult);
+  nsCOMPtr<nsIContentViewer> viewer = GetContentViewer();
+  viewer.forget(aResult);
   if (*aResult) {
 #ifdef DEBUG_PAGE_CACHE
     printf("Found content viewer\n");
 #endif
     *aOwnerEntry = this;
     NS_ADDREF(*aOwnerEntry);
     return NS_OK;
   }
@@ -317,21 +318,22 @@ nsSHEntry::SetLayoutHistoryState(nsILayo
 }
 
 NS_IMETHODIMP
 nsSHEntry::InitLayoutHistoryState(nsILayoutHistoryState** aState)
 {
   if (!mShared->mLayoutHistoryState) {
     nsCOMPtr<nsILayoutHistoryState> historyState;
     historyState = NS_NewLayoutHistoryState();
-    nsresult rv = SetLayoutHistoryState(historyState);
-    NS_ENSURE_SUCCESS(rv, rv);
+    SetLayoutHistoryState(historyState);
   }
 
-  return GetLayoutHistoryState(aState);
+  nsCOMPtr<nsILayoutHistoryState> state = GetLayoutHistoryState();
+  state.forget(aState);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetLoadType(uint32_t* aResult)
 {
   *aResult = mLoadType;
   return NS_OK;
 }
@@ -490,17 +492,16 @@ nsSHEntry::Clone(nsISHEntry** aResult)
   *aResult = new nsSHEntry(*this);
   NS_ADDREF(*aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetParent(nsISHEntry** aResult)
 {
-  NS_ENSURE_ARG_POINTER(aResult);
   *aResult = mParent;
   NS_IF_ADDREF(*aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetParent(nsISHEntry* aParent)
 {
@@ -522,45 +523,38 @@ nsSHEntry::SetWindowState(nsISupports* a
 
 NS_IMETHODIMP
 nsSHEntry::GetWindowState(nsISupports** aState)
 {
   NS_IF_ADDREF(*aState = mShared->mWindowState);
   return NS_OK;
 }
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsSHEntry::SetViewerBounds(const nsIntRect& aBounds)
 {
   mShared->mViewerBounds = aBounds;
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsSHEntry::GetViewerBounds(nsIntRect& aBounds)
 {
   aBounds = mShared->mViewerBounds;
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetTriggeringPrincipal(nsIPrincipal** aTriggeringPrincipal)
 {
   NS_IF_ADDREF(*aTriggeringPrincipal = mShared->mTriggeringPrincipal);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetTriggeringPrincipal(nsIPrincipal* aTriggeringPrincipal)
 {
-  MOZ_ASSERT(aTriggeringPrincipal, "need a valid triggeringPrincipal");
-  if (!aTriggeringPrincipal) {
-    return NS_ERROR_FAILURE;
-  }
-
   mShared->mTriggeringPrincipal = aTriggeringPrincipal;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetPrincipalToInherit(nsIPrincipal** aPrincipalToInherit)
 {
   NS_IF_ADDREF(*aPrincipalToInherit = mShared->mPrincipalToInherit);
@@ -572,17 +566,16 @@ nsSHEntry::SetPrincipalToInherit(nsIPrin
 {
   mShared->mPrincipalToInherit = aPrincipalToInherit;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetBFCacheEntry(nsIBFCacheEntry** aEntry)
 {
-  NS_ENSURE_ARG_POINTER(aEntry);
   NS_IF_ADDREF(*aEntry = mShared);
   return NS_OK;
 }
 
 bool
 nsSHEntry::HasBFCacheEntry(nsIBFCacheEntry* aEntry)
 {
   return static_cast<nsIBFCacheEntry*>(mShared) == aEntry;
@@ -697,31 +690,26 @@ nsSHEntry::AddChild(nsISHEntry* aChild, 
   //  Later frames in the child list may load faster and get appended
   //  before earlier frames, causing session history to be scrambled.
   //  By growing the list here, they are added to the right position.
   //
   //  Assert that aOffset will not be so high as to grow us a lot.
   //
   NS_ASSERTION(aOffset < (mChildren.Count() + 1023), "Large frames array!\n");
 
-  bool newChildIsDyn = false;
-  if (aChild) {
-    aChild->IsDynamicallyAdded(&newChildIsDyn);
-  }
+  bool newChildIsDyn = aChild ? aChild->IsDynamicallyAdded() : false;
 
   // If the new child is dynamically added, try to add it to aOffset, but if
   // there are non-dynamically added children, the child must be after those.
   if (newChildIsDyn) {
     int32_t lastNonDyn = aOffset - 1;
     for (int32_t i = aOffset; i < mChildren.Count(); ++i) {
       nsISHEntry* entry = mChildren[i];
       if (entry) {
-        bool dyn = false;
-        entry->IsDynamicallyAdded(&dyn);
-        if (dyn) {
+        if (entry->IsDynamicallyAdded()) {
           break;
         } else {
           lastNonDyn = i;
         }
       }
     }
     // InsertObjectAt allows only appending one object.
     // If aOffset is larger than Count(), we must first manually
@@ -740,19 +728,17 @@ nsSHEntry::AddChild(nsISHEntry* aChild, 
     // moved to be after aOffset.
     if (mChildren.Count() > 0) {
       int32_t start = std::min(mChildren.Count() - 1, aOffset);
       int32_t dynEntryIndex = -1;
       nsISHEntry* dynEntry = nullptr;
       for (int32_t i = start; i >= 0; --i) {
         nsISHEntry* entry = mChildren[i];
         if (entry) {
-          bool dyn = false;
-          entry->IsDynamicallyAdded(&dyn);
-          if (dyn) {
+          if (entry->IsDynamicallyAdded()) {
             dynEntryIndex = i;
             dynEntry = entry;
           } else {
             break;
           }
         }
       }
 
@@ -779,19 +765,17 @@ nsSHEntry::AddChild(nsISHEntry* aChild, 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::RemoveChild(nsISHEntry* aChild)
 {
   NS_ENSURE_TRUE(aChild, NS_ERROR_FAILURE);
   bool childRemoved = false;
-  bool dynamic = false;
-  aChild->IsDynamicallyAdded(&dynamic);
-  if (dynamic) {
+  if (aChild->IsDynamicallyAdded()) {
     childRemoved = mChildren.RemoveObject(aChild);
   } else {
     int32_t index = mChildren.IndexOfObject(aChild);
     if (index >= 0) {
       // Other alive non-dynamic child docshells still keep mChildOffset,
       // so we don't want to change the indices here.
       mChildren.ReplaceObjectAt(nullptr, index);
       childRemoved = true;
@@ -836,56 +820,54 @@ nsSHEntry::ReplaceChild(nsISHEntry* aNew
       mChildren[i]->SetParent(nullptr);
       mChildren.ReplaceObjectAt(aNewEntry, i);
       return aNewEntry->SetParent(this);
     }
   }
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsSHEntry::AddChildShell(nsIDocShellTreeItem* aShell)
 {
-  NS_ASSERTION(aShell, "Null child shell added to history entry");
+  MOZ_ASSERT(aShell, "Null child shell added to history entry");
   mShared->mChildShells.AppendObject(aShell);
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::ChildShellAt(int32_t aIndex, nsIDocShellTreeItem** aShell)
 {
   NS_IF_ADDREF(*aShell = mShared->mChildShells.SafeObjectAt(aIndex));
   return NS_OK;
 }
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsSHEntry::ClearChildShells()
 {
   mShared->mChildShells.Clear();
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetRefreshURIList(nsIMutableArray** aList)
 {
   NS_IF_ADDREF(*aList = mShared->mRefreshURIList);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetRefreshURIList(nsIMutableArray* aList)
 {
   mShared->mRefreshURIList = aList;
   return NS_OK;
 }
 
-NS_IMETHODIMP
+NS_IMETHODIMP_(void)
 nsSHEntry::SyncPresentationState()
 {
-  return mShared->SyncPresentationState();
+  mShared->SyncPresentationState();
 }
 
 nsDocShellEditorData*
 nsSHEntry::ForgetEditorData()
 {
   // XXX jlebar Check how this is used.
   return mShared->mEditorData.forget();
 }
@@ -904,43 +886,41 @@ bool
 nsSHEntry::HasDetachedEditor()
 {
   return mShared->mEditorData != nullptr;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetStateData(nsIStructuredCloneContainer** aContainer)
 {
-  NS_ENSURE_ARG_POINTER(aContainer);
   NS_IF_ADDREF(*aContainer = mStateData);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetStateData(nsIStructuredCloneContainer* aContainer)
 {
   mStateData = aContainer;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHEntry::IsDynamicallyAdded(bool* aAdded)
+NS_IMETHODIMP_(bool)
+nsSHEntry::IsDynamicallyAdded()
 {
-  *aAdded = mShared->mDynamicallyCreated;
-  return NS_OK;
+  return mShared->mDynamicallyCreated;
 }
 
 NS_IMETHODIMP
 nsSHEntry::HasDynamicallyAddedChild(bool* aAdded)
 {
   *aAdded = false;
   for (int32_t i = 0; i < mChildren.Count(); ++i) {
     nsISHEntry* entry = mChildren[i];
     if (entry) {
-      entry->IsDynamicallyAdded(aAdded);
+      *aAdded = entry->IsDynamicallyAdded();
       if (*aAdded) {
         break;
       }
     }
   }
   return NS_OK;
 }
 
@@ -992,28 +972,26 @@ nsSHEntry::SetSHistory(nsISHistory* aSHi
   nsWeakPtr shistory = do_GetWeakReference(aSHistory);
   // mSHistory can not be changed once it's set
   MOZ_ASSERT(!mShared->mSHistory || (mShared->mSHistory == shistory));
   mShared->mSHistory = shistory;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSHEntry::SetAsHistoryLoad()
+nsSHEntry::SetLoadTypeAsHistory()
 {
   // Set the LoadType by default to loadHistory during creation
   mLoadType = LOAD_HISTORY;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::GetPersist(bool* aPersist)
 {
-  NS_ENSURE_ARG_POINTER(aPersist);
-
   *aPersist = mPersist;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHEntry::SetPersist(bool aPersist)
 {
   mPersist = aPersist;
--- a/docshell/shistory/nsSHEntryShared.cpp
+++ b/docshell/shistory/nsSHEntryShared.cpp
@@ -92,27 +92,25 @@ void
 nsSHEntryShared::RemoveFromExpirationTracker()
 {
   nsCOMPtr<nsISHistory> shistory = do_QueryReferent(mSHistory);
   if (shistory && GetExpirationState()->IsTracked()) {
     shistory->RemoveFromExpirationTracker(this);
   }
 }
 
-nsresult
+void
 nsSHEntryShared::SyncPresentationState()
 {
   if (mContentViewer && mWindowState) {
     // If we have a content viewer and a window state, we should be ok.
-    return NS_OK;
+    return;
   }
 
   DropPresentationState();
-
-  return NS_OK;
 }
 
 void
 nsSHEntryShared::DropPresentationState()
 {
   RefPtr<nsSHEntryShared> kungFuDeathGrip = this;
 
   if (mDocument) {
--- a/docshell/shistory/nsSHEntryShared.h
+++ b/docshell/shistory/nsSHEntryShared.h
@@ -59,17 +59,17 @@ public:
 private:
   ~nsSHEntryShared();
 
   friend class nsSHEntry;
 
   static already_AddRefed<nsSHEntryShared> Duplicate(nsSHEntryShared* aEntry);
 
   void RemoveFromExpirationTracker();
-  nsresult SyncPresentationState();
+  void SyncPresentationState();
   void DropPresentationState();
 
   nsresult SetContentViewer(nsIContentViewer* aViewer);
 
   // See nsISHEntry.idl for an explanation of these members.
 
   // These members are copied by nsSHEntryShared::Duplicate().  If you add a
   // member here, be sure to update the Duplicate() implementation.
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -84,18 +84,17 @@ static LazyLogModule gSHistoryLog("nsSHi
 // For example:
 //
 //  nsCOMPtr<nsISHEntry> shentry = [...];
 //  LOG_SHENTRY_SPEC(("shentry %p has uri %s.", shentry.get(), _spec), shentry);
 //
 #define LOG_SHENTRY_SPEC(format, shentry)                  \
   PR_BEGIN_MACRO                                           \
     if (MOZ_LOG_TEST(gSHistoryLog, LogLevel::Debug)) {     \
-      nsCOMPtr<nsIURI> uri;                                \
-      shentry->GetURI(getter_AddRefs(uri));                \
+      nsCOMPtr<nsIURI> uri = shentry->GetURI();            \
       LOG_SPEC(format, uri);                               \
     }                                                      \
   PR_END_MACRO
 
 // Iterates over all registered session history listeners.
 #define ITERATE_LISTENERS(body)                            \
   PR_BEGIN_MACRO                                           \
   {                                                        \
@@ -382,33 +381,32 @@ nsSHistory::Shutdown()
 // static
 nsISHEntry*
 nsSHistory::GetRootSHEntry(nsISHEntry* aEntry)
 {
   nsCOMPtr<nsISHEntry> rootEntry = aEntry;
   nsISHEntry* result = nullptr;
   while (rootEntry) {
     result = rootEntry;
-    result->GetParent(getter_AddRefs(rootEntry));
+    rootEntry = result->GetParent();
   }
 
   return result;
 }
 
 // static
 nsresult
 nsSHistory::WalkHistoryEntries(nsISHEntry* aRootEntry,
                                nsDocShell* aRootShell,
                                WalkHistoryEntriesFunc aCallback,
                                void* aData)
 {
   NS_ENSURE_TRUE(aRootEntry, NS_ERROR_FAILURE);
 
-  int32_t childCount;
-  aRootEntry->GetChildCount(&childCount);
+  int32_t childCount = aRootEntry->GetChildCount();
   for (int32_t i = 0; i < childCount; i++) {
     nsCOMPtr<nsISHEntry> childEntry;
     aRootEntry->GetChildAt(i, getter_AddRefs(childEntry));
     if (!childEntry) {
       // childEntry can be null for valid reasons, for example if the
       // docshell at index i never loaded anything useful.
       // Remember to clone also nulls in the child array (bug 464064).
       aCallback(nullptr, nullptr, i, aData);
@@ -473,18 +471,17 @@ nsSHistory::CloneAndReplaceChild(nsISHEn
 
   if (!aEntry) {
     if (data->destTreeParent) {
       data->destTreeParent->AddChild(nullptr, aEntryIndex);
     }
     return NS_OK;
   }
 
-  uint32_t srcID;
-  aEntry->GetID(&srcID);
+  uint32_t srcID = aEntry->GetID();
 
   nsresult rv = NS_OK;
   if (srcID == cloneID) {
     // Replace the entry
     dest = replaceEntry;
   } else {
     // Clone the SHEntry...
     rv = aEntry->Clone(getter_AddRefs(dest));
@@ -549,35 +546,33 @@ nsSHistory::SetChildHistoryEntry(nsISHEn
   nsCOMPtr<nsISHEntry> destEntry;
 
   if (data->destTreeParent) {
     // aEntry is a clone of some child of destTreeParent, but since the
     // trees aren't necessarily in sync, we'll have to locate it.
     // Note that we could set aShell's entry to null if we don't find a
     // corresponding entry under destTreeParent.
 
-    uint32_t targetID, id;
-    aEntry->GetID(&targetID);
+    uint32_t targetID = aEntry->GetID();
 
     // First look at the given index, since this is the common case.
     nsCOMPtr<nsISHEntry> entry;
     data->destTreeParent->GetChildAt(aEntryIndex, getter_AddRefs(entry));
-    if (entry && NS_SUCCEEDED(entry->GetID(&id)) && id == targetID) {
+    if (entry && entry->GetID() == targetID) {
       destEntry.swap(entry);
     } else {
       int32_t childCount;
       data->destTreeParent->GetChildCount(&childCount);
       for (int32_t i = 0; i < childCount; ++i) {
         data->destTreeParent->GetChildAt(i, getter_AddRefs(entry));
         if (!entry) {
           continue;
         }
 
-        entry->GetID(&id);
-        if (id == targetID) {
+        if (entry->GetID() == targetID) {
           destEntry.swap(entry);
           break;
         }
       }
     }
   } else {
     destEntry = destTreeRoot;
   }
@@ -592,18 +587,17 @@ nsSHistory::SetChildHistoryEntry(nsISHEn
 /* Add an entry to the History list at mIndex and
  * increment the index to point to the new entry
  */
 NS_IMETHODIMP
 nsSHistory::AddEntry(nsISHEntry* aSHEntry, bool aPersist)
 {
   NS_ENSURE_ARG(aSHEntry);
 
-  nsCOMPtr<nsISHistory> shistoryOfEntry;
-  aSHEntry->GetSHistory(getter_AddRefs(shistoryOfEntry));
+  nsCOMPtr<nsISHistory> shistoryOfEntry = aSHEntry->GetSHistory();
   if (shistoryOfEntry && shistoryOfEntry != this) {
     NS_WARNING("The entry has been associated to another nsISHistory instance. "
                "Try nsISHEntry.clone() and nsISHEntry.abandonBFCacheEntry() "
                "first if you're copying an entry from another nsISHistory.");
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsISHEntry> currentTxn;
@@ -623,18 +617,17 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntr
 
   if (currentTxn && !currentTxn->GetPersist()) {
     NOTIFY_LISTENERS(OnHistoryReplaceEntry, (mIndex));
     aSHEntry->SetPersist(aPersist);
     mEntries[mIndex] = aSHEntry;
     return NS_OK;
   }
 
-  nsCOMPtr<nsIURI> uri;
-  aSHEntry->GetURI(getter_AddRefs(uri));
+  nsCOMPtr<nsIURI> uri = aSHEntry->GetURI();
   NOTIFY_LISTENERS(OnHistoryNewEntry, (uri, mIndex));
 
   // Remove all entries after the current one, add the new one, and set the new
   // one as the current one.
   MOZ_ASSERT(mIndex >= -1);
   aSHEntry->SetPersist(aPersist);
   mEntries.TruncateLength(mIndex + 1);
   mEntries.AppendElement(aSHEntry);
@@ -712,22 +705,20 @@ nsSHistory::GetIndexOfEntry(nsISHEntry* 
 }
 
 #ifdef DEBUG
 nsresult
 nsSHistory::PrintHistory()
 {
   for (int32_t i = 0; i < Length(); i++) {
     nsCOMPtr<nsISHEntry> entry = mEntries[i];
-    nsCOMPtr<nsILayoutHistoryState> layoutHistoryState;
-    nsCOMPtr<nsIURI> uri;
+    nsCOMPtr<nsILayoutHistoryState> layoutHistoryState =
+      entry->GetLayoutHistoryState();
+    nsCOMPtr<nsIURI> uri = entry->GetURI();
     nsString title;
-
-    entry->GetLayoutHistoryState(getter_AddRefs(layoutHistoryState));
-    entry->GetURI(getter_AddRefs(uri));
     entry->GetTitle(title);
 
 #if 0
     nsAutoCString url;
     if (uri) {
       uri->GetSpec(url);
     }
 
@@ -812,18 +803,17 @@ NS_IMETHODIMP
 nsSHistory::ReplaceEntry(int32_t aIndex, nsISHEntry* aReplaceEntry)
 {
   NS_ENSURE_ARG(aReplaceEntry);
 
   if (aIndex < 0 || aIndex >= Length()) {
     return NS_ERROR_FAILURE;
   }
 
-  nsCOMPtr<nsISHistory> shistoryOfEntry;
-  aReplaceEntry->GetSHistory(getter_AddRefs(shistoryOfEntry));
+  nsCOMPtr<nsISHistory> shistoryOfEntry = aReplaceEntry->GetSHistory();
   if (shistoryOfEntry && shistoryOfEntry != this) {
     NS_WARNING("The entry has been associated to another nsISHistory instance. "
                "Try nsISHEntry.clone() and nsISHEntry.abandonBFCacheEntry() "
                "first if you're copying an entry from another nsISHistory.");
     return NS_ERROR_FAILURE;
   }
 
   aReplaceEntry->SetSHistory(this);
@@ -994,17 +984,17 @@ public:
     : mSHistory(aSHistory)
     , mEntry(aEntry)
     , mLastTouched(0)
     , mDistance(aDist)
   {
     mViewer = GetContentViewerForEntry(aEntry);
     NS_ASSERTION(mViewer, "Entry should have a content viewer");
 
-    mEntry->GetLastTouched(&mLastTouched);
+    mLastTouched = mEntry->GetLastTouched();
   }
 
   bool operator<(const EntryAndDistance& aOther) const
   {
     // Compare distances first, and fall back to last-accessed times.
     if (aOther.mDistance != this->mDistance) {
       return this->mDistance < aOther.mDistance;
     }
@@ -1199,41 +1189,38 @@ nsSHistory::GloballyEvictAllContentViewe
   sHistoryMaxTotalViewers = maxViewers;
 }
 
 void
 GetDynamicChildren(nsISHEntry* aEntry,
                    nsTArray<nsID>& aDocshellIDs,
                    bool aOnlyTopLevelDynamic)
 {
-  int32_t count = 0;
-  aEntry->GetChildCount(&count);
+  int32_t count = aEntry->GetChildCount();
   for (int32_t i = 0; i < count; ++i) {
     nsCOMPtr<nsISHEntry> child;
     aEntry->GetChildAt(i, getter_AddRefs(child));
     if (child) {
-      bool dynAdded = false;
-      child->IsDynamicallyAdded(&dynAdded);
+      bool dynAdded = child->IsDynamicallyAdded();
       if (dynAdded) {
         nsID docshellID = child->DocshellID();
         aDocshellIDs.AppendElement(docshellID);
       }
       if (!dynAdded || !aOnlyTopLevelDynamic) {
         GetDynamicChildren(child, aDocshellIDs, aOnlyTopLevelDynamic);
       }
     }
   }
 }
 
 bool
 RemoveFromSessionHistoryEntry(nsISHEntry* aRoot, nsTArray<nsID>& aDocshellIDs)
 {
   bool didRemove = false;
-  int32_t childCount = 0;
-  aRoot->GetChildCount(&childCount);
+  int32_t childCount = aRoot->GetChildCount();
   for (int32_t i = childCount - 1; i >= 0; --i) {
     nsCOMPtr<nsISHEntry> child;
     aRoot->GetChildAt(i, getter_AddRefs(child));
     if (child) {
       nsID docshelldID = child->DocshellID();
       if (aDocshellIDs.Contains(docshelldID)) {
         didRemove = true;
         aRoot->RemoveChild(child);
@@ -1261,26 +1248,24 @@ bool
 IsSameTree(nsISHEntry* aEntry1, nsISHEntry* aEntry2)
 {
   if (!aEntry1 && !aEntry2) {
     return true;
   }
   if ((!aEntry1 && aEntry2) || (aEntry1 && !aEntry2)) {
     return false;
   }
-  uint32_t id1, id2;
-  aEntry1->GetID(&id1);
-  aEntry2->GetID(&id2);
+  uint32_t id1 = aEntry1->GetID();
+  uint32_t id2 = aEntry2->GetID();
   if (id1 != id2) {
     return false;
   }
 
-  int32_t count1, count2;
-  aEntry1->GetChildCount(&count1);
-  aEntry2->GetChildCount(&count2);
+  int32_t count1 = aEntry1->GetChildCount();
+  int32_t count2 = aEntry2->GetChildCount();
   // We allow null entries in the end of the child list.
   int32_t count = std::max(count1, count2);
   for (int32_t i = 0; i < count; ++i) {
     nsCOMPtr<nsISHEntry> child1, child2;
     aEntry1->GetChildAt(i, getter_AddRefs(child1));
     aEntry2->GetChildAt(i, getter_AddRefs(child2));
     if (!IsSameTree(child1, child2)) {
       return false;
@@ -1410,17 +1395,18 @@ nsSHistory::GetCurrentURI(nsIURI** aResu
   NS_ENSURE_ARG_POINTER(aResultURI);
   nsresult rv;
 
   nsCOMPtr<nsISHEntry> currentEntry;
   rv = GetEntryAtIndex(mIndex, getter_AddRefs(currentEntry));
   if (NS_FAILED(rv) && !currentEntry) {
     return rv;
   }
-  rv = currentEntry->GetURI(aResultURI);
+  nsCOMPtr<nsIURI> uri = currentEntry->GetURI();
+  uri.forget(aResultURI);
   return rv;
 }
 
 NS_IMETHODIMP
 nsSHistory::GotoIndex(int32_t aIndex)
 {
   return LoadEntry(aIndex, LOAD_HISTORY, HIST_CMD_GOTOINDEX);
 }
@@ -1441,41 +1427,40 @@ nsSHistory::LoadNextPossibleEntry(int32_
 
 nsresult
 nsSHistory::LoadEntry(int32_t aIndex, long aLoadType, uint32_t aHistCmd)
 {
   if (!mRootDocShell) {
     return NS_ERROR_FAILURE;
   }
 
-  nsCOMPtr<nsIURI> nextURI;
-  nsCOMPtr<nsISHEntry> prevEntry;
-  nsCOMPtr<nsISHEntry> nextEntry;
   if (aIndex < 0 || aIndex >= Length()) {
     // The index is out of range
     return NS_ERROR_FAILURE;
   }
 
   // This is a normal local history navigation.
   // Keep note of requested history index in mRequestedIndex.
   mRequestedIndex = aIndex;
 
+  nsCOMPtr<nsISHEntry> prevEntry;
+  nsCOMPtr<nsISHEntry> nextEntry;
   GetEntryAtIndex(mIndex, getter_AddRefs(prevEntry));
   GetEntryAtIndex(mRequestedIndex, getter_AddRefs(nextEntry));
   if (!nextEntry || !prevEntry) {
     mRequestedIndex = -1;
     return NS_ERROR_FAILURE;
   }
 
   // Remember that this entry is getting loaded at this point in the sequence
 
   nextEntry->SetLastTouched(++gTouchCounter);
 
   // Get the uri for the entry we are about to visit
-  nextEntry->GetURI(getter_AddRefs(nextURI));
+  nsCOMPtr<nsIURI> nextURI = nextEntry->GetURI();
 
   MOZ_ASSERT((prevEntry && nextEntry && nextURI), "prevEntry, nextEntry and nextURI can't be null");
 
   // Send appropriate listener notifications.
   if (aHistCmd == HIST_CMD_GOTOINDEX) {
     // We are going somewhere else. This is not reload either
     NOTIFY_LISTENERS(OnHistoryGotoIndex, (aIndex, nextURI));
   }
@@ -1502,37 +1487,32 @@ nsSHistory::LoadDifferingEntries(nsISHEn
                                  nsIDocShell* aParent, long aLoadType,
                                  bool& aDifferenceFound)
 {
   if (!aPrevEntry || !aNextEntry || !aParent) {
     return NS_ERROR_FAILURE;
   }
 
   nsresult result = NS_OK;
-  uint32_t prevID, nextID;
-
-  aPrevEntry->GetID(&prevID);
-  aNextEntry->GetID(&nextID);
+  uint32_t prevID = aPrevEntry->GetID();
+  uint32_t nextID = aNextEntry->GetID();
 
   // Check the IDs to verify if the pages are different.
   if (prevID != nextID) {
     aDifferenceFound = true;
 
     // Set the Subframe flag if not navigating the root docshell.
     aNextEntry->SetIsSubFrame(aParent != mRootDocShell);
     return InitiateLoad(aNextEntry, aParent, aLoadType);
   }
 
   // The entries are the same, so compare any child frames
-  int32_t pcnt = 0;
-  int32_t ncnt = 0;
+  int32_t pcnt = aPrevEntry->GetChildCount();
+  int32_t ncnt = aNextEntry->GetChildCount();
   int32_t dsCount = 0;
-
-  aPrevEntry->GetChildCount(&pcnt);
-  aNextEntry->GetChildCount(&ncnt);
   aParent->GetChildCount(&dsCount);
 
   // Create an array for child docshells.
   nsCOMArray<nsIDocShell> docshells;
   for (int32_t i = 0; i < dsCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> treeItem;
     aParent->GetChildAt(i, getter_AddRefs(treeItem));
     nsCOMPtr<nsIDocShell> shell = do_QueryInterface(treeItem);
@@ -1601,27 +1581,23 @@ nsSHistory::InitiateLoad(nsISHEntry* aFr
    * This will be passed on to child subframes later in nsDocShell,
    * so that proper loadType is maintained through out a frameset
    */
   aFrameEntry->SetLoadType(aLoadType);
 
   loadInfo->SetLoadType(aLoadType);
   loadInfo->SetSHEntry(aFrameEntry);
 
-  nsCOMPtr<nsIURI> originalURI;
-  aFrameEntry->GetOriginalURI(getter_AddRefs(originalURI));
+  nsCOMPtr<nsIURI> originalURI = aFrameEntry->GetOriginalURI();
   loadInfo->SetOriginalURI(originalURI);
 
-  bool loadReplace;
-  aFrameEntry->GetLoadReplace(&loadReplace);
-  loadInfo->SetLoadReplace(loadReplace);
+  loadInfo->SetLoadReplace(aFrameEntry->GetLoadReplace());
 
-  nsCOMPtr<nsIURI> nextURI;
-  aFrameEntry->GetURI(getter_AddRefs(nextURI));
-  // Time   to initiate a document load
+  nsCOMPtr<nsIURI> nextURI = aFrameEntry->GetURI();
+  // Time to initiate a document load
   return aFrameDS->LoadURI(nextURI, loadInfo,
                            nsIWebNavigation::LOAD_FLAGS_NONE, false);
 
 }
 
 NS_IMETHODIMP_(void)
 nsSHistory::SetRootDocShell(nsIDocShell* aDocShell)
 {
--- a/dom/payments/MerchantValidationEvent.cpp
+++ b/dom/payments/MerchantValidationEvent.cpp
@@ -59,16 +59,27 @@ MerchantValidationEvent::Constructor(
   e->SetComposed(aEventInitDict.mComposed);
   return e.forget();
 }
 
 bool
 MerchantValidationEvent::init(const MerchantValidationEventInit& aEventInitDict,
                               ErrorResult& aRv)
 {
+  // Check methodName is valid
+  if (!aEventInitDict.mMethodName.IsEmpty()) {
+    nsString errMsg;
+    auto rv = PaymentRequest::IsValidPaymentMethodIdentifier(
+      aEventInitDict.mMethodName, errMsg);
+    if (NS_FAILED(rv)) {
+      aRv.ThrowRangeError<MSG_ILLEGAL_RANGE_PR_CONSTRUCTOR>(errMsg);
+      return false;
+    }
+  }
+  SetMethodName(aEventInitDict.mMethodName);
   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(GetParentObject());
   auto doc = window->GetExtantDoc();
   if (!doc) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return false;
   }
   auto principal = doc->NodePrincipal();
 
@@ -115,17 +126,18 @@ MerchantValidationEvent::ResolvedCallbac
   }
   mWaitForUpdate = false;
 
   // If we eventually end up supporting merchant validation
   // we would validate `aValue` here, as per:
   // https://w3c.github.io/payment-request/#validate-merchant-s-details-algorithm
   //
   // Right now, MerchantValidationEvent is only implemented for standards
-  // conformance, which is why at this point we throw a NS_ERROR_DOM_NOT_SUPPORTED_ERR.
+  // conformance, which is why at this point we throw a
+  // NS_ERROR_DOM_NOT_SUPPORTED_ERR.
 
   mRequest->AbortUpdate(NS_ERROR_DOM_NOT_SUPPORTED_ERR, false);
   mRequest->SetUpdating(false);
 }
 
 void
 MerchantValidationEvent::RejectedCallback(JSContext* aCx,
                                           JS::Handle<JS::Value> aValue)
@@ -179,16 +191,28 @@ MerchantValidationEvent::GetValidationUR
 }
 
 void
 MerchantValidationEvent::SetValidationURL(nsAString& aValidationURL)
 {
   mValidationURL.Assign(aValidationURL);
 }
 
+void
+MerchantValidationEvent::GetMethodName(nsAString& aMethodName)
+{
+  aMethodName.Assign(mMethodName);
+}
+
+void
+MerchantValidationEvent::SetMethodName(const nsAString& aMethodName)
+{
+  mMethodName.Assign(aMethodName);
+}
+
 MerchantValidationEvent::~MerchantValidationEvent() {}
 
 JSObject*
 MerchantValidationEvent::WrapObjectInternal(JSContext* aCx,
                                             JS::Handle<JSObject*> aGivenProto)
 {
   return MerchantValidationEvent_Binding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/payments/MerchantValidationEvent.h
+++ b/dom/payments/MerchantValidationEvent.h
@@ -55,23 +55,28 @@ public:
   void Complete(Promise& aPromise, ErrorResult& aRv);
 
   void SetRequest(PaymentRequest* aRequest);
 
   void GetValidationURL(nsAString& aValidationURL);
 
   void SetValidationURL(nsAString& aValidationURL);
 
+  void GetMethodName(nsAString& aMethodName);
+
+  void SetMethodName(const nsAString& aMethodName);
+
 protected:
   bool init(const MerchantValidationEventInit& aEventInitDict, ErrorResult& aRv);
   ~MerchantValidationEvent();
 
 private:
   // Indicating whether an Complete()-initiated update is currently in progress.
   bool mWaitForUpdate;
   nsString mValidationURL;
   RefPtr<PaymentRequest> mRequest;
+  nsString mMethodName;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_MerchantValidationEvent_h
--- a/dom/webidl/MerchantValidationEvent.webidl
+++ b/dom/webidl/MerchantValidationEvent.webidl
@@ -8,16 +8,18 @@
  *   https://w3c.github.io/payment-request/#merchantvalidationeventinit-dictionary
  */
 
 [Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict),
 SecureContext,
 Exposed=Window,
 Func="mozilla::dom::PaymentRequest::PrefEnabled"]
 interface MerchantValidationEvent : Event {
+  readonly attribute DOMString methodName;
   readonly attribute USVString validationURL;
   [Throws]
   void complete(Promise<any> merchantSessionPromise);
 };
 
 dictionary MerchantValidationEventInit : EventInit {
+  DOMString methodName = "";
   USVString validationURL = "";
 };
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -508,17 +508,17 @@ nsHttpHandler::Init()
     mHandlerActive = true;
 
     rv = InitConnectionMgr();
     if (NS_FAILED(rv)) return rv;
 
     mRequestContextService =
         do_GetService("@mozilla.org/network/request-context-service;1");
 
-#if defined(ANDROID) || defined(MOZ_MULET)
+#if defined(ANDROID)
     mProductSub.AssignLiteral(MOZILLA_UAVERSION);
 #else
     mProductSub.AssignLiteral(LEGACY_BUILD_ID);
 #endif
 
 #if DEBUG
     // dump user agent prefs
     LOG(("> legacy-app-name = %s\n", mLegacyAppName.get()));
@@ -1049,30 +1049,16 @@ nsHttpHandler::InitUserAgentComponents()
         }
     }
 
     if (Preferences::GetBool(UA_PREF("use_device"), false)) {
         mDeviceModelId = mozilla::net::GetDeviceModelId();
     }
 #endif // ANDROID
 
-#ifdef MOZ_MULET
-    {
-        // Add the `Mobile` or `Tablet` or `TV` token when running in the b2g
-        // desktop simulator via preference.
-        nsAutoCString deviceType;
-        nsresult rv = Preferences::GetCString("devtools.useragent.device_type", deviceType);
-        if (NS_SUCCEEDED(rv)) {
-            mCompatDevice.Assign(deviceType);
-        } else {
-            mCompatDevice.AssignLiteral("Mobile");
-        }
-    }
-#endif // MOZ_MULET
-
 #ifndef MOZ_UA_OS_AGNOSTIC
     // Gather OS/CPU.
 #if defined(XP_WIN)
     OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
 #pragma warning(push)
 #pragma warning(disable:4996)
     if (GetVersionEx(&info)) {
 #pragma warning(pop)
--- a/old-configure.in
+++ b/old-configure.in
@@ -2035,23 +2035,18 @@ xulrunner)
   ;;
 esac
 
 # Graphene is a desktop runtime for running applications with a HTML UI.
 if test -n "$MOZ_GRAPHENE"; then
     AC_DEFINE(MOZ_GRAPHENE)
 fi
 
-if test -n "$MOZ_MULET"; then
-    AC_DEFINE(MOZ_MULET)
-fi
-
 AC_SUBST(MOZ_PHOENIX)
 AC_SUBST(MOZ_XULRUNNER)
-AC_SUBST(MOZ_MULET)
 
 dnl ========================================================
 dnl Ensure Android SDK and build-tools versions depending on
 dnl mobile target.
 dnl ========================================================
 
 case "$MOZ_BUILD_APP" in
 mobile/android)
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -47,19 +47,17 @@ def build_dict(config, env=os.environ):
     # Widget toolkit, just pass the value directly through.
     d["toolkit"] = substs.get("MOZ_WIDGET_TOOLKIT")
 
     # Application name
     if 'MOZ_APP_NAME' in substs:
         d["appname"] = substs["MOZ_APP_NAME"]
 
     # Build app name
-    if 'MOZ_MULET' in substs and substs.get('MOZ_MULET') == "1":
-        d["buildapp"] = "mulet"
-    elif 'MOZ_BUILD_APP' in substs:
+    if 'MOZ_BUILD_APP' in substs:
         d["buildapp"] = substs["MOZ_BUILD_APP"]
 
     # processor
     p = substs["TARGET_CPU"]
     # do some slight massaging for some values
     #TODO: retain specific values in case someone wants them?
     if p.startswith("arm"):
         p = "arm"
@@ -95,28 +93,25 @@ def build_dict(config, env=os.environ):
     d['allow_legacy_extensions'] = substs.get('MOZ_ALLOW_LEGACY_EXTENSIONS') == '1'
     d['official'] = bool(substs.get('MOZILLA_OFFICIAL'))
     d['updater'] = substs.get('MOZ_UPDATER') == '1'
     d['artifact'] = substs.get('MOZ_ARTIFACT_BUILDS') == '1'
     d['ccov'] = substs.get('MOZ_CODE_COVERAGE') == '1'
     d['cc_type'] = substs.get('CC_TYPE')
 
     def guess_platform():
-        if d['buildapp'] in ('browser', 'mulet'):
+        if d['buildapp'] == 'browser':
             p = d['os']
             if p == 'mac':
                 p = 'macosx64'
             elif d['bits'] == 64:
                 p = '{}64'.format(p)
             elif p in ('win',):
                 p = '{}32'.format(p)
 
-            if d['buildapp'] == 'mulet':
-                p = '{}-mulet'.format(p)
-
             if d['asan']:
                 p = '{}-asan'.format(p)
 
             return p
 
         if d['buildapp'] == 'mobile/android':
             if d['processor'] == 'x86':
                 return 'android-x86'
--- a/testing/web-platform/tests/css/vendor-imports/mozilla/mozilla-central-reftests/sync-tests.sh
+++ b/testing/web-platform/tests/css/vendor-imports/mozilla/mozilla-central-reftests/sync-tests.sh
@@ -17,12 +17,12 @@ fi
 if [ -e "$MOZTREE/.git" ]
 then
   MOZREV="$(cd "$MOZTREE" && git cinnabar git2hg HEAD)"
 else
   MOZREV="$(cd "$MOZTREE" && hg par --temp='{node}')"
 fi
 
 rsync -avz --delete --filter=". ./sync-tests-filter" "$MOZTREE"/layout/reftests/w3c-css/submitted/ ./
-sed -i -e 's/^\(\(fails\|needs-focus\|random\|skip\|asserts\|slow\|require-or\|silentfail\|pref\|test-pref\|ref-pref\|fuzzy\)[^ ]* *\?\)\+//;/^default-preferences /d;s/ \?# \?\(TC: \)\?[bB]ug.*//;s/ # Initial mulet triage:.*//' $(find . -name reftest.list)
+sed -i -e 's/^\(\(fails\|needs-focus\|random\|skip\|asserts\|slow\|require-or\|silentfail\|pref\|test-pref\|ref-pref\|fuzzy\)[^ ]* *\?\)\+//;/^default-preferences /d;s/ \?# \?\(TC: \)\?[bB]ug.*//' $(find . -name reftest.list)
 sed -i -e 's/-moz-crisp-edges/pixelated/g;s/-moz-min-content/min-content/g;s/-moz-max-content/max-content/g' $(find . -regex ".*\.\(xht\|xhtml\|html\|css\)")
 git add -A .
 git commit -m"Sync Mozilla tests as of https://hg.mozilla.org/mozilla-central/rev/$MOZREV ." -e .
--- a/toolkit/components/viewsource/content/viewSource-content.js
+++ b/toolkit/components/viewsource/content/viewSource-content.js
@@ -255,21 +255,21 @@ var ViewSourceContent = {
       // We were not able to load the source from the network cache.
       this.loadSourceFromURL(viewSrcURL);
       return;
     }
 
     let shEntrySource = pageDescriptor.QueryInterface(Ci.nsISHEntry);
     let shEntry = Cc["@mozilla.org/browser/session-history-entry;1"]
                     .createInstance(Ci.nsISHEntry);
-    shEntry.setURI(Services.io.newURI(viewSrcURL));
+    shEntry.URI = Services.io.newURI(viewSrcURL);
     shEntry.title = viewSrcURL;
     let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
     shEntry.triggeringPrincipal = systemPrincipal;
-    shEntry.setAsHistoryLoad();
+    shEntry.setLoadTypeAsHistory();
     shEntry.cacheKey = shEntrySource.cacheKey;
     docShell.QueryInterface(Ci.nsIWebNavigation)
             .sessionHistory
             .legacySHistory
             .addEntry(shEntry, true);
   },
 
   /**
--- a/toolkit/modules/sessionstore/SessionHistory.jsm
+++ b/toolkit/modules/sessionstore/SessionHistory.jsm
@@ -330,21 +330,21 @@ var SessionHistoryInternal = {
    *        Hash to ensure reuse of BFCache entries
    * @returns nsISHEntry
    */
   deserializeEntry(entry, idMap, docIdentMap) {
 
     var shEntry = Cc["@mozilla.org/browser/session-history-entry;1"].
                   createInstance(Ci.nsISHEntry);
 
-    shEntry.setURI(Services.io.newURI(entry.url));
+    shEntry.URI = Services.io.newURI(entry.url);
     shEntry.title = entry.title || entry.url;
     if (entry.subframe)
-      shEntry.setIsSubFrame(entry.subframe || false);
-    shEntry.setAsHistoryLoad();
+      shEntry.isSubFrame = entry.subframe || false;
+    shEntry.setLoadTypeAsHistory();
     if (entry.contentType)
       shEntry.contentType = entry.contentType;
     if (entry.referrer) {
       shEntry.referrerURI = Services.io.newURI(entry.referrer);
       shEntry.referrerPolicy = entry.referrerPolicy;
     }
     if (entry.originalURI) {
       shEntry.originalURI = Services.io.newURI(entry.originalURI);