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

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

Issue 1455513002: [XHR] Decrease readyStateChange event dispatching during loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
index 3c17f0f2b6d7036dd620c47df477b56ba25632d6..28f43a0bf83f558cd67cd9cbbd552cc8199231a7 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h
@@ -71,6 +71,8 @@ public:
// queued. If the timer is running, this method just updates
// m_lengthComputable, m_loaded and m_total. They'll be used on next
// fired() call.
+ // For an event named "progress", a readyStateChange will be dispatched
+ // as well.
void dispatchProgressEvent(const AtomicString&, bool lengthComputable, unsigned long long loaded, unsigned long long total);
// Dispatches the given event after operation about the "progress" event
// depending on the value of the ProgressEventAction argument.
@@ -86,6 +88,10 @@ public:
private:
explicit XMLHttpRequestProgressEventThrottle(XMLHttpRequest*);
+ // Dispatches a "progress" progress event and usually a readyStateChange
+ // event as well.
+ void dispatchProgressProgressEvent(bool lengthComputable, unsigned long long loaded, unsigned long long total);
+
// The main purpose of this class is to throttle the "progress"
// ProgressEvent dispatching. This class represents such a deferred
// "progress" ProgressEvent.
@@ -95,15 +101,14 @@ private:
void fired() override;
void dispatchDeferredEvent();
- // Non-Oilpan, keep a weak pointer to our XMLHttpRequest object as it is
- // the one holding us. With Oilpan, a simple strong Member can be used -
- // this XMLHttpRequestProgressEventThrottle (part) object dies together
- // with the XMLHttpRequest object.
Member<XMLHttpRequest> m_target;
// A slot for the deferred "progress" ProgressEvent. When multiple events
// arrive, only the last one is stored and others are discarded.
const OwnPtr<DeferredEvent> m_deferred;
+ // True if any "progress" progress event has been dispatched since
+ // |m_target|'s readyState changed.
+ bool m_hasDispatchedProgressProgressEvent;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698