Stop using PolicyCallback for new window policies
https://bugs.webkit.org/show_bug.cgi?id=175907
Patch by Alex Christensen <achristensen@webkit.org> on 2017-08-24
Reviewed by Andy Estes.
PolicyCallback is an artifact from the days before C++11. Let's use lambdas instead!
No change in behaviour.
* loader/PolicyCallback.cpp:
(WebCore::PolicyCallback::set):
(WebCore::PolicyCallback::call):
(WebCore::PolicyCallback::cancel):
* loader/PolicyCallback.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNewWindowPolicy):
(WebCore::PolicyChecker::continueAfterNewWindowPolicy): Deleted.
* loader/PolicyChecker.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@221162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/PolicyChecker.h b/Source/WebCore/loader/PolicyChecker.h
index 20afc03..31dced5 100644
--- a/Source/WebCore/loader/PolicyChecker.h
+++ b/Source/WebCore/loader/PolicyChecker.h
@@ -47,6 +47,8 @@
class ResourceError;
class ResourceResponse;
+using NewWindowPolicyDecisionFunction = WTF::Function<void(const ResourceRequest&, FormState*, const String& frameName, const NavigationAction&, bool shouldContinue)>;
+
class PolicyChecker {
WTF_MAKE_NONCOPYABLE(PolicyChecker);
WTF_MAKE_FAST_ALLOCATED;
@@ -55,7 +57,7 @@
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 checkNewWindowPolicy(NavigationAction&&, const ResourceRequest&, FormState*, const String& frameName, NewWindowPolicyDecisionFunction);
// FIXME: These are different. They could use better names.
void cancelCheck();
@@ -84,7 +86,6 @@
private:
void continueAfterNavigationPolicy(PolicyAction);
- void continueAfterNewWindowPolicy(PolicyAction);
void handleUnimplementablePolicy(const ResourceError&);