Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: Source/modules/fetch/Body.cpp

Issue 883323004: Revert of Use ExclusiveStreamReader to lock Body. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@exclusive-reader
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/fetch/Body.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/Body.cpp
diff --git a/Source/modules/fetch/Body.cpp b/Source/modules/fetch/Body.cpp
index 7072faa5e72ec3d9aa2e59d5cb3afde8b15776e5..b90a6ca9c0452344f034f2e65f0a02c6656e8c4c 100644
--- a/Source/modules/fetch/Body.cpp
+++ b/Source/modules/fetch/Body.cpp
@@ -15,7 +15,6 @@
#include "core/fileapi/FileReaderLoader.h"
#include "core/fileapi/FileReaderLoaderClient.h"
#include "core/frame/UseCounter.h"
-#include "core/streams/ExclusiveStreamReader.h"
#include "core/streams/UnderlyingSource.h"
#include "modules/fetch/BodyStreamBuffer.h"
@@ -234,7 +233,7 @@
ScriptPromise Body::readAsync(ScriptState* scriptState, ResponseType type)
{
- if (bodyUsed())
+ if (m_bodyUsed)
return ScriptPromise::reject(scriptState, V8ThrowException::createTypeError(scriptState->isolate(), "Already read"));
// When the main thread sends a V8::TerminateExecution() signal to a worker
@@ -247,7 +246,7 @@
if (!executionContext)
return ScriptPromise();
- setBodyUsed();
+ m_bodyUsed = true;
m_responseType = type;
ASSERT(!m_resolver);
@@ -347,20 +346,11 @@
bool Body::bodyUsed() const
{
- return m_bodyUsed || (m_stream && m_stream->isLocked());
+ return m_bodyUsed;
}
void Body::setBodyUsed()
{
- ASSERT(!m_bodyUsed);
- ASSERT(!m_stream || !m_stream->isLocked());
- // Note that technically we can set BodyUsed even when the stream is
- // closed or errored, but getReader doesn't work then.
- if (m_stream && m_stream->stateInternal() != ReadableStream::Closed && m_stream->stateInternal() != ReadableStream::Errored) {
- TrackExceptionState exceptionState;
- m_streamReader = m_stream->getReader(exceptionState);
- ASSERT(!exceptionState.hadException());
- }
m_bodyUsed = true;
}
@@ -399,7 +389,6 @@
visitor->trace(m_resolver);
visitor->trace(m_stream);
visitor->trace(m_streamSource);
- visitor->trace(m_streamReader);
ActiveDOMObject::trace(visitor);
}
« no previous file with comments | « Source/modules/fetch/Body.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698