Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
NetworkLoadChecker should cancel its content extension retrieval task…
… when being destroyed https://bugs.webkit.org/show_bug.cgi?id=185661 <rdar://problem/39985509> Reviewed by Chris Dumez. Source/WebKit: Make sure that the Content Extension retrieval callback checks that NetworkLoadChecker is alive. This allows stopping NetworkLoadChecker be ref counted. This in turns allows NetworkResourceLoader to delete its NetworkLoadChecker when being deleted as well. By doing so, we simplify the memory management of NetworkResourceLoader and NetworkLoadChecker. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRequest): (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad): * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::weakPtrFactory): * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): * NetworkProcess/PingLoad.h: LayoutTests: * http/tests/contentextensions/crash-xhr-expected.txt: Added. * http/tests/contentextensions/crash-xhr.html: Added. * http/tests/contentextensions/crash-xhr.html.json: Added. Canonical link: https://commits.webkit.org/201253@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
11 changed files
with
114 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Test that aborting the XHR while gathering content blockers will not crash the Network Process | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script> | ||
// We do the xhr load first so that this load will trigger the gathering by NetworkProcess of content blockers. | ||
const promise = new Promise(resolve => { | ||
var xhr = new XMLHttpRequest; | ||
xhr.onloadend = resolve; | ||
xhr.open("GET", ".", true); | ||
xhr.send(); | ||
xhr.abort(); | ||
}); | ||
</script> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
promise_test((test) => { | ||
return promise; | ||
}, "Test that aborting the XHR while gathering content blockers will not crash the Network Process"); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"action": { | ||
"type": "block" | ||
}, | ||
"trigger": { | ||
"url-filter": ".*localhost" | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"type": "ignore-previous-rules" | ||
}, | ||
"trigger": { | ||
"url-filter": ".*whitelist" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters