Bug 351777: domain fixup/guessing broken, r=biesi, sr=bzbarsky
This commit is contained in:
Родитель
6685f769b8
Коммит
e2c023be13
|
@ -537,9 +537,6 @@ ConvertDocShellLoadInfoToLoadType(nsDocShellInfoLoadType aDocShellLoadType)
|
||||||
case nsIDocShellLoadInfo::loadNormalExternal:
|
case nsIDocShellLoadInfo::loadNormalExternal:
|
||||||
loadType = LOAD_NORMAL_EXTERNAL;
|
loadType = LOAD_NORMAL_EXTERNAL;
|
||||||
break;
|
break;
|
||||||
case nsIDocShellLoadInfo::loadNormalAllowFixup:
|
|
||||||
loadType = LOAD_NORMAL_FIXUP;
|
|
||||||
break;
|
|
||||||
case nsIDocShellLoadInfo::loadHistory:
|
case nsIDocShellLoadInfo::loadHistory:
|
||||||
loadType = LOAD_HISTORY;
|
loadType = LOAD_HISTORY;
|
||||||
break;
|
break;
|
||||||
|
@ -604,9 +601,6 @@ nsDocShell::ConvertLoadTypeToDocShellLoadInfo(PRUint32 aLoadType)
|
||||||
case LOAD_NORMAL_EXTERNAL:
|
case LOAD_NORMAL_EXTERNAL:
|
||||||
docShellLoadType = nsIDocShellLoadInfo::loadNormalExternal;
|
docShellLoadType = nsIDocShellLoadInfo::loadNormalExternal;
|
||||||
break;
|
break;
|
||||||
case LOAD_NORMAL_FIXUP:
|
|
||||||
docShellLoadType = nsIDocShellLoadInfo::loadNormalAllowFixup;
|
|
||||||
break;
|
|
||||||
case LOAD_NORMAL_BYPASS_CACHE:
|
case LOAD_NORMAL_BYPASS_CACHE:
|
||||||
docShellLoadType = nsIDocShellLoadInfo::loadNormalBypassCache;
|
docShellLoadType = nsIDocShellLoadInfo::loadNormalBypassCache;
|
||||||
break;
|
break;
|
||||||
|
@ -2887,7 +2881,7 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
|
||||||
|
|
||||||
rv = NS_NewURI(getter_AddRefs(uri), uriString);
|
rv = NS_NewURI(getter_AddRefs(uri), uriString);
|
||||||
if (uri) {
|
if (uri) {
|
||||||
aLoadFlags = aLoadFlags & ~LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
aLoadFlags &= ~LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sURIFixup) {
|
if (sURIFixup) {
|
||||||
|
@ -2912,6 +2906,13 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
|
||||||
if (NS_FAILED(rv) || !uri)
|
if (NS_FAILED(rv) || !uri)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
// Don't pass the fixup flag to MAKE_LOAD_TYPE, since it isn't needed and
|
||||||
|
// confuses ConvertLoadTypeToDocShellLoadInfo. We do need to ensure that
|
||||||
|
// it is passed to LoadURI though, since it uses it to determine whether it
|
||||||
|
// can do fixup.
|
||||||
|
PRUint32 fixupFlag = (aLoadFlags & LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
|
||||||
|
aLoadFlags &= ~LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||||
|
|
||||||
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
||||||
rv = CreateLoadInfo(getter_AddRefs(loadInfo));
|
rv = CreateLoadInfo(getter_AddRefs(loadInfo));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
@ -2922,8 +2923,7 @@ nsDocShell::LoadURI(const PRUnichar * aURI,
|
||||||
loadInfo->SetReferrer(aReferringURI);
|
loadInfo->SetReferrer(aReferringURI);
|
||||||
loadInfo->SetHeadersStream(aHeaderStream);
|
loadInfo->SetHeadersStream(aHeaderStream);
|
||||||
|
|
||||||
rv = LoadURI(uri, loadInfo,
|
rv = LoadURI(uri, loadInfo, fixupFlag, PR_TRUE);
|
||||||
aLoadFlags & LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP, PR_TRUE);
|
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,6 @@ enum LoadType {
|
||||||
LOAD_NORMAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_NONE),
|
LOAD_NORMAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_NONE),
|
||||||
LOAD_NORMAL_REPLACE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY),
|
LOAD_NORMAL_REPLACE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_REPLACE_HISTORY),
|
||||||
LOAD_NORMAL_EXTERNAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_FROM_EXTERNAL),
|
LOAD_NORMAL_EXTERNAL = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_FROM_EXTERNAL),
|
||||||
LOAD_NORMAL_FIXUP = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP),
|
|
||||||
LOAD_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_HISTORY, nsIWebNavigation::LOAD_FLAGS_NONE),
|
LOAD_HISTORY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_HISTORY, nsIWebNavigation::LOAD_FLAGS_NONE),
|
||||||
LOAD_NORMAL_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
|
LOAD_NORMAL_BYPASS_CACHE = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE),
|
||||||
LOAD_NORMAL_BYPASS_PROXY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
|
LOAD_NORMAL_BYPASS_PROXY = MAKE_LOAD_TYPE(nsIDocShell::LOAD_CMD_NORMAL, nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY),
|
||||||
|
@ -96,7 +95,6 @@ static inline PRBool IsValidLoadType(PRUint32 aLoadType)
|
||||||
case LOAD_NORMAL:
|
case LOAD_NORMAL:
|
||||||
case LOAD_NORMAL_REPLACE:
|
case LOAD_NORMAL_REPLACE:
|
||||||
case LOAD_NORMAL_EXTERNAL:
|
case LOAD_NORMAL_EXTERNAL:
|
||||||
case LOAD_NORMAL_FIXUP:
|
|
||||||
case LOAD_NORMAL_BYPASS_CACHE:
|
case LOAD_NORMAL_BYPASS_CACHE:
|
||||||
case LOAD_NORMAL_BYPASS_PROXY:
|
case LOAD_NORMAL_BYPASS_PROXY:
|
||||||
case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
|
case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE:
|
||||||
|
|
|
@ -85,7 +85,6 @@ interface nsIDocShellLoadInfo : nsISupports
|
||||||
const long loadNormalBypassCache = 14;
|
const long loadNormalBypassCache = 14;
|
||||||
const long loadNormalBypassProxy = 15;
|
const long loadNormalBypassProxy = 15;
|
||||||
const long loadNormalBypassProxyAndCache = 16;
|
const long loadNormalBypassProxyAndCache = 16;
|
||||||
const long loadNormalAllowFixup = 17;
|
|
||||||
|
|
||||||
/** Contains a load type as specified by the load* constants */
|
/** Contains a load type as specified by the load* constants */
|
||||||
attribute nsDocShellInfoLoadType loadType;
|
attribute nsDocShellInfoLoadType loadType;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче