Title: [235355] trunk/Source
Revision
235355
Author
yusukesuz...@slowstart.org
Date
2018-08-27 01:30:58 -0700 (Mon, 27 Aug 2018)

Log Message

Shrink size of XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=188944

Reviewed by Saam Barati.

Source/WebCore:

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:

Source/WTF:

StringBuilder is included in XMLHttpRequest. We reduce the size of StringBuilder too
by reordering members.

* wtf/text/StringBuilder.h:
(WTF::StringBuilder::StringBuilder):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (235354 => 235355)


--- trunk/Source/WTF/ChangeLog	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WTF/ChangeLog	2018-08-27 08:30:58 UTC (rev 235355)
@@ -1,3 +1,16 @@
+2018-08-25  Yusuke Suzuki  <yusukesuz...@slowstart.org>
+
+        Shrink size of XMLHttpRequest
+        https://bugs.webkit.org/show_bug.cgi?id=188944
+
+        Reviewed by Saam Barati.
+
+        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_hor...@apple.com>
 
         Improve unified source generator script logging and error messages

Modified: trunk/Source/WTF/wtf/text/StringBuilder.h (235354 => 235355)


--- trunk/Source/WTF/wtf/text/StringBuilder.h	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WTF/wtf/text/StringBuilder.h	2018-08-27 08:30:58 UTC (rev 235355)
@@ -40,9 +40,7 @@
 
 public:
     StringBuilder()
-        : m_length(0)
-        , m_is8Bit(true)
-        , m_bufferCharacters8(nullptr)
+        : m_bufferCharacters8(nullptr)
     {
     }
     StringBuilder(StringBuilder&&) = default;
@@ -308,14 +306,14 @@
     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 <>

Modified: trunk/Source/WebCore/ChangeLog (235354 => 235355)


--- trunk/Source/WebCore/ChangeLog	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WebCore/ChangeLog	2018-08-27 08:30:58 UTC (rev 235355)
@@ -1,3 +1,46 @@
+2018-08-25  Yusuke Suzuki  <yusukesuz...@slowstart.org>
+
+        Shrink size of XMLHttpRequest
+        https://bugs.webkit.org/show_bug.cgi?id=188944
+
+        Reviewed by Saam Barati.
+
+        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-26  Zalan Bujtas  <za...@apple.com>
 
         [LFC][Floating] FloatBox -> FloatAvoider

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (235354 => 235355)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2018-08-27 08:30:58 UTC (rev 235355)
@@ -111,6 +111,18 @@
 
 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 @@
 
 #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 @@
 {
     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 @@
         // 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 @@
 
 Ref<Blob> XMLHttpRequest::createResponseBlob()
 {
-    ASSERT(m_responseType == ResponseType::Blob);
+    ASSERT(responseType() == ResponseType::Blob);
     ASSERT(doneWithoutErrors());
 
     if (!m_binaryResponseBuilder)
@@ -226,7 +233,7 @@
 
 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 @@
     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 @@
         return Exception { InvalidAccessError };
     }
 
-    m_responseType = type;
+    m_responseType = static_cast<unsigned>(type);
     return { };
 }
 
@@ -288,8 +295,8 @@
 
 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 @@
     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 @@
 
 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 @@
         // 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 @@
 
     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 @@
         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 @@
     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 @@
 
 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::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 @@
 
 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::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 @@
 
 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 @@
 
 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 @@
     if (m_error)
         return;
 
-    if (m_state < HEADERS_RECEIVED)
+    if (readyState() < HEADERS_RECEIVED)
         changeState(HEADERS_RECEIVED);
 
     if (m_decoder)
@@ -977,7 +984,7 @@
     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 @@
     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 @@
     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 @@
             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 @@
     m_exceptionCode = TimeoutError;
 
     if (!m_async) {
-        m_state = DONE;
+        m_readyState = static_cast<State>(DONE);
         m_exceptionCode = TimeoutError;
         return;
     }

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (235354 => 235355)


--- trunk/Source/WebCore/xml/XMLHttpRequest.h	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h	2018-08-27 08:30:58 UTC (rev 235355)
@@ -49,13 +49,14 @@
 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 @@
     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 @@
     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 @@
     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 @@
     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 };
+    StringBuilder m_responseBuilder;
 
-    bool m_uploadListenerFlag { false };
-    bool m_uploadComplete { false };
-
-    bool m_wasAbortedByClient { false };
-
     // 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

Modified: trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp (235354 => 235355)


--- trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp	2018-08-27 08:30:58 UTC (rev 235355)
@@ -37,11 +37,6 @@
 
 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);

Modified: trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h (235354 => 235355)


--- trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h	2018-08-27 07:48:54 UTC (rev 235354)
+++ trunk/Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h	2018-08-27 08:30:58 UTC (rev 235355)
@@ -67,15 +67,16 @@
     // 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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to