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

Side by Side Diff: Source/core/streams/ReadableStream.h

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 unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | Source/modules/fetch/Body.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ReadableStream_h 5 #ifndef ReadableStream_h
6 #define ReadableStream_h 6 #define ReadableStream_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseProperty.h" 9 #include "bindings/core/v8/ScriptPromiseProperty.h"
10 #include "bindings/core/v8/ScriptState.h" 10 #include "bindings/core/v8/ScriptState.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void close(); 62 void close();
63 void error(PassRefPtrWillBeRawPtr<DOMException>); 63 void error(PassRefPtrWillBeRawPtr<DOMException>);
64 64
65 void didSourceStart(); 65 void didSourceStart();
66 66
67 // This function is not a getter. It creates an ExclusiveStreamReader and 67 // This function is not a getter. It creates an ExclusiveStreamReader and
68 // returns it. 68 // returns it.
69 ExclusiveStreamReader* getReader(ExceptionState&); 69 ExclusiveStreamReader* getReader(ExceptionState&);
70 // Only ExclusiveStreamReader methods should call this function. 70 // Only ExclusiveStreamReader methods should call this function.
71 void setReader(ExclusiveStreamReader*); 71 void setReader(ExclusiveStreamReader*);
72
73 bool isLocked() const { return m_reader; }
74 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader == reader; } 72 bool isLockedTo(const ExclusiveStreamReader* reader) const { return m_reader == reader; }
75 73
76 bool hasPendingActivity() const override; 74 bool hasPendingActivity() const override;
77 void trace(Visitor*) override; 75 void trace(Visitor*) override;
78 76
79 // Returns the string representation of the given State. 77 // Returns the string representation of the given State.
80 static String stateToString(State); 78 static String stateToString(State);
81 79
82 protected: 80 protected:
83 bool enqueuePreliminaryCheck(); 81 bool enqueuePreliminaryCheck();
(...skipping 21 matching lines...) Expand all
105 Member<WaitPromise> m_ready; 103 Member<WaitPromise> m_ready;
106 Member<ClosedPromise> m_closed; 104 Member<ClosedPromise> m_closed;
107 105
108 RefPtrWillBeMember<DOMException> m_exception; 106 RefPtrWillBeMember<DOMException> m_exception;
109 Member<ExclusiveStreamReader> m_reader; 107 Member<ExclusiveStreamReader> m_reader;
110 }; 108 };
111 109
112 } // namespace blink 110 } // namespace blink
113 111
114 #endif // ReadableStream_h 112 #endif // ReadableStream_h
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | Source/modules/fetch/Body.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698