From 4b275af5c2f35c29fe104245e26270ab017f6e42 Mon Sep 17 00:00:00 2001 From: Brian Nicholson Date: Thu, 21 Jun 2012 10:31:07 -0700 Subject: [PATCH] Bug 766757 - Add LOAD_REPLACE_BYPASS_CACHE load type. r=bz --- accessible/src/base/Logging.cpp | 2 ++ docshell/base/nsDocShell.cpp | 9 +++++++++ docshell/base/nsDocShellLoadTypes.h | 2 ++ docshell/base/nsIDocShellLoadInfo.idl | 1 + 4 files changed, 14 insertions(+) diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index b2535d1f9b4..a3d42518e30 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -280,6 +280,8 @@ LogShellLoadType(nsIDocShell* aDocShell) case LOAD_PUSHSTATE: printf("load pushstate; "); break; + case LOAD_REPLACE_BYPASS_CACHE: + printf("replace bypass cache; "); case LOAD_ERROR_PAGE: printf("error page;"); break; diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 91649a2d126..4d318a9e4d2 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -648,6 +648,7 @@ ConvertLoadTypeToNavigationType(PRUint32 aLoadType) case LOAD_NORMAL_REPLACE: case LOAD_LINK: case LOAD_STOP_CONTENT: + case LOAD_REPLACE_BYPASS_CACHE: result = nsIDOMPerformanceNavigation::TYPE_NAVIGATE; break; case LOAD_HISTORY: @@ -1141,6 +1142,9 @@ ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType) case nsIDocShellLoadInfo::loadPushState: loadType = LOAD_PUSHSTATE; break; + case nsIDocShellLoadInfo::loadReplaceBypassCache: + loadType = LOAD_REPLACE_BYPASS_CACHE; + break; default: NS_NOTREACHED("Unexpected nsDocShellInfoLoadType value"); } @@ -1209,6 +1213,9 @@ nsDocShell::ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType) case LOAD_PUSHSTATE: docShellLoadType = nsIDocShellLoadInfo::loadPushState; break; + case LOAD_REPLACE_BYPASS_CACHE: + docShellLoadType = nsIDocShellLoadInfo::loadReplaceBypassCache; + break; default: NS_NOTREACHED("Unexpected load type value"); } @@ -5923,6 +5930,7 @@ nsDocShell::Embed(nsIContentViewer * aContentViewer, 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: @@ -9226,6 +9234,7 @@ nsresult nsDocShell::DoChannelLoad(nsIChannel * aChannel, 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; diff --git a/docshell/base/nsDocShellLoadTypes.h b/docshell/base/nsDocShellLoadTypes.h index 5915d1a2d7b..6f3098e9db7 100644 --- a/docshell/base/nsDocShellLoadTypes.h +++ b/docshell/base/nsDocShellLoadTypes.h @@ -60,6 +60,7 @@ enum LoadType { 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 @@ -91,6 +92,7 @@ static inline bool IsValidLoadType(PRUint32 aLoadType) case LOAD_STOP_CONTENT: case LOAD_STOP_CONTENT_AND_REPLACE: case LOAD_PUSHSTATE: + case LOAD_REPLACE_BYPASS_CACHE: case LOAD_ERROR_PAGE: return true; } diff --git a/docshell/base/nsIDocShellLoadInfo.idl b/docshell/base/nsIDocShellLoadInfo.idl index 33f3faa1ce2..3ea0a8b455c 100644 --- a/docshell/base/nsIDocShellLoadInfo.idl +++ b/docshell/base/nsIDocShellLoadInfo.idl @@ -60,6 +60,7 @@ interface nsIDocShellLoadInfo : nsISupports 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;