Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: Source/core/xml/XMLHttpRequest.cpp

Issue 16284009: Don't deref XMLHttpRequest synchronously below stop() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.cpp
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 712a03155673bdadd2e3b5bf6757c7f7ad1b037b..8f79ae23e200a7f857446141a0080229e8481d83 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -181,6 +181,7 @@ XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext* context, PassRefPtr<Secur
, m_exceptionCode(0)
, m_progressEventThrottle(this)
, m_responseTypeCode(ResponseTypeDefault)
+ , m_protectionTimer(this, &XMLHttpRequest::dropProtection)
, m_securityOrigin(securityOrigin)
{
initializeXMLHttpRequestStaticData();
@@ -834,7 +835,7 @@ void XMLHttpRequest::internalAbort()
InspectorInstrumentation::didFailXHRLoading(scriptExecutionContext(), this);
if (hadLoader)
- dropProtection();
+ dropProtectionSoon();
}
void XMLHttpRequest::clearResponse()
@@ -891,9 +892,15 @@ void XMLHttpRequest::abortError()
}
}
-void XMLHttpRequest::dropProtection()
+void XMLHttpRequest::dropProtectionSoon()
{
+ if (m_protectionTimer.isActive())
+ return;
+ m_protectionTimer.startOneShot(0);
+}
+void XMLHttpRequest::dropProtection(Timer<XMLHttpRequest>*)
+{
unsetPendingActivity(this);
}
« no previous file with comments | « Source/core/xml/XMLHttpRequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698