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

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

Issue 1167343002: Add methods for creating V8 extras-based ReadableStreams from C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove C++ queuing strategies Created 5 years, 6 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/ReadableStreamController.h ('k') | Source/core/streams/UnderlyingSourceBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/streams/UnderlyingSourceBase.h
diff --git a/Source/core/streams/UnderlyingSourceBase.h b/Source/core/streams/UnderlyingSourceBase.h
new file mode 100644
index 0000000000000000000000000000000000000000..6e178f279e8abd09b2ccbce3b59631d2496f5614
--- /dev/null
+++ b/Source/core/streams/UnderlyingSourceBase.h
@@ -0,0 +1,38 @@
+#ifndef UnderlyingSourceBase_h
+#define UnderlyingSourceBase_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/CoreExport.h"
+#include "core/streams/ReadableStreamController.h"
+
+namespace blink {
+
+// TODO do we need ActiveDOMObject??
+
+class CORE_EXPORT UnderlyingSourceBase : public GarbageCollectedFinalized<UnderlyingSourceBase>, public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+public:
+ ScriptPromise startWrapper(ScriptState*, ScriptValue stream);
+ virtual ScriptPromise start(ScriptState*);
+ virtual ScriptPromise pull(ScriptState*);
+ virtual ScriptPromise cancel(ScriptState*, ScriptValue reason);
+
+ DECLARE_VIRTUAL_TRACE();
+
+protected:
+ // TODO is a reference a good idea?
+ ReadableStreamController& controller() const { return *m_controller; }
+
+private:
+ // TODO should be using a smart pointer of some sort ... Member<>? Persistent<>? RefPtr<>?
+ // ReadableStreamController is not GarbageCollectedFinalized<>... if we made it so, how do we handle it
+ // containing a ScriptValue?
+ ReadableStreamController* m_controller;
yhirano 2015/06/12 03:40:59 Can we have a controller of type ReadableStreamCon
+};
+
+} // namespace blink
+
+#endif UnderlyingSourceBase_h
« no previous file with comments | « Source/core/streams/ReadableStreamController.h ('k') | Source/core/streams/UnderlyingSourceBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698