WebKit Bugzilla
Attachment 348076 Details for
Bug 188944
: Shrink size of XMLHttpRequest
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188944-20180825223558.patch (text/plain), 22.29 KB, created by
Yusuke Suzuki
on 2018-08-25 06:35:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-08-25 06:35:59 PDT
Size:
22.29 KB
patch
obsolete
>Subversion Revision: 235338 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 9fa4fd5f7f5680b639aea0fb7d40dcb5265ae229..a07f97f292ba49068fd26c04c20ce5e9181947b8 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-25 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Shrink size of XMLHttpRequest >+ https://bugs.webkit.org/show_bug.cgi?id=188944 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ StringBuilder is included in XMLHttpRequest. We reduce the size of StringBuilder too >+ by reordering members. >+ >+ * wtf/text/StringBuilder.h: >+ (WTF::StringBuilder::StringBuilder): >+ > 2018-08-24 Tim Horton <timothy_horton@apple.com> > > Improve unified source generator script logging and error messages >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 302c942a8cb7e43d5dfc46d5cbb1895e79b4b176..cf5d1f932e7cccc18ad881a730413492b369aa43 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,46 @@ >+2018-08-25 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Shrink size of XMLHttpRequest >+ https://bugs.webkit.org/show_bug.cgi?id=188944 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Shrink the size of XMLHttpRequest by packing bits and reordering members. >+ It reduces the size from 1248 to 1176. >+ >+ No behavior change. >+ >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::XMLHttpRequest): >+ (WebCore::XMLHttpRequest::responseText): >+ (WebCore::XMLHttpRequest::createResponseBlob): >+ (WebCore::XMLHttpRequest::createResponseArrayBuffer): >+ (WebCore::XMLHttpRequest::setResponseType): >+ (WebCore::XMLHttpRequest::changeState): >+ (WebCore::XMLHttpRequest::callReadyStateChangeListener): >+ (WebCore::XMLHttpRequest::setWithCredentials): >+ (WebCore::XMLHttpRequest::open): >+ (WebCore::XMLHttpRequest::prepareToSend): >+ (WebCore::XMLHttpRequest::createRequest): >+ (WebCore::XMLHttpRequest::abort): >+ (WebCore::XMLHttpRequest::overrideMimeType): >+ (WebCore::XMLHttpRequest::setRequestHeader): >+ (WebCore::XMLHttpRequest::getAllResponseHeaders const): >+ (WebCore::XMLHttpRequest::getResponseHeader const): >+ (WebCore::XMLHttpRequest::status const): >+ (WebCore::XMLHttpRequest::statusText const): >+ (WebCore::XMLHttpRequest::didFinishLoading): >+ (WebCore::XMLHttpRequest::createDecoder const): >+ (WebCore::XMLHttpRequest::didReceiveData): >+ (WebCore::XMLHttpRequest::didReachTimeout): >+ (WebCore::XMLHttpRequest::readyState const): Deleted. >+ * xml/XMLHttpRequest.h: >+ (WebCore::XMLHttpRequest::responseType const): >+ (WebCore::XMLHttpRequest::readyState const): >+ * xml/XMLHttpRequestProgressEventThrottle.cpp: >+ (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle): >+ * xml/XMLHttpRequestProgressEventThrottle.h: >+ > 2018-08-24 Ryosuke Niwa <rniwa@webkit.org> > > Click event from click() is not composed >diff --git a/Source/WTF/wtf/text/StringBuilder.h b/Source/WTF/wtf/text/StringBuilder.h >index 8e4c72012621995361f674f835e1e5be8ed8de93..036ef726c198299cf7859f1f83ae86a0d1033340 100644 >--- a/Source/WTF/wtf/text/StringBuilder.h >+++ b/Source/WTF/wtf/text/StringBuilder.h >@@ -40,9 +40,7 @@ class StringBuilder { > > public: > StringBuilder() >- : m_length(0) >- , m_is8Bit(true) >- , m_bufferCharacters8(nullptr) >+ : m_bufferCharacters8(nullptr) > { > } > StringBuilder(StringBuilder&&) = default; >@@ -308,14 +306,14 @@ class StringBuilder { > ALWAYS_INLINE CharType * getBufferCharacters(); > WTF_EXPORT_PRIVATE void reifyString() const; > >- unsigned m_length; > mutable String m_string; > RefPtr<StringImpl> m_buffer; >- bool m_is8Bit; > union { > LChar* m_bufferCharacters8; > UChar* m_bufferCharacters16; > }; >+ unsigned m_length { 0 }; >+ bool m_is8Bit { true }; > }; > > template <> >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index fc1ab204728524a5043dd5f09e99f59041c4c160..6e72c1638ced9e540917c09dac597f544fe84a68 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -111,6 +111,18 @@ Ref<XMLHttpRequest> XMLHttpRequest::create(ScriptExecutionContext& context) > > XMLHttpRequest::XMLHttpRequest(ScriptExecutionContext& context) > : ActiveDOMObject(&context) >+ , m_async(true) >+ , m_includeCredentials(false) >+ , m_sendFlag(false) >+ , m_createdDocument(false) >+ , m_error(false) >+ , m_uploadListenerFlag(false) >+ , m_uploadComplete(false) >+ , m_wasAbortedByClient(false) >+ , m_responseCacheIsValid(false) >+ , m_dispatchErrorOnResuming(false) >+ , m_readyState(static_cast<unsigned>(UNSENT)) >+ , m_responseType(static_cast<unsigned>(ResponseType::EmptyString)) > , m_progressEventThrottle(this) > , m_resumeTimer(*this, &XMLHttpRequest::resumeTimerFired) > , m_networkErrorTimer(*this, &XMLHttpRequest::networkErrorTimerFired) >@@ -150,14 +162,9 @@ bool XMLHttpRequest::usesDashboardBackwardCompatibilityMode() const > > #endif > >-XMLHttpRequest::State XMLHttpRequest::readyState() const >-{ >- return m_state; >-} >- > ExceptionOr<OwnedString> XMLHttpRequest::responseText() > { >- if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Text) >+ if (responseType() != ResponseType::EmptyString && responseType() != ResponseType::Text) > return Exception { InvalidStateError }; > return OwnedString { responseTextIgnoringResponseType() }; > } >@@ -173,7 +180,7 @@ ExceptionOr<Document*> XMLHttpRequest::responseXML() > { > ASSERT(scriptExecutionContext()->isDocument()); > >- if (m_responseType != ResponseType::EmptyString && m_responseType != ResponseType::Document) >+ if (responseType() != ResponseType::EmptyString && responseType() != ResponseType::Document) > return Exception { InvalidStateError }; > > if (!doneWithoutErrors()) >@@ -186,7 +193,7 @@ ExceptionOr<Document*> XMLHttpRequest::responseXML() > // The W3C spec requires the final MIME type to be some valid XML type, or text/html. > // If it is text/html, then the responseType of "document" must have been supplied explicitly. > if ((m_response.isHTTP() && !responseIsXML() && !isHTML) >- || (isHTML && m_responseType == ResponseType::EmptyString)) { >+ || (isHTML && responseType() == ResponseType::EmptyString)) { > m_responseDocument = nullptr; > } else { > if (isHTML) >@@ -210,7 +217,7 @@ ExceptionOr<Document*> XMLHttpRequest::responseXML() > > Ref<Blob> XMLHttpRequest::createResponseBlob() > { >- ASSERT(m_responseType == ResponseType::Blob); >+ ASSERT(responseType() == ResponseType::Blob); > ASSERT(doneWithoutErrors()); > > if (!m_binaryResponseBuilder) >@@ -226,7 +233,7 @@ Ref<Blob> XMLHttpRequest::createResponseBlob() > > RefPtr<ArrayBuffer> XMLHttpRequest::createResponseArrayBuffer() > { >- ASSERT(m_responseType == ResponseType::Arraybuffer); >+ ASSERT(responseType() == ResponseType::Arraybuffer); > ASSERT(doneWithoutErrors()); > > auto result = m_binaryResponseBuilder ? m_binaryResponseBuilder->tryCreateArrayBuffer() : ArrayBuffer::create(nullptr, 0); >@@ -255,7 +262,7 @@ ExceptionOr<void> XMLHttpRequest::setResponseType(ResponseType type) > if (!scriptExecutionContext()->isDocument() && type == ResponseType::Document) > return { }; > >- if (m_state >= LOADING) >+ if (readyState() >= LOADING) > return Exception { InvalidStateError }; > > // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated >@@ -267,7 +274,7 @@ ExceptionOr<void> XMLHttpRequest::setResponseType(ResponseType type) > return Exception { InvalidAccessError }; > } > >- m_responseType = type; >+ m_responseType = static_cast<unsigned>(type); > return { }; > } > >@@ -288,8 +295,8 @@ XMLHttpRequestUpload& XMLHttpRequest::upload() > > void XMLHttpRequest::changeState(State newState) > { >- if (m_state != newState) { >- m_state = newState; >+ if (readyState() != newState) { >+ m_readyState = static_cast<State>(newState); > callReadyStateChangeListener(); > } > } >@@ -299,12 +306,12 @@ void XMLHttpRequest::callReadyStateChangeListener() > if (!scriptExecutionContext()) > return; > >- // Check whether sending load and loadend events before sending readystatechange event, as it may change m_error/m_state values. >- bool shouldSendLoadEvent = (m_state == DONE && !m_error); >+ // Check whether sending load and loadend events before sending readystatechange event, as it may change m_error/m_readyState values. >+ bool shouldSendLoadEvent = (readyState() == DONE && !m_error); > >- if (m_async || (m_state <= OPENED || m_state == DONE)) { >+ if (m_async || (readyState() <= OPENED || readyState() == DONE)) { > m_progressEventThrottle.dispatchReadyStateChangeEvent(Event::create(eventNames().readystatechangeEvent, Event::CanBubble::No, Event::IsCancelable::No), >- m_state == DONE ? FlushProgressEvent : DoNotFlushProgressEvent); >+ readyState() == DONE ? FlushProgressEvent : DoNotFlushProgressEvent); > } > > if (shouldSendLoadEvent) { >@@ -315,7 +322,7 @@ void XMLHttpRequest::callReadyStateChangeListener() > > ExceptionOr<void> XMLHttpRequest::setWithCredentials(bool value) > { >- if (m_state > OPENED || m_sendFlag) >+ if (readyState() > OPENED || m_sendFlag) > return Exception { InvalidStateError }; > > m_includeCredentials = value; >@@ -341,7 +348,7 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, boo > // attempt to discourage synchronous XHR use. responseType is one such piece of functionality. > // We'll only disable this functionality for HTTP(S) requests since sync requests for local protocols > // such as file: and data: still make sense to allow. >- if (url.protocolIsInHTTPFamily() && m_responseType != ResponseType::EmptyString) { >+ if (url.protocolIsInHTTPFamily() && responseType() != ResponseType::EmptyString) { > logConsoleError(scriptExecutionContext(), "Synchronous HTTP(S) requests made from the window context cannot have XMLHttpRequest.responseType set."); > return Exception { InvalidAccessError }; > } >@@ -401,7 +408,7 @@ std::optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend() > > auto& context = *scriptExecutionContext(); > >- if (m_state != OPENED || m_sendFlag) >+ if (readyState() != OPENED || m_sendFlag) > return ExceptionOr<void> { Exception { InvalidStateError } }; > ASSERT(!m_loader); > >@@ -613,7 +620,7 @@ ExceptionOr<void> XMLHttpRequest::createRequest() > if (!m_uploadComplete && m_uploadListenerFlag) > m_upload->dispatchProgressEvent(eventNames().loadstartEvent); > >- if (m_state != OPENED || !m_sendFlag || m_loader) >+ if (readyState() != OPENED || !m_sendFlag || m_loader) > return { }; > > // ThreadableLoader::create can return null here, for example if we're no longer attached to a page or if a content blocker blocks the load. >@@ -655,14 +662,14 @@ void XMLHttpRequest::abort() > clearResponseBuffers(); > > m_requestHeaders.clear(); >- if ((m_state == OPENED && m_sendFlag) || m_state == HEADERS_RECEIVED || m_state == LOADING) { >+ if ((readyState() == OPENED && m_sendFlag) || readyState() == HEADERS_RECEIVED || readyState() == LOADING) { > ASSERT(!m_loader); > m_sendFlag = false; > changeState(DONE); > dispatchErrorEvents(eventNames().abortEvent); > } >- if (m_state == DONE) >- m_state = UNSENT; >+ if (readyState() == DONE) >+ m_readyState = static_cast<State>(UNSENT); > } > > bool XMLHttpRequest::internalAbort() >@@ -767,7 +774,7 @@ void XMLHttpRequest::dropProtection() > > ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& override) > { >- if (m_state == LOADING || m_state == DONE) >+ if (readyState() == LOADING || readyState() == DONE) > return Exception { InvalidStateError }; > > m_mimeTypeOverride = override; >@@ -776,7 +783,7 @@ ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& override) > > ExceptionOr<void> XMLHttpRequest::setRequestHeader(const String& name, const String& value) > { >- if (m_state != OPENED || m_sendFlag) { >+ if (readyState() != OPENED || m_sendFlag) { > #if ENABLE(DASHBOARD_SUPPORT) > if (usesDashboardBackwardCompatibilityMode()) > return { }; >@@ -805,7 +812,7 @@ ExceptionOr<void> XMLHttpRequest::setRequestHeader(const String& name, const Str > > String XMLHttpRequest::getAllResponseHeaders() const > { >- if (m_state < HEADERS_RECEIVED || m_error) >+ if (readyState() < HEADERS_RECEIVED || m_error) > return emptyString(); > > if (!m_allResponseHeaders) { >@@ -833,7 +840,7 @@ String XMLHttpRequest::getAllResponseHeaders() const > > String XMLHttpRequest::getResponseHeader(const String& name) const > { >- if (m_state < HEADERS_RECEIVED || m_error) >+ if (readyState() < HEADERS_RECEIVED || m_error) > return String(); > > return m_response.httpHeaderField(name); >@@ -860,7 +867,7 @@ bool XMLHttpRequest::responseIsXML() const > > int XMLHttpRequest::status() const > { >- if (m_state == UNSENT || m_state == OPENED || m_error) >+ if (readyState() == UNSENT || readyState() == OPENED || m_error) > return 0; > > return m_response.httpStatusCode(); >@@ -868,7 +875,7 @@ int XMLHttpRequest::status() const > > String XMLHttpRequest::statusText() const > { >- if (m_state == UNSENT || m_state == OPENED || m_error) >+ if (readyState() == UNSENT || readyState() == OPENED || m_error) > return String(); > > return m_response.httpStatusText(); >@@ -910,7 +917,7 @@ void XMLHttpRequest::didFinishLoading(unsigned long) > if (m_error) > return; > >- if (m_state < HEADERS_RECEIVED) >+ if (readyState() < HEADERS_RECEIVED) > changeState(HEADERS_RECEIVED); > > if (m_decoder) >@@ -977,7 +984,7 @@ Ref<TextResourceDecoder> XMLHttpRequest::createDecoder() const > if (!m_responseEncoding.isEmpty()) > return TextResourceDecoder::create("text/plain", m_responseEncoding); > >- switch (m_responseType) { >+ switch (responseType()) { > case ResponseType::EmptyString: > if (responseIsXML()) { > auto decoder = TextResourceDecoder::create("application/xml"); >@@ -1010,7 +1017,7 @@ void XMLHttpRequest::didReceiveData(const char* data, int len) > if (m_error) > return; > >- if (m_state < HEADERS_RECEIVED) >+ if (readyState() < HEADERS_RECEIVED) > changeState(HEADERS_RECEIVED); > > // FIXME: Should we update "Content-Type" header field with m_mimeTypeOverride value in case it has changed since didReceiveResponse? >@@ -1019,7 +1026,7 @@ void XMLHttpRequest::didReceiveData(const char* data, int len) > if (m_responseEncoding.isEmpty()) > m_responseEncoding = m_response.textEncodingName(); > >- bool useDecoder = shouldDecodeResponse(m_responseType); >+ bool useDecoder = shouldDecodeResponse(responseType()); > > if (useDecoder && !m_decoder) > m_decoder = createDecoder(); >@@ -1049,7 +1056,7 @@ void XMLHttpRequest::didReceiveData(const char* data, int len) > m_progressEventThrottle.dispatchThrottledProgressEvent(lengthComputable, m_receivedLength, total); > } > >- if (m_state != LOADING) >+ if (readyState() != LOADING) > changeState(LOADING); > else > // Firefox calls readyStateChanged every time it receives data, 4449442 >@@ -1085,7 +1092,7 @@ void XMLHttpRequest::didReachTimeout() > m_exceptionCode = TimeoutError; > > if (!m_async) { >- m_state = DONE; >+ m_readyState = static_cast<State>(DONE); > m_exceptionCode = TimeoutError; > return; > } >diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h >index e32d01335cab370600bf06b622e379e267d6fce2..4e8ae70bbe52ae6fe2dcd4064088ad07cf7edbb7 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.h >+++ b/Source/WebCore/xml/XMLHttpRequest.h >@@ -49,13 +49,14 @@ class ThreadableLoader; > class XMLHttpRequestUpload; > struct OwnedString; > >-class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public XMLHttpRequestEventTarget, private ThreadableLoaderClient, public ActiveDOMObject { >+class XMLHttpRequest final : public ActiveDOMObject, public RefCounted<XMLHttpRequest>, private ThreadableLoaderClient, public XMLHttpRequestEventTarget { > WTF_MAKE_FAST_ALLOCATED; > public: > static Ref<XMLHttpRequest> create(ScriptExecutionContext&); > WEBCORE_EXPORT ~XMLHttpRequest(); > >- enum State { >+ // Keep it in 3bits. >+ enum State : uint8_t { > UNSENT = 0, > OPENED = 1, > HEADERS_RECEIVED = 2, >@@ -83,7 +84,7 @@ class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public XMLHttpRe > void abort(); > ExceptionOr<void> setRequestHeader(const String& name, const String& value); > ExceptionOr<void> overrideMimeType(const String& override); >- bool doneWithoutErrors() const { return !m_error && m_state == DONE; } >+ bool doneWithoutErrors() const { return !m_error && readyState() == DONE; } > String getAllResponseHeaders() const; > String getResponseHeader(const String& name) const; > ExceptionOr<OwnedString> responseText(); >@@ -102,7 +103,15 @@ class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public XMLHttpRe > bool responseCacheIsValid() const { return m_responseCacheIsValid; } > void didCacheResponse(); > >- enum class ResponseType { EmptyString, Arraybuffer, Blob, Document, Json, Text }; >+ // Keep it in 3bits. >+ enum class ResponseType : uint8_t { >+ EmptyString = 0, >+ Arraybuffer = 1, >+ Blob = 2, >+ Document = 3, >+ Json = 4, >+ Text = 5, >+ }; > ExceptionOr<void> setResponseType(ResponseType); > ResponseType responseType() const; > >@@ -178,6 +187,23 @@ class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public XMLHttpRe > void resumeTimerFired(); > Ref<TextResourceDecoder> createDecoder() const; > >+ void networkErrorTimerFired(); >+ >+ unsigned m_async : 1; >+ unsigned m_includeCredentials : 1; >+ unsigned m_sendFlag : 1; >+ unsigned m_createdDocument : 1; >+ unsigned m_error : 1; >+ unsigned m_uploadListenerFlag : 1; >+ unsigned m_uploadComplete : 1; >+ unsigned m_wasAbortedByClient : 1; >+ unsigned m_responseCacheIsValid : 1; >+ unsigned m_dispatchErrorOnResuming : 1; >+ unsigned m_readyState : 3; >+ unsigned m_responseType : 3; >+ >+ unsigned m_timeoutMilliseconds { 0 }; >+ > std::unique_ptr<XMLHttpRequestUpload> m_upload; > > URL m_url; >@@ -185,56 +211,45 @@ class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public XMLHttpRe > HTTPHeaderMap m_requestHeaders; > RefPtr<FormData> m_requestEntityBody; > String m_mimeTypeOverride; >- bool m_async { true }; >- bool m_includeCredentials { false }; > > RefPtr<ThreadableLoader> m_loader; >- State m_state { UNSENT }; >- bool m_sendFlag { false }; > >- ResourceResponse m_response; > String m_responseEncoding; > >+ ResourceResponse m_response; >+ > RefPtr<TextResourceDecoder> m_decoder; > >- StringBuilder m_responseBuilder; >- bool m_createdDocument { false }; > RefPtr<Document> m_responseDocument; > > RefPtr<SharedBuffer> m_binaryResponseBuilder; > >- bool m_error { false }; >- >- bool m_uploadListenerFlag { false }; >- bool m_uploadComplete { false }; >- >- bool m_wasAbortedByClient { false }; >+ StringBuilder m_responseBuilder; > > // Used for progress event tracking. > long long m_receivedLength { 0 }; > >- std::optional<ExceptionCode> m_exceptionCode; >- > XMLHttpRequestProgressEventThrottle m_progressEventThrottle; > >- ResponseType m_responseType { ResponseType::EmptyString }; >- bool m_responseCacheIsValid { false }; > mutable String m_allResponseHeaders; > > Timer m_resumeTimer; >- bool m_dispatchErrorOnResuming { false }; >- > Timer m_networkErrorTimer; >- void networkErrorTimerFired(); >+ Timer m_timeoutTimer; > >- unsigned m_timeoutMilliseconds { 0 }; > MonotonicTime m_sendingTime; >- Timer m_timeoutTimer; >+ >+ std::optional<ExceptionCode> m_exceptionCode; > }; > > inline auto XMLHttpRequest::responseType() const -> ResponseType > { >- return m_responseType; >+ return static_cast<ResponseType>(m_responseType); >+} >+ >+inline auto XMLHttpRequest::readyState() const -> State >+{ >+ return static_cast<State>(m_readyState); > } > > } // namespace WebCore >diff --git a/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp b/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp >index 58c2ffbb3996bb21c3dcbe42c67b974a681b038e..4a19c479c763c77c36d902fa4eb92fe8006fc169 100644 >--- a/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp >+++ b/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp >@@ -37,11 +37,6 @@ const Seconds XMLHttpRequestProgressEventThrottle::minimumProgressEventDispatchi > > XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle(EventTarget* target) > : m_target(target) >- , m_hasThrottledProgressEvent(false) >- , m_lengthComputable(false) >- , m_loaded(0) >- , m_total(0) >- , m_deferEvents(false) > , m_dispatchDeferredEventsTimer(*this, &XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents) > { > ASSERT(target); >diff --git a/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h b/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h >index 01c17a66f295d746f5a0ed3a0471ec79b812a0b3..553f10398a4c0799d868f651bfc06a49a6d22097 100644 >--- a/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h >+++ b/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h >@@ -67,15 +67,16 @@ class XMLHttpRequestProgressEventThrottle : public TimerBase { > // Weak pointer to our XMLHttpRequest object as it is the one holding us. > EventTarget* m_target; > >- bool m_hasThrottledProgressEvent; >- bool m_lengthComputable; >- unsigned long long m_loaded; >- unsigned long long m_total; >+ unsigned long long m_loaded { 0 }; >+ unsigned long long m_total { 0 }; > >- bool m_deferEvents; > RefPtr<Event> m_deferredProgressEvent; > Vector<Ref<Event>> m_deferredEvents; > Timer m_dispatchDeferredEventsTimer; >+ >+ bool m_hasThrottledProgressEvent { false }; >+ bool m_lengthComputable { false }; >+ bool m_deferEvents { false }; > }; > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
saam
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188944
: 348076