[Webkit-unassigned] [Bug 207497] PersistentCoders should use modern decoding syntax

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 11 21:52:09 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=207497

--- Comment #9 from Fujii Hironori <Hironori.Fujii at sony.com> ---
Comment on attachment 390285
  --> https://bugs.webkit.org/attachment.cgi?id=390285
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390285&action=review

> Source/WebCore/platform/network/ResourceRequestBase.h:363
>  }

How about idea using Optional only for non-default-constructable class?
How about idea adding error state to decoder as well as std::ios_base::iostate?
https://en.cppreference.com/w/cpp/io/ios_base/iostate

Then, ResourceRequestBase::decodeBase can be simplified like the following.

template<class Decoder>
ALWAYS_INLINE void ResourceRequestBase::decodeBase(Decoder& decoder)
{
    String firstPartyForCookies;

    decoder >> m_url;
    decoder >> m_timeoutInterval;
    decoder >> firstPartyForCookies;
    decoder >> m_httpMethod;
    decoder >> m_httpHeaderFields;
    decoder >> m_responseContentDispositionEncodingFallbackArray;
    decoder >> m_cachePolicy;
    decoder >> m_allowCookies;
    decoder >> m_sameSiteDisposition;
    decoder >> m_isTopSite;
    decoder >> m_priority;
    decoder >> m_requester;

    if (decoder.didFail)
        return;

    m_firstPartyForCookies = URL({ }, firstPartyForCookies);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200212/2f374ef1/attachment.htm>


More information about the webkit-unassigned mailing list