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

Unified Diff: Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h

Issue 1200413004: Oilpan: make XHR progress event throttling finalization safe. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move XMLHttpRequestProgressEventThrottle to the heap instead Created 5 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/xmlhttprequest/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
diff --git a/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h b/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
index edb3e13bf48dcf8061462303d06060bb3c858c14..27d608f8baac59532d8bf55d20dd2f2688628637 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
+++ b/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
@@ -49,18 +49,20 @@ class EventTarget;
// - "progress" event means an event named "progress"
// - ProgressEvent means an event using the ProgressEvent interface defined in
// the spec.
-class XMLHttpRequestProgressEventThrottle final : public TimerBase {
- DISALLOW_ALLOCATION();
+class XMLHttpRequestProgressEventThrottle final : public NoBaseWillBeGarbageCollectedFinalized<XMLHttpRequestProgressEventThrottle>, public TimerBase {
public:
+ static PassOwnPtrWillBeRawPtr<XMLHttpRequestProgressEventThrottle> create(EventTarget* eventTarget)
+ {
+ return adoptPtrWillBeNoop(new XMLHttpRequestProgressEventThrottle(eventTarget));
+ }
+ virtual ~XMLHttpRequestProgressEventThrottle();
+
enum DeferredEventAction {
Ignore,
Clear,
Flush,
};
- explicit XMLHttpRequestProgressEventThrottle(EventTarget*);
- virtual ~XMLHttpRequestProgressEventThrottle();
-
// Dispatches a ProgressEvent.
//
// Special treatment for events named "progress" is implemented to dispatch
@@ -77,9 +79,13 @@ public:
void suspend();
void resume();
+ // Need to promptly stop this timer when it is deemed finalizable.
+ EAGERLY_FINALIZE();
DECLARE_TRACE();
private:
+ explicit XMLHttpRequestProgressEventThrottle(EventTarget*);
+
// The main purpose of this class is to throttle the "progress"
// ProgressEvent dispatching. This class represents such a deferred
// "progress" ProgressEvent.
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698