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

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

Issue 1118673002: Implement ReadableStream as a V8 extra (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanups; make controller a member instead of arg Created 5 years, 7 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
OLDNEW
(Empty)
1 #ifndef ScriptUnderlyingSource_h
2 #define ScriptUnderlyingSource_h
3
4 #include "bindings/core/v8/ScriptPromise.h"
5 #include "bindings/core/v8/ScriptValue.h"
6 #include "bindings/core/v8/ScriptWrappable.h"
7 #include "core/streams/ScriptReadableStreamController.h"
8
9 namespace blink {
10
11 // TODO do we need ActiveDOMObject??
12
13 class CORE_EXPORT ScriptUnderlyingSource : public GarbageCollectedFinalized<Scri ptUnderlyingSource>, public ScriptWrappable {
14 DEFINE_WRAPPERTYPEINFO();
15
16 public:
17 ScriptPromise start(ScriptValue stream);
18 ScriptPromise pull();
19 ScriptPromise cancel(ScriptValue reason);
20
21 DECLARE_VIRTUAL_TRACE();
22
23 protected:
24 virtual ScriptPromise startImpl() = 0;
25 virtual ScriptPromise pullImpl() = 0;
26 virtual ScriptPromise cancelImpl(ScriptValue reason) = 0;
27
28 // TODO is a reference a good idea?
29 ScriptReadableStreamController& controller() const { return *m_controller; }
30
31 private:
32 // TODO should be using a smart pointer of some sort ... Member<>? Persisten t<>? RefPtr<>?
33 // ScriptReadableStreamController is not GarbageCollectedFinalized<>... if w e made it so, how do we handle it
34 // containing a ScriptValue?
35 ScriptReadableStreamController* m_controller;
36 };
37
38 } // namespace blink
39
40 #endif ScriptUnderlyingSource_h
OLDNEW
« no previous file with comments | « Source/core/streams/ScriptReadableStreamController.cpp ('k') | Source/core/streams/ScriptUnderlyingSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698