[Content Extensions] Make blocked async XHR call onerror
https://bugs.webkit.org/show_bug.cgi?id=146706
Patch by Alex Christensen <achristensen@webkit.org> on 2015-10-14
Reviewed by Brady Eidson.
Source/WebCore:
Test: http/tests/contentextensions/async-xhr-onerror.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::XMLHttpRequest):
(WebCore::XMLHttpRequest::createRequest):
(WebCore::XMLHttpRequest::networkError):
(WebCore::XMLHttpRequest::networkErrorTimerFired):
(WebCore::XMLHttpRequest::abortError):
* xml/XMLHttpRequest.h:
Make a timer that calls networkError in 0 time if a content blocker blocks the asynchronous load.
It is necessary to call setPendingActivity and dropProtection (which calls unsetPendingActivity)
to keep a reference to the XMLHttpRequest alive.
LayoutTests:
* http/tests/contentextensions/async-xhr-onerror-expected.txt: Added.
* http/tests/contentextensions/async-xhr-onerror.html: Added.
* http/tests/contentextensions/async-xhr-onerror.html.json: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@191077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed