summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/PolicyChecker.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/PolicyChecker.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/loader/PolicyChecker.h')
-rw-r--r--Source/WebCore/loader/PolicyChecker.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/Source/WebCore/loader/PolicyChecker.h b/Source/WebCore/loader/PolicyChecker.h
index b1772e62e..16b0bed82 100644
--- a/Source/WebCore/loader/PolicyChecker.h
+++ b/Source/WebCore/loader/PolicyChecker.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
* Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -27,15 +27,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PolicyChecker_h
-#define PolicyChecker_h
+#pragma once
#include "FrameLoaderTypes.h"
#include "PolicyCallback.h"
#include "ResourceRequest.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
+#if ENABLE(CONTENT_FILTERING)
+#include "ContentFilterUnblockHandler.h"
+#endif
+
namespace WebCore {
class DocumentLoader;
@@ -47,12 +49,13 @@ class ResourceResponse;
class PolicyChecker {
WTF_MAKE_NONCOPYABLE(PolicyChecker);
+ WTF_MAKE_FAST_ALLOCATED;
public:
explicit PolicyChecker(Frame&);
- void checkNavigationPolicy(const ResourceRequest&, DocumentLoader*, PassRefPtr<FormState>, NavigationPolicyDecisionFunction);
- void checkNavigationPolicy(const ResourceRequest&, NavigationPolicyDecisionFunction);
- void checkNewWindowPolicy(const NavigationAction&, const ResourceRequest&, PassRefPtr<FormState>, const String& frameName, NewWindowPolicyDecisionFunction);
+ void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, DocumentLoader*, FormState*, NavigationPolicyDecisionFunction);
+ void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, NavigationPolicyDecisionFunction);
+ void checkNewWindowPolicy(const NavigationAction&, const ResourceRequest&, FormState*, const String& frameName, NewWindowPolicyDecisionFunction);
void checkContentPolicy(const ResourceResponse&, ContentPolicyDecisionFunction);
// FIXME: These are different. They could use better names.
@@ -64,6 +67,8 @@ public:
FrameLoadType loadType() const { return m_loadType; }
void setLoadType(FrameLoadType loadType) { m_loadType = loadType; }
+ void setSuggestedFilename(const String& suggestedFilename) { m_suggestedFilename = suggestedFilename; }
+
bool delegateIsDecidingNavigationPolicy() const { return m_delegateIsDecidingNavigationPolicy; }
bool delegateIsHandlingUnimplementablePolicy() const { return m_delegateIsHandlingUnimplementablePolicy; }
@@ -74,6 +79,10 @@ public:
// the heart to hack on all the platforms to make that happen right now.
void continueLoadAfterWillSubmitForm(PolicyAction);
+#if ENABLE(CONTENT_FILTERING)
+ void setContentFilterUnblockHandler(ContentFilterUnblockHandler unblockHandler) { m_contentFilterUnblockHandler = WTFMove(unblockHandler); }
+#endif
+
private:
void continueAfterNavigationPolicy(PolicyAction);
void continueAfterNewWindowPolicy(PolicyAction);
@@ -91,8 +100,11 @@ private:
// on navigation action delegate callbacks.
FrameLoadType m_loadType;
PolicyCallback m_callback;
+ String m_suggestedFilename;
+
+#if ENABLE(CONTENT_FILTERING)
+ ContentFilterUnblockHandler m_contentFilterUnblockHandler;
+#endif
};
} // namespace WebCore
-
-#endif // PolicyChecker_h