| Index: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
|
| index 0880c42a4e4a2bcf7277af75a01deae7be8da739..6a4c58ef396687d09d3aa7c1dbe51d797ec5c0b4 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
|
| @@ -82,30 +82,36 @@ BodyStreamBuffer::BodyStreamBuffer(PassOwnPtr<FetchDataConsumerHandle> handle)
|
| m_stream->didSourceStart();
|
| }
|
|
|
| -PassRefPtr<BlobDataHandle> BodyStreamBuffer::drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::BlobSizePolicy policy)
|
| +PassRefPtr<BlobDataHandle> BodyStreamBuffer::drainAsBlobDataHandle(ExecutionContext* executionContext, FetchDataConsumerHandle::Reader::BlobSizePolicy policy)
|
| {
|
| ASSERT(!isStreamLocked());
|
| - m_stream->setIsDisturbed();
|
| + ASSERT(!isStreamDisturbed());
|
| if (isStreamClosed() || isStreamErrored())
|
| return nullptr;
|
|
|
| RefPtr<BlobDataHandle> blobDataHandle = m_reader->drainAsBlobDataHandle(policy);
|
| if (blobDataHandle) {
|
| + NonThrowableExceptionState exceptionState;
|
| + m_stream->getBytesReader(executionContext, exceptionState);
|
| + m_stream->setIsDisturbed();
|
| close();
|
| return blobDataHandle.release();
|
| }
|
| return nullptr;
|
| }
|
|
|
| -PassRefPtr<EncodedFormData> BodyStreamBuffer::drainAsFormData()
|
| +PassRefPtr<EncodedFormData> BodyStreamBuffer::drainAsFormData(ExecutionContext* executionContext)
|
| {
|
| ASSERT(!isStreamLocked());
|
| - m_stream->setIsDisturbed();
|
| + ASSERT(!isStreamDisturbed());
|
| if (isStreamClosed() || isStreamErrored())
|
| return nullptr;
|
|
|
| RefPtr<EncodedFormData> formData = m_reader->drainAsFormData();
|
| if (formData) {
|
| + NonThrowableExceptionState exceptionState;
|
| + m_stream->getBytesReader(executionContext, exceptionState);
|
| + m_stream->setIsDisturbed();
|
| close();
|
| return formData.release();
|
| }
|
| @@ -115,9 +121,10 @@ PassRefPtr<EncodedFormData> BodyStreamBuffer::drainAsFormData()
|
| PassOwnPtr<FetchDataConsumerHandle> BodyStreamBuffer::releaseHandle(ExecutionContext* executionContext)
|
| {
|
| ASSERT(!isStreamLocked());
|
| + ASSERT(!isStreamDisturbed());
|
| m_reader = nullptr;
|
| m_stream->setIsDisturbed();
|
| - TrackExceptionState exceptionState;
|
| + NonThrowableExceptionState exceptionState;
|
| m_stream->getBytesReader(executionContext, exceptionState);
|
|
|
| if (isStreamClosed())
|
|
|