summaryrefslogtreecommitdiffstats
path: root/docshell/base
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-22 22:17:18 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-22 22:17:18 +0200
commit30621a6307171f009948001b3730c5b61b894048 (patch)
tree7d6b34d98372e37efc57e40c827572779eb64ba2 /docshell/base
parent115cf1e322bdabaee001781e1d5a8ee4928992af (diff)
downloadUXP-30621a6307171f009948001b3730c5b61b894048.tar
UXP-30621a6307171f009948001b3730c5b61b894048.tar.gz
UXP-30621a6307171f009948001b3730c5b61b894048.tar.lz
UXP-30621a6307171f009948001b3730c5b61b894048.tar.xz
UXP-30621a6307171f009948001b3730c5b61b894048.zip
Revert "Bug 1182569: Use AsyncOpen2 for docshell loads"
This reverts commit 29bd11c3cd6ff41f7167530f9bbcd9d195b7c427.
Diffstat (limited to 'docshell/base')
-rw-r--r--docshell/base/nsDocShell.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 6810d0179..b1fcc5c23 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -69,6 +69,7 @@
#include "nsIScriptSecurityManager.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScrollableFrame.h"
+#include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
#include "nsISeekableStream.h"
#include "nsAutoPtr.h"
#include "nsQueryObject.h"
@@ -1643,7 +1644,7 @@ nsDocShell::LoadStream(nsIInputStream* aStream, nsIURI* aURI,
uri,
aStream,
triggeringPrincipal,
- nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
+ nsILoadInfo::SEC_NORMAL,
nsIContentPolicy::TYPE_OTHER,
aContentType,
aContentCharset);
@@ -9942,6 +9943,23 @@ nsDocShell::InternalLoad(nsIURI* aURI,
rv = extraStr->SetData(msg);
NS_ENSURE_SUCCESS(rv, rv);
+ int16_t shouldLoad = nsIContentPolicy::ACCEPT;
+ rv = NS_CheckContentLoadPolicy(contentType,
+ aURI,
+ aTriggeringPrincipal,
+ requestingContext,
+ EmptyCString(), // mime guess
+ extraStr, // extra
+ &shouldLoad);
+
+ if (NS_FAILED(rv) || NS_CP_REJECTED(shouldLoad)) {
+ if (NS_SUCCEEDED(rv) && shouldLoad == nsIContentPolicy::REJECT_TYPE) {
+ return NS_ERROR_CONTENT_BLOCKED_SHOW_ALT;
+ }
+
+ return NS_ERROR_CONTENT_BLOCKED;
+ }
+
// If HSTS priming was set by nsMixedContentBlocker::ShouldLoad, and we
// would block due to mixed content, go ahead and block here. If we try to
// proceed with priming, we will error out later on.
@@ -10931,8 +10949,7 @@ nsDocShell::DoURILoad(nsIURI* aURI,
}
nsLoadFlags loadFlags = mDefaultLoadFlags;
- nsSecurityFlags securityFlags =
- nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL;
+ nsSecurityFlags securityFlags = nsILoadInfo::SEC_NORMAL;
if (aFirstParty) {
// tag first party URL loads