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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h

Issue 2649513002: Add a pre-finalizer for XHR to cancel the loader (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
index 516d17d5c1a2bf5ff13ce1c27fc0414d913487aa..0ee3744aa0a4946ae24edae987df70454d47dd46 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h
@@ -73,6 +73,12 @@ class XMLHttpRequest final : public XMLHttpRequestEventTarget,
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(XMLHttpRequest);
+ // In some cases hasPendingActivity doesn't work correctly, i.e.,
Yuki 2017/01/20 07:02:53 IMHO, hasPendingActivity is not designed to keep t
yhirano 2017/01/20 07:10:10 We have contextDestroyed and it makes hasPendingAc
+ // doesn't keep |this| alive. We need to cancel the loader in such cases,
+ // which is why we need this pre-finalizer.
+ // TODO(yhirano): Remove this pre-finalizer when the bug is fixed.
+ USING_PRE_FINALIZER(XMLHttpRequest, dispose);
sof 2017/01/20 09:17:23 This object is already eagerly finalized, so also
yhirano 2017/01/20 09:49:56 No. As written in the ThreadableLoader comments, a
yhirano 2017/01/20 09:54:08 What happens if we specify both? 1) Something ve
sof 2017/01/20 09:57:45 3, it is confused and wasteful to do both. The des
+
public:
static XMLHttpRequest* create(ScriptState*);
static XMLHttpRequest* create(ExecutionContext*);
@@ -130,6 +136,7 @@ class XMLHttpRequest final : public XMLHttpRequestEventTarget,
const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData&,
ExceptionState&);
void abort();
+ void dispose();
void setRequestHeader(const AtomicString& name,
const AtomicString& value,
ExceptionState&);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698