Source/WebCore: Don't re-enter CachedResource::removeClient() if an XHR
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 18:42:51 +0000 (18:42 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Jun 2012 18:42:51 +0000 (18:42 +0000)
commit303b8ec04584de66de8d361251d1df1f0fd66115
tree981267a5d4387598603eb38399a3700ad455a37b
parentadfe0f33f8b065fbbc9eca92c12a253293fa3045
Source/WebCore: Don't re-enter CachedResource::removeClient() if an XHR
is canceled and restarted multiple times.
https://bugs.webkit.org/show_bug.cgi?id=89378

Reviewed by Eric Seidel.

Test: http/tests/xmlhttprequest/reentrant-cancel.html

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::cancel):
(WebCore::DocumentThreadableLoader::clearResource): Save off a copy of m_resource
   then clear it, so we don't call clearResource() multiple times for the same resource.

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=89378.
Reviewed by Eric Seidel.

* http/tests/xmlhttprequest/reentrant-cancel-expected.txt: Added.
* http/tests/xmlhttprequest/reentrant-cancel.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/xmlhttprequest/reentrant-cancel.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentThreadableLoader.cpp