Commit b252bda4 authored by philipj's avatar philipj Committed by Commit bot

Rename XMLHttpRequestProgressEventThrottle to ProgressEventThrottle

XMLHttpRequestProgressEvent is no more.

BUG=357112
R=chrishtr@chromium.org

Review URL: https://codereview.chromium.org/1690503002

Cr-Commit-Position: refs/heads/master@{#374683}
parent 186ed42f
...@@ -2305,11 +2305,11 @@ ...@@ -2305,11 +2305,11 @@
'xml/parser/XMLErrors.cpp', 'xml/parser/XMLErrors.cpp',
'xml/parser/XMLErrors.h', 'xml/parser/XMLErrors.h',
'xml/parser/XMLParserInput.h', 'xml/parser/XMLParserInput.h',
'xmlhttprequest/ProgressEventThrottle.cpp',
'xmlhttprequest/ProgressEventThrottle.h',
'xmlhttprequest/XMLHttpRequest.cpp', 'xmlhttprequest/XMLHttpRequest.cpp',
'xmlhttprequest/XMLHttpRequest.h', 'xmlhttprequest/XMLHttpRequest.h',
'xmlhttprequest/XMLHttpRequestEventTarget.h', 'xmlhttprequest/XMLHttpRequestEventTarget.h',
'xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp',
'xmlhttprequest/XMLHttpRequestProgressEventThrottle.h',
'xmlhttprequest/XMLHttpRequestUpload.cpp', 'xmlhttprequest/XMLHttpRequestUpload.cpp',
'xmlhttprequest/XMLHttpRequestUpload.h', 'xmlhttprequest/XMLHttpRequestUpload.h',
], ],
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h" #include "core/xmlhttprequest/ProgressEventThrottle.h"
#include "core/EventTypeNames.h" #include "core/EventTypeNames.h"
#include "core/events/ProgressEvent.h" #include "core/events/ProgressEvent.h"
...@@ -36,12 +36,12 @@ ...@@ -36,12 +36,12 @@
namespace blink { namespace blink {
XMLHttpRequestProgressEventThrottle::DeferredEvent::DeferredEvent() ProgressEventThrottle::DeferredEvent::DeferredEvent()
{ {
clear(); clear();
} }
void XMLHttpRequestProgressEventThrottle::DeferredEvent::set(bool lengthComputable, unsigned long long loaded, unsigned long long total) void ProgressEventThrottle::DeferredEvent::set(bool lengthComputable, unsigned long long loaded, unsigned long long total)
{ {
m_isSet = true; m_isSet = true;
...@@ -50,7 +50,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::set(bool lengthComputab ...@@ -50,7 +50,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::set(bool lengthComputab
m_total = total; m_total = total;
} }
void XMLHttpRequestProgressEventThrottle::DeferredEvent::clear() void ProgressEventThrottle::DeferredEvent::clear()
{ {
m_isSet = false; m_isSet = false;
...@@ -59,7 +59,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::clear() ...@@ -59,7 +59,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::clear()
m_total = 0; m_total = 0;
} }
PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent::take() PassRefPtrWillBeRawPtr<Event> ProgressEventThrottle::DeferredEvent::take()
{ {
ASSERT(m_isSet); ASSERT(m_isSet);
...@@ -68,20 +68,20 @@ PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent ...@@ -68,20 +68,20 @@ PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent
return event.release(); return event.release();
} }
const double XMLHttpRequestProgressEventThrottle::minimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification. const double ProgressEventThrottle::minimumProgressEventDispatchingIntervalInSeconds = .05; // 50 ms per specification.
XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(XMLHttpRequest* target) ProgressEventThrottle::ProgressEventThrottle(XMLHttpRequest* target)
: m_target(target) : m_target(target)
, m_hasDispatchedProgressProgressEvent(false) , m_hasDispatchedProgressProgressEvent(false)
{ {
ASSERT(target); ASSERT(target);
} }
XMLHttpRequestProgressEventThrottle::~XMLHttpRequestProgressEventThrottle() ProgressEventThrottle::~ProgressEventThrottle()
{ {
} }
void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total) void ProgressEventThrottle::dispatchProgressEvent(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
{ {
// Given that ResourceDispatcher doesn't deliver an event when suspended, // Given that ResourceDispatcher doesn't deliver an event when suspended,
// we don't have to worry about event dispatching while suspended. // we don't have to worry about event dispatching while suspended.
...@@ -98,7 +98,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicStri ...@@ -98,7 +98,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressEvent(const AtomicStri
} }
} }
void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event> event, DeferredEventAction action) void ProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefPtrWillBeRawPtr<Event> event, DeferredEventAction action)
{ {
XMLHttpRequest::State state = m_target->readyState(); XMLHttpRequest::State state = m_target->readyState();
// Given that ResourceDispatcher doesn't deliver an event when suspended, // Given that ResourceDispatcher doesn't deliver an event when suspended,
...@@ -123,7 +123,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefP ...@@ -123,7 +123,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent(PassRefP
} }
} }
void XMLHttpRequestProgressEventThrottle::dispatchProgressProgressEvent(PassRefPtrWillBeRawPtr<Event> progressEvent) void ProgressEventThrottle::dispatchProgressProgressEvent(PassRefPtrWillBeRawPtr<Event> progressEvent)
{ {
XMLHttpRequest::State state = m_target->readyState(); XMLHttpRequest::State state = m_target->readyState();
if (m_target->readyState() == XMLHttpRequest::LOADING && m_hasDispatchedProgressProgressEvent) { if (m_target->readyState() == XMLHttpRequest::LOADING && m_hasDispatchedProgressProgressEvent) {
...@@ -139,7 +139,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressProgressEvent(PassRefP ...@@ -139,7 +139,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressProgressEvent(PassRefP
m_target->dispatchEvent(progressEvent); m_target->dispatchEvent(progressEvent);
} }
void XMLHttpRequestProgressEventThrottle::fired() void ProgressEventThrottle::fired()
{ {
if (!m_deferred.isSet()) { if (!m_deferred.isSet()) {
// No "progress" event was queued since the previous dispatch, we can // No "progress" event was queued since the previous dispatch, we can
...@@ -153,12 +153,12 @@ void XMLHttpRequestProgressEventThrottle::fired() ...@@ -153,12 +153,12 @@ void XMLHttpRequestProgressEventThrottle::fired()
startOneShot(minimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE); startOneShot(minimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
} }
void XMLHttpRequestProgressEventThrottle::suspend() void ProgressEventThrottle::suspend()
{ {
stop(); stop();
} }
void XMLHttpRequestProgressEventThrottle::resume() void ProgressEventThrottle::resume()
{ {
if (!m_deferred.isSet()) if (!m_deferred.isSet())
return; return;
...@@ -169,7 +169,7 @@ void XMLHttpRequestProgressEventThrottle::resume() ...@@ -169,7 +169,7 @@ void XMLHttpRequestProgressEventThrottle::resume()
startOneShot(0, BLINK_FROM_HERE); startOneShot(0, BLINK_FROM_HERE);
} }
DEFINE_TRACE(XMLHttpRequestProgressEventThrottle) DEFINE_TRACE(ProgressEventThrottle)
{ {
visitor->trace(m_target); visitor->trace(m_target);
} }
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef XMLHttpRequestProgressEventThrottle_h #ifndef ProgressEventThrottle_h
#define XMLHttpRequestProgressEventThrottle_h #define ProgressEventThrottle_h
#include "platform/Timer.h" #include "platform/Timer.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
...@@ -48,13 +48,13 @@ class XMLHttpRequest; ...@@ -48,13 +48,13 @@ class XMLHttpRequest;
// - "progress" event means an event named "progress" // - "progress" event means an event named "progress"
// - ProgressEvent means an event using the ProgressEvent interface defined in // - ProgressEvent means an event using the ProgressEvent interface defined in
// the spec. // the spec.
class XMLHttpRequestProgressEventThrottle final : public GarbageCollectedFinalized<XMLHttpRequestProgressEventThrottle>, public TimerBase { class ProgressEventThrottle final : public GarbageCollectedFinalized<ProgressEventThrottle>, public TimerBase {
public: public:
static XMLHttpRequestProgressEventThrottle* create(XMLHttpRequest* eventTarget) static ProgressEventThrottle* create(XMLHttpRequest* eventTarget)
{ {
return new XMLHttpRequestProgressEventThrottle(eventTarget); return new ProgressEventThrottle(eventTarget);
} }
~XMLHttpRequestProgressEventThrottle() override; ~ProgressEventThrottle() override;
enum DeferredEventAction { enum DeferredEventAction {
Ignore, Ignore,
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
DECLARE_TRACE(); DECLARE_TRACE();
private: private:
explicit XMLHttpRequestProgressEventThrottle(XMLHttpRequest*); explicit ProgressEventThrottle(XMLHttpRequest*);
// Dispatches a "progress" progress event and usually a readyStateChange // Dispatches a "progress" progress event and usually a readyStateChange
// event as well. // event as well.
...@@ -127,4 +127,4 @@ private: ...@@ -127,4 +127,4 @@ private:
} // namespace blink } // namespace blink
#endif // XMLHttpRequestProgressEventThrottle_h #endif // ProgressEventThrottle_h
...@@ -208,7 +208,7 @@ XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri ...@@ -208,7 +208,7 @@ XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri
, m_lengthDownloadedToFile(0) , m_lengthDownloadedToFile(0)
, m_receivedLength(0) , m_receivedLength(0)
, m_exceptionCode(0) , m_exceptionCode(0)
, m_progressEventThrottle(XMLHttpRequestProgressEventThrottle::create(this)) , m_progressEventThrottle(ProgressEventThrottle::create(this))
, m_responseTypeCode(ResponseTypeDefault) , m_responseTypeCode(ResponseTypeDefault)
, m_isolatedWorldSecurityOrigin(isolatedWorldSecurityOrigin) , m_isolatedWorldSecurityOrigin(isolatedWorldSecurityOrigin)
, m_eventDispatchRecursionLevel(0) , m_eventDispatchRecursionLevel(0)
...@@ -506,12 +506,12 @@ void XMLHttpRequest::dispatchReadyStateChangeEvent() ...@@ -506,12 +506,12 @@ void XMLHttpRequest::dispatchReadyStateChangeEvent()
ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel);
if (m_async || (m_state <= OPENED || m_state == DONE)) { if (m_async || (m_state <= OPENED || m_state == DONE)) {
TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(executionContext(), this)); TRACE_EVENT1("devtools.timeline", "XHRReadyStateChange", "data", InspectorXhrReadyStateChangeEvent::data(executionContext(), this));
XMLHttpRequestProgressEventThrottle::DeferredEventAction action = XMLHttpRequestProgressEventThrottle::Ignore; ProgressEventThrottle::DeferredEventAction action = ProgressEventThrottle::Ignore;
if (m_state == DONE) { if (m_state == DONE) {
if (m_error) if (m_error)
action = XMLHttpRequestProgressEventThrottle::Clear; action = ProgressEventThrottle::Clear;
else else
action = XMLHttpRequestProgressEventThrottle::Flush; action = ProgressEventThrottle::Flush;
} }
m_progressEventThrottle->dispatchReadyStateChangeEvent(Event::create(EventTypeNames::readystatechange), action); m_progressEventThrottle->dispatchReadyStateChangeEvent(Event::create(EventTypeNames::readystatechange), action);
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data()); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data());
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include "core/dom/ActiveDOMObject.h" #include "core/dom/ActiveDOMObject.h"
#include "core/dom/DocumentParserClient.h" #include "core/dom/DocumentParserClient.h"
#include "core/loader/ThreadableLoaderClient.h" #include "core/loader/ThreadableLoaderClient.h"
#include "core/xmlhttprequest/ProgressEventThrottle.h"
#include "core/xmlhttprequest/XMLHttpRequestEventTarget.h" #include "core/xmlhttprequest/XMLHttpRequestEventTarget.h"
#include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "platform/network/EncodedFormData.h" #include "platform/network/EncodedFormData.h"
#include "platform/network/HTTPHeaderMap.h" #include "platform/network/HTTPHeaderMap.h"
...@@ -250,7 +250,7 @@ private: ...@@ -250,7 +250,7 @@ private:
void handleRequestError(ExceptionCode, const AtomicString&, long long, long long); void handleRequestError(ExceptionCode, const AtomicString&, long long, long long);
XMLHttpRequestProgressEventThrottle& progressEventThrottle(); ProgressEventThrottle& progressEventThrottle();
Member<XMLHttpRequestUpload> m_upload; Member<XMLHttpRequestUpload> m_upload;
...@@ -289,7 +289,7 @@ private: ...@@ -289,7 +289,7 @@ private:
// any. // any.
ExceptionCode m_exceptionCode; ExceptionCode m_exceptionCode;
Member<XMLHttpRequestProgressEventThrottle> m_progressEventThrottle; Member<ProgressEventThrottle> m_progressEventThrottle;
// An enum corresponding to the allowed string values for the responseType attribute. // An enum corresponding to the allowed string values for the responseType attribute.
ResponseTypeCode m_responseTypeCode; ResponseTypeCode m_responseTypeCode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment