Changeset 234003 in webkit


Ignore:
Timestamp:
Jul 19, 2018 1:51:48 PM (6 years ago)
Author:
david_fenton@apple.com
Message:

Unreviewed, rolling out r233994.

Caused EWS and bot failures due to assertions added

Reverted changeset:

"FetchResponse should close its stream when loading finishes"
https://bugs.webkit.org/show_bug.cgi?id=187790
https://trac.webkit.org/changeset/233994

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r234002 r234003  
     12018-07-19  David Fenton  <david_fenton@apple.com>
     2
     3        Unreviewed, rolling out r233994.
     4
     5        Caused EWS and bot failures due to assertions added
     6
     7        Reverted changeset:
     8
     9        "FetchResponse should close its stream when loading finishes"
     10        https://bugs.webkit.org/show_bug.cgi?id=187790
     11        https://trac.webkit.org/changeset/233994
     12
    1132018-07-19  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp

    r233994 r234003  
    4646}
    4747
    48 FetchBodyOwner::~FetchBodyOwner()
    49 {
    50     if (m_readableStreamSource)
    51         m_readableStreamSource->detach();
    52 }
    53 
    5448void FetchBodyOwner::stop()
    5549{
  • trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.h

    r233994 r234003  
    4242public:
    4343    FetchBodyOwner(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&);
    44     ~FetchBodyOwner();
    4544
    4645    bool bodyUsed() const { return isDisturbed(); }
  • trunk/Source/WebCore/Modules/fetch/FetchBodySource.cpp

    r233994 r234003  
    3535
    3636FetchBodySource::FetchBodySource(FetchBodyOwner& bodyOwner)
    37     : m_bodyOwner(&bodyOwner)
     37    : m_bodyOwner(bodyOwner)
    3838{
    3939}
     
    4141void FetchBodySource::setActive()
    4242{
    43     ASSERT(m_bodyOwner);
    44     if (m_bodyOwner)
    45         m_bodyOwner->setPendingActivity(m_bodyOwner);
     43    m_bodyOwner.setPendingActivity(&m_bodyOwner);
    4644}
    4745
    4846void FetchBodySource::setInactive()
    4947{
    50     ASSERT(m_bodyOwner);
    51     if (m_bodyOwner)
    52         m_bodyOwner->unsetPendingActivity(m_bodyOwner);
     48    m_bodyOwner.unsetPendingActivity(&m_bodyOwner);
    5349}
    5450
    5551void FetchBodySource::doStart()
    5652{
    57     ASSERT(m_bodyOwner);
    58     if (m_bodyOwner)
    59         m_bodyOwner->consumeBodyAsStream();
     53    m_bodyOwner.consumeBodyAsStream();
    6054}
    6155
    6256void FetchBodySource::doPull()
    6357{
    64     ASSERT(m_bodyOwner);
    65     if (m_bodyOwner)
    66         m_bodyOwner->feedStream();
     58    m_bodyOwner.feedStream();
    6759}
    6860
     
    7062{
    7163    m_isCancelling = true;
    72     ASSERT(m_bodyOwner);
    73     if (!m_bodyOwner)
    74         return;
    75 
    76     m_bodyOwner->cancel();
    77     m_bodyOwner = nullptr;
     64    m_bodyOwner.cancel();
    7865}
    7966
    8067void FetchBodySource::close()
    8168{
    82     m_bodyOwner = nullptr;
    8369    controller().close();
    8470    clean();
     
    8773void FetchBodySource::error(const String& value)
    8874{
    89     m_bodyOwner = nullptr;
    9075    controller().error(value);
    9176    clean();
  • trunk/Source/WebCore/Modules/fetch/FetchBodySource.h

    r233994 r234003  
    5050
    5151    void resolvePullPromise() { pullFinished(); }
    52     void detach() { m_bodyOwner = nullptr; }
    5352
    5453private:
     
    5958    void setInactive() final;
    6059
    61     FetchBodyOwner* m_bodyOwner;
     60    FetchBodyOwner& m_bodyOwner;
    6261    bool m_isCancelling { false };
    6362};
  • trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp

    r233994 r234003  
    226226
    227227#if ENABLE(STREAMS_API)
    228     if (m_response.m_readableStreamSource) {
    229         if (m_response.body().consumer().hasData())
    230             m_response.m_readableStreamSource->enqueue(m_response.body().consumer().takeAsArrayBuffer());
    231 
     228    if (m_response.m_readableStreamSource && !m_response.body().consumer().hasData())
    232229        m_response.closeStream();
    233     }
    234230#endif
    235231    if (auto consumeDataCallback = WTFMove(m_consumeDataCallback))
     
    257253    if (m_response.m_readableStreamSource) {
    258254        if (!m_response.m_readableStreamSource->isCancelling())
    259             m_response.m_readableStreamSource->error(makeString("Loading failed: "_s, error.localizedDescription()));
     255            m_response.m_readableStreamSource->error("Loading failed"_s);
    260256        m_response.m_readableStreamSource = nullptr;
    261257    }
Note: See TracChangeset for help on using the changeset viewer.