Skip to content

Commit

Permalink
Merge r221228 - Remove PolicyChecker::cancelCheck
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=176002

Patch by Alex Christensen <achristensen@webkit.org> on 2017-08-26
Reviewed by Darin Adler.

cancelCheck is conceptually equivalent to not calling a completion handler.
stopCheck is conceptually equivalent to calling a completion handler with PolicyIgnore just before cleaning up everything,
which is semantically cleaner and necessary when I replace the last use of PolicyCallback with a CompletionHandler.
Before this change, we were probably causing some loading objects to hang right before deleting them, and this cleans them up better.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::cancelPolicyCheckIfNeeded):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::cancelCheck): Deleted.
* loader/PolicyChecker.h:
  • Loading branch information
Alex Christensen authored and carlosgcampos committed Aug 30, 2017
1 parent 71bb8c3 commit 8d7b252
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2017-08-26 Alex Christensen <achristensen@webkit.org>

Remove PolicyChecker::cancelCheck
https://bugs.webkit.org/show_bug.cgi?id=176002

Reviewed by Darin Adler.

cancelCheck is conceptually equivalent to not calling a completion handler.
stopCheck is conceptually equivalent to calling a completion handler with PolicyIgnore just before cleaning up everything,
which is semantically cleaner and necessary when I replace the last use of PolicyCallback with a CompletionHandler.
Before this change, we were probably causing some loading objects to hang right before deleting them, and this cleans them up better.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::cancelPolicyCheckIfNeeded):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::cancelCheck): Deleted.
* loader/PolicyChecker.h:

2017-08-25 Daniel Bates <dabates@apple.com>

InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/DocumentLoader.cpp
Expand Up @@ -1538,7 +1538,7 @@ void DocumentLoader::cancelPolicyCheckIfNeeded()
RELEASE_ASSERT(frameLoader());

if (m_waitingForContentPolicy || m_waitingForNavigationPolicy) {
frameLoader()->policyChecker().cancelCheck();
frameLoader()->policyChecker().stopCheck();
m_waitingForContentPolicy = false;
m_waitingForNavigationPolicy = false;
}
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/loader/PolicyChecker.cpp
Expand Up @@ -177,12 +177,6 @@ void PolicyChecker::checkNewWindowPolicy(NavigationAction&& navigationAction, co
});
}

void PolicyChecker::cancelCheck()
{
m_frame.loader().client().cancelPolicyCheck();
m_callback = { };
}

void PolicyChecker::stopCheck()
{
m_frame.loader().client().cancelPolicyCheck();
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/loader/PolicyChecker.h
Expand Up @@ -59,8 +59,6 @@ class PolicyChecker {
void checkNavigationPolicy(const ResourceRequest&, bool didReceiveRedirectResponse, NavigationPolicyDecisionFunction);
void checkNewWindowPolicy(NavigationAction&&, const ResourceRequest&, FormState*, const String& frameName, NewWindowPolicyDecisionFunction);

// FIXME: These are different. They could use better names.
void cancelCheck();
void stopCheck();

void cannotShowMIMEType(const ResourceResponse&);
Expand Down

0 comments on commit 8d7b252

Please sign in to comment.