Changeset 234003 in webkit
- Timestamp:
- Jul 19, 2018 1:51:48 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r234002 r234003 1 2018-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 1 13 2018-07-19 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
r233994 r234003 46 46 } 47 47 48 FetchBodyOwner::~FetchBodyOwner()49 {50 if (m_readableStreamSource)51 m_readableStreamSource->detach();52 }53 54 48 void FetchBodyOwner::stop() 55 49 { -
trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.h
r233994 r234003 42 42 public: 43 43 FetchBodyOwner(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&); 44 ~FetchBodyOwner();45 44 46 45 bool bodyUsed() const { return isDisturbed(); } -
trunk/Source/WebCore/Modules/fetch/FetchBodySource.cpp
r233994 r234003 35 35 36 36 FetchBodySource::FetchBodySource(FetchBodyOwner& bodyOwner) 37 : m_bodyOwner( &bodyOwner)37 : m_bodyOwner(bodyOwner) 38 38 { 39 39 } … … 41 41 void FetchBodySource::setActive() 42 42 { 43 ASSERT(m_bodyOwner); 44 if (m_bodyOwner) 45 m_bodyOwner->setPendingActivity(m_bodyOwner); 43 m_bodyOwner.setPendingActivity(&m_bodyOwner); 46 44 } 47 45 48 46 void FetchBodySource::setInactive() 49 47 { 50 ASSERT(m_bodyOwner); 51 if (m_bodyOwner) 52 m_bodyOwner->unsetPendingActivity(m_bodyOwner); 48 m_bodyOwner.unsetPendingActivity(&m_bodyOwner); 53 49 } 54 50 55 51 void FetchBodySource::doStart() 56 52 { 57 ASSERT(m_bodyOwner); 58 if (m_bodyOwner) 59 m_bodyOwner->consumeBodyAsStream(); 53 m_bodyOwner.consumeBodyAsStream(); 60 54 } 61 55 62 56 void FetchBodySource::doPull() 63 57 { 64 ASSERT(m_bodyOwner); 65 if (m_bodyOwner) 66 m_bodyOwner->feedStream(); 58 m_bodyOwner.feedStream(); 67 59 } 68 60 … … 70 62 { 71 63 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(); 78 65 } 79 66 80 67 void FetchBodySource::close() 81 68 { 82 m_bodyOwner = nullptr;83 69 controller().close(); 84 70 clean(); … … 87 73 void FetchBodySource::error(const String& value) 88 74 { 89 m_bodyOwner = nullptr;90 75 controller().error(value); 91 76 clean(); -
trunk/Source/WebCore/Modules/fetch/FetchBodySource.h
r233994 r234003 50 50 51 51 void resolvePullPromise() { pullFinished(); } 52 void detach() { m_bodyOwner = nullptr; }53 52 54 53 private: … … 59 58 void setInactive() final; 60 59 61 FetchBodyOwner *m_bodyOwner;60 FetchBodyOwner& m_bodyOwner; 62 61 bool m_isCancelling { false }; 63 62 }; -
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
r233994 r234003 226 226 227 227 #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()) 232 229 m_response.closeStream(); 233 }234 230 #endif 235 231 if (auto consumeDataCallback = WTFMove(m_consumeDataCallback)) … … 257 253 if (m_response.m_readableStreamSource) { 258 254 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); 260 256 m_response.m_readableStreamSource = nullptr; 261 257 }
Note: See TracChangeset
for help on using the changeset viewer.