Bug 766757 - Add LOAD_REPLACE_BYPASS_CACHE load type. r=bz
authorBrian Nicholson <bnicholson@mozilla.com>
Thu, 21 Jun 2012 10:31:07 -0700
changeset 97297 48e15675e2908ae8127f441e3ea625e3c0e12eb5
parent 97296 13a8fa3afd28f98d71aa3737d8ecd9a1facd589f
child 97298 4913b412caaa7f076cb17e3dd8a514b3328936f5
push id10969
push userbnicholson@mozilla.com
push dateThu, 21 Jun 2012 17:31:27 +0000
treeherdermozilla-inbound@48e15675e290 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs766757
milestone16.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 766757 - Add LOAD_REPLACE_BYPASS_CACHE load type. r=bz
accessible/src/base/Logging.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShellLoadTypes.h
docshell/base/nsIDocShellLoadInfo.idl
--- a/accessible/src/base/Logging.cpp
+++ b/accessible/src/base/Logging.cpp
@@ -275,16 +275,18 @@ LogShellLoadType(nsIDocShell* aDocShell)
       printf("stop content; ");
       break;
     case LOAD_STOP_CONTENT_AND_REPLACE:
       printf("stop content and replace; ");
       break;
     case LOAD_PUSHSTATE:
       printf("load pushstate; ");
       break;
+    case LOAD_REPLACE_BYPASS_CACHE:
+      printf("replace bypass cache; ");
     case LOAD_ERROR_PAGE:
       printf("error page;");
       break;
     default:
       printf("unknown");
   }
 }
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -643,16 +643,17 @@ ConvertLoadTypeToNavigationType(PRUint32
     case LOAD_NORMAL:
     case LOAD_NORMAL_EXTERNAL:
     case LOAD_NORMAL_BYPASS_CACHE:
     case LOAD_NORMAL_BYPASS_PROXY:
     case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
     case LOAD_NORMAL_REPLACE:
     case LOAD_LINK:
     case LOAD_STOP_CONTENT:
+    case LOAD_REPLACE_BYPASS_CACHE:
         result = nsIDOMPerformanceNavigation::TYPE_NAVIGATE;
         break;
     case LOAD_HISTORY:
         result = nsIDOMPerformanceNavigation::TYPE_BACK_FORWARD;
         break;
     case LOAD_RELOAD_NORMAL:
     case LOAD_RELOAD_CHARSET_CHANGE:
     case LOAD_RELOAD_BYPASS_CACHE:
@@ -1136,16 +1137,19 @@ ConvertDocShellLoadInfoToLoadType(nsDocS
         loadType = LOAD_STOP_CONTENT;
         break;
     case nsIDocShellLoadInfo::loadStopContentAndReplace:
         loadType = LOAD_STOP_CONTENT_AND_REPLACE;
         break;
     case nsIDocShellLoadInfo::loadPushState:
         loadType = LOAD_PUSHSTATE;
         break;
+    case nsIDocShellLoadInfo::loadReplaceBypassCache:
+        loadType = LOAD_REPLACE_BYPASS_CACHE;
+        break;
     default:
         NS_NOTREACHED("Unexpected nsDocShellInfoLoadType value");
     }
 
     return loadType;
 }
 
 
@@ -1204,16 +1208,19 @@ nsDocShell::ConvertLoadTypeToDocShellLoa
         docShellLoadType = nsIDocShellLoadInfo::loadStopContent;
         break;
     case LOAD_STOP_CONTENT_AND_REPLACE:
         docShellLoadType = nsIDocShellLoadInfo::loadStopContentAndReplace;
         break;
     case LOAD_PUSHSTATE:
         docShellLoadType = nsIDocShellLoadInfo::loadPushState;
         break;
+    case LOAD_REPLACE_BYPASS_CACHE:
+        docShellLoadType = nsIDocShellLoadInfo::loadReplaceBypassCache;
+        break;
     default:
         NS_NOTREACHED("Unexpected load type value");
     }
 
     return docShellLoadType;
 }                                                                               
 
 //*****************************************************************************
@@ -5918,16 +5925,17 @@ nsDocShell::Embed(nsIContentViewer * aCo
 
     // Determine if this type of load should update history
     switch (mLoadType) {
     case LOAD_NORMAL_REPLACE:
     case LOAD_STOP_CONTENT_AND_REPLACE:
     case LOAD_RELOAD_BYPASS_CACHE:
     case LOAD_RELOAD_BYPASS_PROXY:
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
+    case LOAD_REPLACE_BYPASS_CACHE:
         updateHistory = false;
         break;
     default:
         break;
     }
 
     if (!updateHistory)
         SetLayoutHistoryState(nsnull);
@@ -9221,16 +9229,17 @@ nsresult nsDocShell::DoChannelLoad(nsICh
         break;
 
     case LOAD_NORMAL_BYPASS_CACHE:
     case LOAD_NORMAL_BYPASS_PROXY:
     case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
     case LOAD_RELOAD_BYPASS_CACHE:
     case LOAD_RELOAD_BYPASS_PROXY:
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
+    case LOAD_REPLACE_BYPASS_CACHE:
         loadFlags |= nsIRequest::LOAD_BYPASS_CACHE |
                      nsIRequest::LOAD_FRESH_CONNECTION;
         break;
 
     case LOAD_NORMAL:
     case LOAD_LINK:
         // Set cache checking flags
         switch (Preferences::GetInt("browser.cache.check_doc_frequency", -1)) {
--- a/docshell/base/nsDocShellLoadTypes.h
+++ b/docshell/base/nsDocShellLoadTypes.h
@@ -55,16 +55,17 @@ enum LoadType {
     LOAD_RELOAD_BYPASS_PROXY_AND_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE | nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
     LOAD_LINK = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_LINK),
     LOAD_REFRESH = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_IS_REFRESH),
     LOAD_RELOAD_CHARSET_CHANGE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_RELOAD, nsIWebNavigation::LOAD_FLAGS_CHARSET_CHANGE),
     LOAD_BYPASS_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_HISTORY),
     LOAD_STOP_CONTENT = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_STOP_CONTENT),
     LOAD_STOP_CONTENT_AND_REPLACE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_STOP_CONTENT | nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY),
     LOAD_PUSHSTATE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_PUSHSTATE, nsIWebNavigation::LOAD_FLAGS_NONE),
+    LOAD_REPLACE_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY | nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
     /**
      * Load type for an error page. These loads are never triggered by users of
      * Docshell. Instead, Docshell triggers the load itself when a
      * consumer-triggered load failed.
      */
     LOAD_ERROR_PAGE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, LOAD_FLAGS_ERROR_PAGE)
 
     // NOTE: Adding a new value? Remember to update IsValidLoadType!
@@ -86,16 +87,17 @@ static inline bool IsValidLoadType(PRUin
     case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE:
     case LOAD_LINK:
     case LOAD_REFRESH:
     case LOAD_RELOAD_CHARSET_CHANGE:
     case LOAD_BYPASS_HISTORY:
     case LOAD_STOP_CONTENT:
     case LOAD_STOP_CONTENT_AND_REPLACE:
     case LOAD_PUSHSTATE:
+    case LOAD_REPLACE_BYPASS_CACHE:
     case LOAD_ERROR_PAGE:
         return true;
     }
     return false;
 }
 
 #endif // MOZILLA_INTERNAL_API
 #endif 
--- a/docshell/base/nsIDocShellLoadInfo.idl
+++ b/docshell/base/nsIDocShellLoadInfo.idl
@@ -55,16 +55,17 @@ interface nsIDocShellLoadInfo : nsISuppo
     const long loadBypassHistory = 10;
     const long loadStopContent = 11;
     const long loadStopContentAndReplace = 12;
     const long loadNormalExternal = 13;
     const long loadNormalBypassCache = 14;
     const long loadNormalBypassProxy = 15;
     const long loadNormalBypassProxyAndCache = 16;
     const long loadPushState = 17;                 // history.pushState or replaceState
+    const long loadReplaceBypassCache = 18;
 
     /** Contains a load type as specified by the load* constants */
     attribute nsDocShellInfoLoadType loadType;
 
     /** SHEntry for this page */
     attribute nsISHEntry SHEntry;
 
     /** Target for load, like _content, _blank etc. */