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

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

Issue 1028913002: ReadableStream.cancel's parameter should be optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « Source/core/streams/ReadableStream.idl ('k') | Source/core/streams/ReadableStreamReader.cpp » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 ReadableStreamReader_h 5 #ifndef ReadableStreamReader_h
6 #define ReadableStreamReader_h 6 #define ReadableStreamReader_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/ScriptValue.h" 10 #include "bindings/core/v8/ScriptValue.h"
(...skipping 13 matching lines...) Expand all
24 // https://streams.spec.whatwg.org/. 24 // https://streams.spec.whatwg.org/.
25 class ReadableStreamReader final : public GarbageCollectedFinalized<ReadableStre amReader>, public ScriptWrappable, public ActiveDOMObject { 25 class ReadableStreamReader final : public GarbageCollectedFinalized<ReadableStre amReader>, public ScriptWrappable, public ActiveDOMObject {
26 DEFINE_WRAPPERTYPEINFO(); 26 DEFINE_WRAPPERTYPEINFO();
27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ReadableStreamReader); 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ReadableStreamReader);
28 public: 28 public:
29 // The stream must not be locked to any ReadableStreamReader when called. 29 // The stream must not be locked to any ReadableStreamReader when called.
30 ReadableStreamReader(ReadableStream*); 30 ReadableStreamReader(ReadableStream*);
31 31
32 ScriptPromise closed(ScriptState*); 32 ScriptPromise closed(ScriptState*);
33 bool isActive() const; 33 bool isActive() const;
34 ScriptPromise cancel(ScriptState*);
34 ScriptPromise cancel(ScriptState*, ScriptValue reason); 35 ScriptPromise cancel(ScriptState*, ScriptValue reason);
35 ScriptPromise read(ScriptState*); 36 ScriptPromise read(ScriptState*);
36 void releaseLock(ExceptionState&); 37 void releaseLock(ExceptionState&);
37 void releaseLock(); 38 void releaseLock();
38 39
39 bool hasPendingActivity() const override; 40 bool hasPendingActivity() const override;
40 void stop() override; 41 void stop() override;
41 42
42 DECLARE_TRACE(); 43 DECLARE_TRACE();
43 44
44 private: 45 private:
45 using ClosedPromise = ScriptPromiseProperty<Member<ReadableStreamReader>, To V8UndefinedGenerator, RefPtrWillBeMember<DOMException>>; 46 using ClosedPromise = ScriptPromiseProperty<Member<ReadableStreamReader>, To V8UndefinedGenerator, RefPtrWillBeMember<DOMException>>;
46 47
47 const Member<ReadableStream> m_stream; 48 const Member<ReadableStream> m_stream;
48 ReadableStream::State m_stateAfterRelease; 49 ReadableStream::State m_stateAfterRelease;
49 Member<ClosedPromise> m_closed; 50 Member<ClosedPromise> m_closed;
50 }; 51 };
51 52
52 } // namespace blink 53 } // namespace blink
53 54
54 #endif // ReadableStreamReader_h 55 #endif // ReadableStreamReader_h
OLDNEW
« no previous file with comments | « Source/core/streams/ReadableStream.idl ('k') | Source/core/streams/ReadableStreamReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698