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 @@
'xml/parser/XMLErrors.cpp',
'xml/parser/XMLErrors.h',
'xml/parser/XMLParserInput.h',
'xmlhttprequest/ProgressEventThrottle.cpp',
'xmlhttprequest/ProgressEventThrottle.h',
'xmlhttprequest/XMLHttpRequest.cpp',
'xmlhttprequest/XMLHttpRequest.h',
'xmlhttprequest/XMLHttpRequestEventTarget.h',
'xmlhttprequest/XMLHttpRequestProgressEventThrottle.cpp',
'xmlhttprequest/XMLHttpRequestProgressEventThrottle.h',
'xmlhttprequest/XMLHttpRequestUpload.cpp',
'xmlhttprequest/XMLHttpRequestUpload.h',
],
......
......@@ -24,7 +24,7 @@
* 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/events/ProgressEvent.h"
......@@ -36,12 +36,12 @@
namespace blink {
XMLHttpRequestProgressEventThrottle::DeferredEvent::DeferredEvent()
ProgressEventThrottle::DeferredEvent::DeferredEvent()
{
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;
......@@ -50,7 +50,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::set(bool lengthComputab
m_total = total;
}
void XMLHttpRequestProgressEventThrottle::DeferredEvent::clear()
void ProgressEventThrottle::DeferredEvent::clear()
{
m_isSet = false;
......@@ -59,7 +59,7 @@ void XMLHttpRequestProgressEventThrottle::DeferredEvent::clear()
m_total = 0;
}
PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent::take()
PassRefPtrWillBeRawPtr<Event> ProgressEventThrottle::DeferredEvent::take()
{
ASSERT(m_isSet);
......@@ -68,20 +68,20 @@ PassRefPtrWillBeRawPtr<Event> XMLHttpRequestProgressEventThrottle::DeferredEvent
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_hasDispatchedProgressProgressEvent(false)
{
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,
// we don't have to worry about event dispatching while suspended.
......@@ -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();
// Given that ResourceDispatcher doesn't deliver an event when suspended,
......@@ -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();
if (m_target->readyState() == XMLHttpRequest::LOADING && m_hasDispatchedProgressProgressEvent) {
......@@ -139,7 +139,7 @@ void XMLHttpRequestProgressEventThrottle::dispatchProgressProgressEvent(PassRefP
m_target->dispatchEvent(progressEvent);
}
void XMLHttpRequestProgressEventThrottle::fired()
void ProgressEventThrottle::fired()
{
if (!m_deferred.isSet()) {
// No "progress" event was queued since the previous dispatch, we can
......@@ -153,12 +153,12 @@ void XMLHttpRequestProgressEventThrottle::fired()
startOneShot(minimumProgressEventDispatchingIntervalInSeconds, BLINK_FROM_HERE);
}
void XMLHttpRequestProgressEventThrottle::suspend()
void ProgressEventThrottle::suspend()
{
stop();
}
void XMLHttpRequestProgressEventThrottle::resume()
void ProgressEventThrottle::resume()
{
if (!m_deferred.isSet())
return;
......@@ -169,7 +169,7 @@ void XMLHttpRequestProgressEventThrottle::resume()
startOneShot(0, BLINK_FROM_HERE);
}
DEFINE_TRACE(XMLHttpRequestProgressEventThrottle)
DEFINE_TRACE(ProgressEventThrottle)
{
visitor->trace(m_target);
}
......
......@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef XMLHttpRequestProgressEventThrottle_h
#define XMLHttpRequestProgressEventThrottle_h
#ifndef ProgressEventThrottle_h
#define ProgressEventThrottle_h
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
......@@ -48,13 +48,13 @@ class XMLHttpRequest;
// - "progress" event means an event named "progress"
// - ProgressEvent means an event using the ProgressEvent interface defined in
// the spec.
class XMLHttpRequestProgressEventThrottle final : public GarbageCollectedFinalized<XMLHttpRequestProgressEventThrottle>, public TimerBase {
class ProgressEventThrottle final : public GarbageCollectedFinalized<ProgressEventThrottle>, public TimerBase {
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 {
Ignore,
......@@ -85,7 +85,7 @@ public:
DECLARE_TRACE();
private:
explicit XMLHttpRequestProgressEventThrottle(XMLHttpRequest*);
explicit ProgressEventThrottle(XMLHttpRequest*);
// Dispatches a "progress" progress event and usually a readyStateChange
// event as well.
......@@ -127,4 +127,4 @@ private:
} // namespace blink
#endif // XMLHttpRequestProgressEventThrottle_h
#endif // ProgressEventThrottle_h
......@@ -208,7 +208,7 @@ XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri
, m_lengthDownloadedToFile(0)
, m_receivedLength(0)
, m_exceptionCode(0)
, m_progressEventThrottle(XMLHttpRequestProgressEventThrottle::create(this))
, m_progressEventThrottle(ProgressEventThrottle::create(this))
, m_responseTypeCode(ResponseTypeDefault)
, m_isolatedWorldSecurityOrigin(isolatedWorldSecurityOrigin)
, m_eventDispatchRecursionLevel(0)
......@@ -506,12 +506,12 @@ void XMLHttpRequest::dispatchReadyStateChangeEvent()
ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel);
if (m_async || (m_state <= OPENED || m_state == DONE)) {
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_error)
action = XMLHttpRequestProgressEventThrottle::Clear;
action = ProgressEventThrottle::Clear;
else
action = XMLHttpRequestProgressEventThrottle::Flush;
action = ProgressEventThrottle::Flush;
}
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());
......
......@@ -27,8 +27,8 @@
#include "core/dom/ActiveDOMObject.h"
#include "core/dom/DocumentParserClient.h"
#include "core/loader/ThreadableLoaderClient.h"
#include "core/xmlhttprequest/ProgressEventThrottle.h"
#include "core/xmlhttprequest/XMLHttpRequestEventTarget.h"
#include "core/xmlhttprequest/XMLHttpRequestProgressEventThrottle.h"
#include "platform/heap/Handle.h"
#include "platform/network/EncodedFormData.h"
#include "platform/network/HTTPHeaderMap.h"
......@@ -250,7 +250,7 @@ private:
void handleRequestError(ExceptionCode, const AtomicString&, long long, long long);
XMLHttpRequestProgressEventThrottle& progressEventThrottle();
ProgressEventThrottle& progressEventThrottle();
Member<XMLHttpRequestUpload> m_upload;
......@@ -289,7 +289,7 @@ private:
// any.
ExceptionCode m_exceptionCode;
Member<XMLHttpRequestProgressEventThrottle> m_progressEventThrottle;
Member<ProgressEventThrottle> m_progressEventThrottle;
// An enum corresponding to the allowed string values for the responseType attribute.
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