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

Unified Diff: Source/core/streams/ReadableStream.h

Issue 901013002: Revert of Introduce ExclusiveStreamReader. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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/core/streams/ExclusiveStreamReaderTest.cpp ('k') | Source/core/streams/ReadableStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/streams/ReadableStream.h
diff --git a/Source/core/streams/ReadableStream.h b/Source/core/streams/ReadableStream.h
index 0b5337b0777523c3a06fdd7bd0d68dd7cef31480..28deb583ab43af3d2ba1556aa53298a3328d3445 100644
--- a/Source/core/streams/ReadableStream.h
+++ b/Source/core/streams/ReadableStream.h
@@ -21,7 +21,6 @@
class DOMException;
class ExceptionState;
-class ExclusiveStreamReader;
class UnderlyingSource;
class ReadableStream : public GarbageCollectedFinalized<ReadableStream>, public ScriptWrappable, public ActiveDOMObject {
@@ -44,48 +43,31 @@
bool isStarted() const { return m_isStarted; }
bool isDraining() const { return m_isDraining; }
bool isPulling() const { return m_isPulling; }
- State stateInternal() const { return m_state; }
- DOMException* storedException() { return m_exception.get(); }
+ State state() const { return m_state; }
+ String stateString() const;
- // |stateString|, |read| and |ready| are affected by an exclusive lock. Use
- // |stateInternal|, |readInternal| and |readyInternal| if you want to avoid
- // that.
- String stateString() const;
- ScriptValue read(ScriptState*, ExceptionState&);
+ virtual ScriptValue read(ScriptState*, ExceptionState&) = 0;
ScriptPromise ready(ScriptState*);
ScriptPromise cancel(ScriptState*, ScriptValue reason);
ScriptPromise closed(ScriptState*);
-
- virtual ScriptValue readInternal(ScriptState*, ExceptionState&) = 0;
- ScriptPromise readyInternal(ScriptState*);
void close();
void error(PassRefPtrWillBeRawPtr<DOMException>);
void didSourceStart();
- // This function is not a getter. It creates an ExclusiveStreamReader and
- // returns it.
- ExclusiveStreamReader* getReader(ExceptionState&);
- // Only ExclusiveStreamReader methods should call this function.
- void setReader(ExclusiveStreamReader*);
- bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader == reader; }
-
bool hasPendingActivity() const override;
- void trace(Visitor*) override;
-
- // Returns the string representation of the given State.
- static String stateToString(State);
+ virtual void trace(Visitor*) override;
protected:
bool enqueuePreliminaryCheck();
bool enqueuePostAction();
- void readInternalPreliminaryCheck(ExceptionState&);
- void readInternalPostAction();
+ void readPreliminaryCheck(ExceptionState&);
+ void readPostAction();
private:
- using WaitPromise = ScriptPromiseProperty<Member<ReadableStream>, ToV8UndefinedGenerator, RefPtrWillBeMember<DOMException>>;
- using ClosedPromise = ScriptPromiseProperty<Member<ReadableStream>, ToV8UndefinedGenerator, RefPtrWillBeMember<DOMException>>;
+ typedef ScriptPromiseProperty<Member<ReadableStream>, ToV8UndefinedGenerator, RefPtrWillBeMember<DOMException> > WaitPromise;
+ typedef ScriptPromiseProperty<Member<ReadableStream>, ToV8UndefinedGenerator, RefPtrWillBeMember<DOMException> > ClosedPromise;
virtual bool isQueueEmpty() const = 0;
virtual void clearQueue() = 0;
@@ -102,9 +84,7 @@
Member<WaitPromise> m_ready;
Member<ClosedPromise> m_closed;
-
RefPtrWillBeMember<DOMException> m_exception;
- Member<ExclusiveStreamReader> m_reader;
};
} // namespace blink
« no previous file with comments | « Source/core/streams/ExclusiveStreamReaderTest.cpp ('k') | Source/core/streams/ReadableStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698