WebKit Bugzilla
Attachment 372680 Details for
Bug 187460
: ResourceResponseBase wastes a lot of space because of std::optional<>
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187460-20190622174731.patch (text/plain), 3.55 KB, created by
Rob Buis
on 2019-06-22 08:47:34 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-06-22 08:47:34 PDT
Size:
3.55 KB
patch
obsolete
>Subversion Revision: 246709 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 80896f8e9f86f52bb683773c1f23577bb9458c6b..d6d1da7a0f2cf3813c6a417a19394efcae744906 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-06-22 Rob Buis <rbuis@igalia.com> >+ >+ ResourceResponseBase wastes a lot of space because of std::optional<> >+ https://bugs.webkit.org/show_bug.cgi?id=187460 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Waste less space in ResourceResponseBase by shrinking >+ ParsedContentRange. >+ >+ No new tests because there is no behavior change. >+ >+ * platform/network/ParsedContentRange.cpp: >+ (WebCore::ParsedContentRange::ParsedContentRange): >+ (WebCore::ParsedContentRange::headerValue const): >+ * platform/network/ParsedContentRange.h: >+ (WebCore::ParsedContentRange::isValid const): >+ > 2019-06-21 Sihui Liu <sihui_liu@apple.com> > > openDatabase should return an empty object when WebSQL is disabled >diff --git a/Source/WebCore/platform/network/ParsedContentRange.cpp b/Source/WebCore/platform/network/ParsedContentRange.cpp >index a3d4f044059dfd9a57b31929db8f112c15f62113..25704b61a3dbde3c15faedfe6363c868589b7e80 100644 >--- a/Source/WebCore/platform/network/ParsedContentRange.cpp >+++ b/Source/WebCore/platform/network/ParsedContentRange.cpp >@@ -111,7 +111,8 @@ static bool parseContentRange(const String& headerValue, int64_t& firstBytePosit > > ParsedContentRange::ParsedContentRange(const String& headerValue) > { >- m_isValid = parseContentRange(headerValue, m_firstBytePosition, m_lastBytePosition, m_instanceLength); >+ if (!parseContentRange(headerValue, m_firstBytePosition, m_lastBytePosition, m_instanceLength)) >+ m_firstBytePosition = -1; > } > > ParsedContentRange::ParsedContentRange(int64_t firstBytePosition, int64_t lastBytePosition, int64_t instanceLength) >@@ -119,12 +120,13 @@ ParsedContentRange::ParsedContentRange(int64_t firstBytePosition, int64_t lastBy > , m_lastBytePosition(lastBytePosition) > , m_instanceLength(instanceLength) > { >- m_isValid = areContentRangeValuesValid(m_firstBytePosition, m_lastBytePosition, m_instanceLength); >+ if (!areContentRangeValuesValid(m_firstBytePosition, m_lastBytePosition, m_instanceLength)) >+ m_firstBytePosition = -1; > } > > String ParsedContentRange::headerValue() const > { >- if (!m_isValid) >+ if (!isValid()) > return String(); > if (m_instanceLength == UnknownLength) > return makeString("bytes ", m_firstBytePosition, '-', m_lastBytePosition, "/*"); >diff --git a/Source/WebCore/platform/network/ParsedContentRange.h b/Source/WebCore/platform/network/ParsedContentRange.h >index 5a0704bd4b96fdcba90dc14ca466cb8efd7de5c0..c991a90e29a345059935d1f36b49a060a3afe026 100644 >--- a/Source/WebCore/platform/network/ParsedContentRange.h >+++ b/Source/WebCore/platform/network/ParsedContentRange.h >@@ -36,7 +36,7 @@ public: > ParsedContentRange() { } > WEBCORE_EXPORT ParsedContentRange(int64_t firstBytePosition, int64_t lastBytePosition, int64_t instanceLength); > >- bool isValid() const { return m_isValid; } >+ bool isValid() const { return m_firstBytePosition >= 0; } > int64_t firstBytePosition() const { return m_firstBytePosition; } > int64_t lastBytePosition() const { return m_lastBytePosition; } > int64_t instanceLength() const { return m_instanceLength; } >@@ -51,7 +51,6 @@ private: > int64_t m_firstBytePosition { 0 }; > int64_t m_lastBytePosition { 0 }; > int64_t m_instanceLength { UnknownLength }; >- bool m_isValid { false }; > }; > > }
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187460
:
346147
|
372680
|
372681
|
372682
|
372683
|
372684
|
372698
|
372702
|
372703
|
372704
|
372706
|
372707
|
372708
|
372712
|
372713
|
372716
|
372738
|
372783
|
372788
|
372789
|
372799
|
372802
|
373173
|
373175
|
373176
|
373194