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

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

Issue 104363002: [XHR] Use hasPendingActivity() to manage XHR's life time. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years 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 | Source/core/xml/XMLHttpRequest.cpp » ('j') | Source/core/xml/XMLHttpRequest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLHttpRequest.h
diff --git a/Source/core/xml/XMLHttpRequest.h b/Source/core/xml/XMLHttpRequest.h
index dfb585e3504e66a475c303ff0bcd54d095651ba2..d04e438a454c553d1ac916cee433c100d22d0db6 100644
--- a/Source/core/xml/XMLHttpRequest.h
+++ b/Source/core/xml/XMLHttpRequest.h
@@ -30,7 +30,6 @@
#include "core/loader/ThreadableLoaderClient.h"
#include "core/xml/XMLHttpRequestEventTarget.h"
#include "core/xml/XMLHttpRequestProgressEventThrottle.h"
-#include "platform/AsyncMethodRunner.h"
#include "platform/network/FormData.h"
#include "platform/network/ResourceResponse.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -79,15 +78,14 @@ public:
ResponseTypeStream
};
- enum DropProtection {
- DropProtectionSync,
- DropProtectionAsync,
- };
-
- virtual void contextDestroyed();
- virtual void suspend();
- virtual void resume();
- virtual void stop();
+ // ActiveDOMObject implementaions
+ virtual void contextDestroyed() OVERRIDE;
+ // Keep the JavaScript wrapper alive while a request is in progress so that
+ // this object (which is a listener for m_loader) is also kept alive.
+ virtual bool hasPendingActivity() const OVERRIDE;
+ virtual void suspend() OVERRIDE;
+ virtual void resume() OVERRIDE;
+ virtual void stop() OVERRIDE;
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual ExecutionContext* executionContext() const OVERRIDE;
@@ -172,12 +170,10 @@ private:
void changeState(State newState);
void dispatchReadyStateChangeEvent();
- void dropProtectionSoon();
- void dropProtection();
// Clears variables used only while the resource is being loaded.
void clearVariablesForLoading();
// Returns false iff reentry happened and a new load is started.
- bool internalAbort(DropProtection = DropProtectionSync);
+ bool internalAbort();
// Clears variables holding response header and body data.
void clearResponse();
void clearRequest();
@@ -256,7 +252,6 @@ private:
// An enum corresponding to the allowed string values for the responseType attribute.
ResponseTypeCode m_responseTypeCode;
- AsyncMethodRunner<XMLHttpRequest> m_dropProtectionRunner;
RefPtr<SecurityOrigin> m_securityOrigin;
};
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.cpp » ('j') | Source/core/xml/XMLHttpRequest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698