Bug 664125 Offline error pages should appear for non-cacheable channels too r=bz
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 16 Jun 2011 21:26:22 +0100
changeset 71707 8cbd3bbce29ef35a15fe9ef2d91651cec4dd6124
parent 71706 48774bdf7e418c36dd65a7ed9549b28a1ccd1346
child 71708 995f2c3e7a7860ff3024a3c8e51490639a959f97
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs664125
milestone7.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 664125 Offline error pages should appear for non-cacheable channels too r=bz
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -3908,16 +3908,18 @@ nsDocShell::DisplayLoadError(nsresult aE
         case NS_ERROR_NET_RESET:
             // Doc failed to load because the server kept reseting the connection
             // before we could read any data from it
             error.AssignLiteral("netReset");
             break;
         case NS_ERROR_DOCUMENT_NOT_CACHED:
             // Doc failed to load because we are offline and the cache does not
             // contain a copy of the document.
+        case NS_ERROR_OFFLINE:
+            // Doc failed to load because we are offline
             error.AssignLiteral("netOffline");
             break;
         case NS_ERROR_DOCUMENT_IS_PRINTMODE:
             // Doc navigation attempted while Printing or Print Preview
             error.AssignLiteral("isprinting");
             break;
         case NS_ERROR_PORT_ACCESS_NOT_ALLOWED:
             // Port blocked for security reasons
@@ -6273,16 +6275,17 @@ nsDocShell::EndPageLoad(nsIWebProgress *
             DisplayLoadError(aStatus, url, nsnull, aChannel);
         }
         // Errors to be shown for any frame
         else if (aStatus == NS_ERROR_NET_TIMEOUT ||
                  aStatus == NS_ERROR_REDIRECT_LOOP ||
                  aStatus == NS_ERROR_UNKNOWN_SOCKET_TYPE ||
                  aStatus == NS_ERROR_NET_INTERRUPT ||
                  aStatus == NS_ERROR_NET_RESET ||
+                 aStatus == NS_ERROR_OFFLINE ||
                  aStatus == NS_ERROR_MALWARE_URI ||
                  aStatus == NS_ERROR_PHISHING_URI ||
                  aStatus == NS_ERROR_UNSAFE_CONTENT_TYPE ||
                  aStatus == NS_ERROR_REMOTE_XUL ||
                  NS_ERROR_GET_MODULE(aStatus) == NS_ERROR_MODULE_SECURITY) {
             DisplayLoadError(aStatus, url, nsnull, aChannel);
         }
         else if (aStatus == NS_ERROR_DOCUMENT_NOT_CACHED) {