Bug 580819 - Don't try to "replace" the transient about:blank content viewer when loading about:blank immediately after it. r=smaug
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 21 Jul 2010 16:26:27 -0700
changeset 48154 6995adf228ed20bffb72ba138be345fe2eb6449a
parent 48153 8ec5010204bc308a2931cf9c16533577c16e49b0
child 48155 7ca4b43c32104b275037f713e212808508ee7ad1
push id14596
push usermrbkap@mozilla.com
push dateFri, 23 Jul 2010 22:44:56 +0000
treeherdermozilla-central@6995adf228ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs580819
milestone2.0b3pre
first release with
nightly win64
6995adf228ed / 4.0b3pre / 20100723164001 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 580819 - Don't try to "replace" the transient about:blank content viewer when loading about:blank immediately after it. r=smaug
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8992,31 +8992,41 @@ nsDocShell::OnNewURI(nsIURI * aURI, nsIC
     // Check if the url to be loaded is the same as the one already loaded.
     if (mCurrentURI)
         aURI->Equals(mCurrentURI, &equalUri);
 
 #ifdef DEBUG
     PR_LOG(gDocShellLog, PR_LOG_DEBUG,
            ("  shAvailable=%i updateHistory=%i equalURI=%i\n",
             shAvailable, updateHistory, equalUri));
+
+    if (mCurrentURI && !mOSHE && aLoadType != LOAD_ERROR_PAGE) {
+        NS_ASSERTION(IsAboutBlank(mCurrentURI), "no SHEntry for a non-transient viewer?");
+    }
 #endif
 
     /* If the url to be loaded is the same as the one already there,
      * and the original loadType is LOAD_NORMAL, LOAD_LINK, or
      * LOAD_STOP_CONTENT, set loadType to LOAD_NORMAL_REPLACE so that
      * AddToSessionHistory() won't mess with the current SHEntry and
      * if this page has any frame children, it also will be handled
      * properly. see bug 83684
      *
+     * NB: If mOSHE is null but we have a current URI, then it means
+     * that we must be at the transient about:blank content viewer
+     * (asserted above) and we should let the normal load continue,
+     * since there's nothing to replace.
+     *
      * XXX Hopefully changing the loadType at this time will not hurt  
      *  anywhere. The other way to take care of sequentially repeating
      *  frameset pages is to add new methods to nsIDocShellTreeItem.
      * Hopefully I don't have to do that. 
      */
     if (equalUri &&
+        mOSHE &&
         (mLoadType == LOAD_NORMAL ||
          mLoadType == LOAD_LINK ||
          mLoadType == LOAD_STOP_CONTENT) &&
         !inputStream)
     {
         mLoadType = LOAD_NORMAL_REPLACE;
     }